churchill614
Member
Posted 9 months ago #
I have a News page which I have linked to my recent blog entries. I want to display the News title at the top of the page before showing the latest news entries however when I use the_title() it displays the title of the blog entry. I have seen the forum entries regarding using $post->post_parent and this does not achieve the desired result. What do I need to do?
How have you "linked" the page? My suggestion is to make the change in the template itself until I can learn more about how you set this up.
churchill614
Member
Posted 9 months ago #
In Settings -> Reading, Front Page displays a static page.
Front Page = Home.
Posts Page = News.
$post->post_parent just returns the ID of that page. Maybe: echo get_the_title($post->post_parent);
If you're trying to get the title outside the loop, wp_title() might do what your looking for.
churchill614
Member
Posted 9 months ago #
That doesn't do the trick either. I'm at a loss, any more ideas?
churchill614
Member
Posted 9 months ago #
wp_title() does the trick. I hadn't moved it out of the loop! Thanks for your help.