Can someone tell me what php code to use for a link with anchor text?

Discussion in 'PHP' started by ErnieB, Jun 5, 2010.

  1. #1
    Im trying to add a link with anchor text in the footer of a wordpress template. Below is the code and i have placed an "xxxxxxx" where i would like the code to go.

    <!-- Copyright Starts -->
    	<div id="copyright-out">
    	<div id="copyright" class="wrap">
    		<div class="col-left">
    			<p>&copy; <?php the_time('Y'); ?> <?php bloginfo(); ?>. <?php _e('All Rights Reserved.'); ?></p>
    		</div>
    		<div class="col-right">
    			<p>xxxxxxx</p>
    		
    		</div>
    	</div>
    	</div>
    	<!-- Copyright Ends -->
    Code (markup):

     
    ErnieB, Jun 5, 2010 IP
  2. adamsinfo

    adamsinfo Greenhorn

    Messages:
    60
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    18
    #2
    Why do you need PHP codes within the <p>xxxxxx</p> that you've specified? That is just plain HTML: <p><a href="http://www.yoursite.com">Click here</a></p>

    If you want PHP though:
    <?php echo '<p><a href="http://www.yoursite.com">Click here</a></p>'; ?>
     
    adamsinfo, Jun 5, 2010 IP
  3. ErnieB

    ErnieB Well-Known Member

    Messages:
    369
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    130
    #3
    i tried html and it didnt work, dunno why

    Edit: hmmm, that didnt work either. WTH!!

    Edit: Got it to work, THANKS!!!
     
    Last edited: Jun 5, 2010
    ErnieB, Jun 5, 2010 IP
  4. roopajyothi

    roopajyothi Active Member

    Messages:
    1,302
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    80
    #4
    PHP takes html also
    But you need to write like this
    <?php echo 'YOUR HTML CODES HERE'; ?>
    For your problem it looks like

     <?php echo '<p><a href="http://domain.com/ title='Title' target='_blank'>Domain Link</a></p>'; ?> 
    PHP:
     
    roopajyothi, Jun 5, 2010 IP
  5. helvetica

    helvetica Peon

    Messages:
    41
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    You can use normal HTML code here.
     
    helvetica, Jun 6, 2010 IP
  6. roopajyothi

    roopajyothi Active Member

    Messages:
    1,302
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    80
    #6
    Oops we already pointed that with help of echo function :)
     
    roopajyothi, Jun 6, 2010 IP