Display page title of the news page, not the first posts title
-
Hey,
I have the problem that, on my news (blog) page, where all the posts are displayed, it should display the page title on top, not the first posts title.
Currently it is like this:
The posts page is called “Blog”, but inside my h1 it always displays the first posts title.Code:
<?php $sub_title=get_post_meta($post->ID,'subtitle',true); if($sub_title != '') { echo '<h1><span>'. get_the_title() .'</span>'. $sub_title .'</h1>'; }else { echo '<h1 style="background: none;"><span>'. get_the_title() .'</span></h1>'; }
(I’m using a function to create a header with a subtitle.)
I tried this, which does not work inside my function correctly. It does only work when i’s inside the ‘else’.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Display page title of the news page, not the first posts title’ is closed to new replies.