[Resolved] Putting page header below the title

Home Forums Support [Resolved] Putting page header below the title

Home Forums Support Putting page header below the title

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #286106
    dmendana

    When editing the layout in the customizer, for the page header, there are four options if it’s a single post: above content, inside content, below title and hide.

    However, there are only two options if it’s a page: above content and inside content.

    This makes it impossible to keep the same design for my posts (where I put the page header below the title) and my pages. Is there any way that I can move the title above the page header? Thanks!

    GeneratePress 1.3.44
    GP Premium 1.2.94
    #286115
    Leo
    Staff
    Customer Support

    Hi there,

    Would it work to add the page header as the first thing in your content? Then it should show up below content title?

    Let us know.

    #286118
    dmendana

    Sorry for not understanding, but how do I “add the page header as the first thing in my content”?

    #286120
    Leo
    Staff
    Customer Support

    like add the page header image using Add Media before the page content? Just a thought…

    #286123
    dmendana

    I want the header to be full width, so no. But thanks.

    #286235
    Tom
    Lead Developer
    Lead Developer

    If you add the page header below the title, it won’t go full width. It will only be as wide as your content.

    Do you currently have it set to inside content or above content?

    #343364
    argosmedia

    Sorry to hijack this topic, but I need exactly the same. Is there a way to use some css or function.php code to achieve this until the Customizer has this option?


    @Tom
    I have the page header inside the content.

    Kind regards,
    Jurgen

    Jurgen Nijhuis - Argos Media

    #343515
    Tom
    Lead Developer
    Lead Developer

    Should be able to use hooks to do that – where do you currently have it set? Inside content?

    #343591
    argosmedia

    Yep, see last line of my message ๐Ÿ™‚

    I managed to get the page title above the image by putting this in the Before Content hook:

    <?php if ( generate_show_title() ) : ?>
    	<header class="entry-header">
    		<?php the_title( '<h1 class="entry-title" itemprop="headline">', '</h1>' ); ?>
    	</header><!-- .entry-header -->
    <?php endif; ?>

    Now I need to disable the regular page title below the page header image…

    Jurgen Nijhuis - Argos Media

    #343739
    Tom
    Lead Developer
    Lead Developer

    Hmm yea, you could it that way.

    Disable the title like this:

    add_action( 'after_setup_theme', 'tu_disable_page_titles' );
    function tu_disable_page_titles() {
        if ( is_page() ) {
            add_filter( 'generate_show_title', '__return_false' );
        }
    }

    Then add this to your hook:

    <?php if ( is_page() ) { ?>
        <header class="entry-header">
            <?php the_title( '<h1 class="entry-title" itemprop="headline">', '</h1>' ); ?>
        </header><!-- .entry-header -->
    <?php } ?>
    #343913
    argosmedia

    Thanks, but that doesn’t seem to work. I put the add_action code in the functions.php of my child theme, that is the right place isn’t it?

    I am rebuilding a Joomla-site in GP, and almost done.
    Joomla: http://www.indeflow.nl/
    Wordpress: http://www.indeflow.nl/new/

    So you can see how it needs to be.

    Regards,
    Jurgen

    Jurgen Nijhuis - Argos Media

    #344048
    Tom
    Lead Developer
    Lead Developer

    Yea that’s the right place.

    Try this instead:

    add_action( 'wp', 'tu_disable_page_titles' );
    function tu_disable_page_titles() {
        if ( is_page() ) {
            add_filter( 'generate_show_title', '__return_false' );
        }
    }
    #344208
    argosmedia

    Yes, that did the trick! Thank you very much Tom, I really appreciate the support.

    Jurgen Nijhuis - Argos Media

    #344305
    Tom
    Lead Developer
    Lead Developer

    You’re very welcome ๐Ÿ™‚

Viewing 14 posts - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.