Bloginfo url to subpage

If you want to put a link in a footer for a theme that you may want to use again you can hard code links but that means extra editing when you try to use the theme again so what you need is a code that call the wordpress url and the subpage. Such things such as the privacy policy or contact pages are good to be shown in the footer.

As we previously discussed <?php bloginfo(‘url’) ?> is the call for the blog url so in my case this is http://dataimagesystems.com/

So instead of hard coding  <a href=”http://dataimagesystems.com/privacy-policy”>Privacy Policy</a>

we would use

<a href="<?php bloginfo('url') ?>/privacy-policy">Privacy Policy</a>

In which the call for url is executed in the <? ?> brackets followed by the hard code as normal (don’t forget the slash) and the rest is identical to the standard href code.

<?php bloginfo(‘url’) ?> .. your friend can be used to call and file or image for your templates to make them cross compatible  with any place you want to take your theme design.

Complete footer code
<p>
<br>Copyright &copy; <?php echo date(‘Y’); ?>  All Rights Reserved.<br><a href=”<?php bloginfo(‘url’); ?>” title=”<?php bloginfo(‘name’); ?>”> <b><?php bloginfo(‘name’); ?> </b></a> <?php bloginfo(‘name’); ?>.<br><a href=”feed:<?php bloginfo(‘rss2_url’); ?>”>Entries (RSS)</a>
and <a href=”feed:<?php bloginfo(‘comments_rss2_url’); ?>”>Comments (RSS)</a>.<br>     <a href=”<?php bloginfo(‘url’) ?>/privacy-policy”>Privacy Policy</a> <a href=”<?php bloginfo(‘url’) ?>/contact-us”>Contact Us</a>
</p>

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • NewsVine
  • Reddit
  • StumbleUpon
  • YahooMyWeb
  • Google
  • Yahoo! Buzz
  • TwitThis
  • Live
  • LinkedIn
  • Pownce
  • MySpace

Leave a Reply