Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

Aurelian Spodarec
Aurelian Spodarec
10,801 Points

Footer in WP?

Hi,

YOu have a site, how do you make pages, or link to existing pages in footer? WIth WOrdPress.

SO you have Terms and Services n footer, how i supposed to do that page? ANd i have about apge which is at the main navigation, and it needs to be in footer, how do i go on about this?

1 Answer

Kevin Korte
Kevin Korte
28,149 Points

Lets say you had a page called "Terms and Services".

In your footer template you could write a custom function like so

//footer.php
<a href="<?php echo get_terms_and_services_url(); ?>">Terms and Services</a>

and in your functions.php, you would need to return the permalink, something like this should work, but it's 100% untested.

<?php
//functions.php

function get_terms_and_services_url() {
  $terms_and_service_page_obj = get_page_by_title( 'Terms and Services' );
  return get_permalink($terms_and_service_page_obj->ID);
}
Aurelian Spodarec
Aurelian Spodarec
10,801 Points

How would I edit that page? Where would this appear in WordPress?

Kevin Korte
Kevin Korte
28,149 Points

In the pages tab on your wordpress dashboard.

Aurelian Spodarec
Aurelian Spodarec
10,801 Points

kk I'll try this as soon as I start with the project. I was just thinking in advance, what is it that I don't know how to do, and so far, I think I should be ok, I hope.

Thanks :)