Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #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,
    Stephan

    #834638

    Hey 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,
    Sarah

    #834754

    Hey 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
    Stephan

    #834837

    Hi,
    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.
    2017-08-05_114436
    Best regards,
    Mike

    #836408

    Hi 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, 3 months ago by Yeti.
    #836558

    Hi 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

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘No post-title / headline for pages?’ is closed to new replies.