- This topic has 7 replies, 4 voices, and was last updated 4 years, 4 months ago by
Tom.
-
AuthorPosts
-
November 6, 2021 at 8:42 am #1993986
Alan Gautham
Hi Guys…
It’s a blog site: https://www.geekextreme.com/
Blog and Post Archive template designed using Block element.
There are 2 block elements. One for the featured post and another for the rest of the posts on the page.
All is good on the front page. But once v are moving to page2 using pagination. The featured post is not carrying over there.
For example, chk this one: https://www.geekextreme.com/page/2/
B’cos of ad units attached to the top and bottom of a featured post, I would like to have a featured post for every blog page i.e. page1,page2 etc.
Kindly assist. Thank You.
November 6, 2021 at 9:22 am #1994030David
StaffCustomer SupportHi there,
might be easiest to treat it with some CSS:
.paged .generate-columns-container article:first-child { width: 100%; }November 6, 2021 at 9:37 am #1994042Alan Gautham
Hi David…
Thanks for your quick response as always.
I would have used that CSS if ad units are not there in the block element for the featured post.
Two ad units are attached to the top and bottom of a featured post block unit.
Please chk this Screenshot: https://ibb.co/37DFHsb
Kindly advise for this situation.
November 6, 2021 at 11:38 am #1994147Ying
StaffCustomer SupportHave you tried the CSS yet? I don’t see a conflict between the CSS and the ads block.
Let me know 🙂
November 6, 2021 at 10:04 pm #1994423Alan Gautham
The CSS will make the first post take full width but it WON’T bring the ad blocks to page2/page3 etc which is in block element…
I am using ad shortcodes in the block element which is applied to featured posts.
To explain to you better… I am adding that CSS now…pls take a look at these 2 pages…
https://www.geekextreme.com/page/2/
Thank you.
November 7, 2021 at 5:22 pm #1995239Tom
Lead DeveloperLead DeveloperHi there,
We can tell the template to display on paged pages like this:
add_filter( 'generate_should_render_content_template', function( $display, $post_id ) { $loop_item_display = get_post_meta( $post_id, '_generate_post_loop_item_display', true ); if ( 'is-first-post' === $loop_item_display ) { global $wp_query; if ( 0 === $wp_query->current_post && is_paged() ) { $display = true; } } return $display; }, 10, 2 );Hope this helps!
November 8, 2021 at 12:57 am #1995470Alan Gautham
Hi Tom,
Awesome man. The snippet worked as expected. Thanks a lot for this outstanding support 🙂
November 8, 2021 at 8:19 pm #1996644Tom
Lead DeveloperLead DeveloperGlad I could help! 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.