Archived topic
Featured Image and post title disappeared using sections
5 replies · Started by Karl on April 25, 2017
I'm trying to use sections and noticed that my featured image and heading disappeared. Not sure whats going on.
The post started as a normal default post. Later I copied the content and pasted it in different sections. When editing the post it does say "currently using your featured image" so that sounds right to me :-) Cant figure it out.
Any ideas? Thanks.
Using Sections removes everything else from your page - this is to give you a consistent look throughout the sections of your page.
You can still use the Page Header add-on, but those other elements will disappear in order to give you more exact control over the look of each section.
Thanks for replying!
I created another section and added the image that I used as featured image. Now it is showing at the top like normal. But what can I do to show the post title under the image like I had before using sections?
I wanted to use sections so that my content could have different widths. The layout I want is:
Main post image: max-width:1087px;
Title: max-width:900px;
Introduction: max-width:900px;
Rest of content: max-width:660px;
I use the custom class to achieve this and add my css in simple css on the post. Is that a good way of doing it? Can I also save that setup as a template?
Only thing missing now is getting back my post title :-)
Thanks for all the awesome help btw!
I suppose you could do something like this..
add_action( 'generate_before_main_content','tu_sections_title' );
function tu_sections_title() {
$use_sections = get_post_meta( get_the_ID(), '_generate_use_sections', TRUE);
if ( isset( $use_sections['use_sections'] ) && 'true' == $use_sections['use_sections'] ) {
the_title( '<h1 class="entry-title" itemprop="headline">', '</h1>' );
}
}
Thanks man! I'll give it a try. But I might be overthinking this. I could just add classes directly in the text editor and set the width :-)
That would definitely be the easier solution - you'd have more control over the style as well :)