- This topic has 13 replies, 4 voices, and was last updated 6 years, 9 months ago by Tom.
-
AuthorPosts
-
March 2, 2017 at 6:50 am #286106dmendana
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!
March 2, 2017 at 6:59 am #286115LeoStaffCustomer SupportHi 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.
March 2, 2017 at 7:03 am #286118dmendanaSorry for not understanding, but how do I “add the page header as the first thing in my content”?
March 2, 2017 at 7:07 am #286120LeoStaffCustomer Supportlike add the page header image using Add Media before the page content? Just a thought…
March 2, 2017 at 7:11 am #286123dmendanaI want the header to be full width, so no. But thanks.
March 2, 2017 at 11:03 am #286235TomLead DeveloperLead DeveloperIf 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?
July 3, 2017 at 5:52 am #343364argosmediaSorry 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,
JurgenJuly 3, 2017 at 10:37 am #343515TomLead DeveloperLead DeveloperShould be able to use hooks to do that – where do you currently have it set? Inside content?
July 3, 2017 at 12:49 pm #343591argosmediaYep, 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…
July 3, 2017 at 7:51 pm #343739TomLead DeveloperLead DeveloperHmm 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 } ?>
July 4, 2017 at 4:15 am #343913argosmediaThanks, 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,
JurgenJuly 4, 2017 at 9:08 am #344048TomLead DeveloperLead DeveloperYea 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' ); } }
July 4, 2017 at 1:23 pm #344208argosmediaYes, that did the trick! Thank you very much Tom, I really appreciate the support.
July 4, 2017 at 7:53 pm #344305TomLead DeveloperLead DeveloperYou’re very welcome ๐
-
AuthorPosts
- You must be logged in to reply to this topic.