-
AuthorPosts
-
August 5, 2017 at 3:36 am #834562
Hi folks!
for a post I have many awesome sylings for the title (h1 modern, business…),
but for a page there is not really a post title, but only that small text-line in the small container strip on the left side of the breadcrumbs?How can I get a real title on a page looking the same like the title on a post?
Thanks for your help,
StephanAugust 5, 2017 at 8:33 am #834638Hey Stephan,
Would you mind providing a precise link to your site, showing the elements in question? We need to be able to inspect them in order to help :)
Best regards,
SarahAugust 5, 2017 at 12:41 pm #834754Hey Sarah,
we don’t need a special link – it’s everywhere in Enfold:
In a ‘post_type’=>’page’ the title (I mean the real post $title) is only displayed as a small text-line in the small container strip on the left side of the breadcrumbs – above and not in the main content container (as is should be standard) as the first element.
See for example that page: http://kriesi.at/themes/enfold/shortcodes/tabs/
“Tabs” is the post $title, but its not really a headline and not under the breadcrumb.So the question is: How can I get the title entry of a page type as usual like real title (normally with h1) in the content area above the content entry? Usually as it is displayed on simple standard post types as a headline above the content text? (for example on the http://kriesi.at/themes/enfold/2012/01/14/this-is-a-nice-post/, where the $title “This is a standard post format with preview Picture” comes directly above the content)
And without using ALB adding the same title twice as an additional title/headline?Big thanks in advance & best regards
StephanAugust 5, 2017 at 5:50 pm #834837Hi,
Try adding this code to the end of your functions.php file in Appearance > Editor:add_action('ava_after_main_title', 'ava_after_main_container_mod'); function ava_after_main_container_mod() { if ( is_page()) { echo "<div class'custom-title container_wrap'><div class='container'><h1>".get_the_title()."</h1></div></div>"; } }
It will add a title to pages only.
Use the “Title Bar Settings” when editing pages to hide the Title and Breadcrumb Navigation if you wish.
Best regards,
MikeAugust 9, 2017 at 2:13 pm #836408Hi Mike,
thanks a lot, that works fine.
Inbetween, to get more flexible preserving both variants, I had another idea:
I built another page template by copying and renaming page.php and includes/loop-page.php to /enfold-child.
I put the_title in the enfold-child/includes/loop-page.php directly after echo ‘</header>’; (line 23).The complete code from line 23 for all the others, who want the same solution:
echo '</header>'; //display the actual post content the_title( '<h1 class="post-title entry-title">', '</h1>' );
That’s all, I think ;-)
Best regards,
Stephan- This reply was modified 7 years, 4 months ago by Yeti.
August 9, 2017 at 7:12 pm #836558Hi Stephan! Thank you for sharing your solution! We’re glad that Mike was able to help you.
We’ll close this topic now. For any other questions or issues, feel free to post them here on the forum and we will do our best to assist you.
Cheers!
Sarah -
AuthorPosts
- The topic ‘No post-title / headline for pages?’ is closed to new replies.