Tagged: footer post selection
- This topic has 2 replies, 2 voices, and was last updated 2 years, 2 months ago by gadgsphere.
-
AuthorPosts
-
September 1, 2022 at 9:39 pm #101720gadgsphereParticipant
I have a “popular post” banner and “you may missed” banner on one page and when scrolling you can see both banners and the post are identical. I want to change post selection logic in “you may missed” so it does not show the last 4 posts like in “popular post” section
September 3, 2022 at 12:36 am #101740Theme Horse Support TeamKeymasterHi gadgsphere,
For that, you can create a new category and assign the desired posts to the same. After assigning the posts to the new category you can now choose the same category to show on the ‘You May Missed‘ featured section.
Please go to ‘Appearance > Customize > Footer Featured Posts’ then check ON ‘Show Posts from Category’ and choose that new category.
Thanks
September 3, 2022 at 1:18 am #101741gadgsphereParticipantHi,
I managed to do it editing php. If someone is trying also to manage this then you shoud go to theme files and footer.php.
In footer.php you will find section for footer posts. In code you can see comments that I added:
“Footer “You may missed” posts shows random posts from current week”<?php /** * The template for displaying the footer * * Contains the closing of the #content div and all content after. * * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials * * @package NewsCard */ ?> <?php global $newscard_settings; ?> </div><!-- row --> </div><!-- .container --> </div><!-- #content .site-content--> <footer id="colophon" class="site-footer" role="contentinfo"> <?php if ( $newscard_settings['newscard_footer_featured_posts_hide'] === 0 ) { $footer_newscard_cat = absint($newscard_settings['newscard_footer_featured_post_categories']); /** * Footer "You may missed" posts shows random posts from current week * added args are: 'orderby' => 'rand', 'year' => date( 'Y' ), 'week' => strftime( '%U' ) */ $footer_post_type = array( 'posts_per_page' => 4, 'post__not_in' => get_option('sticky_posts'), 'orderby' => 'rand', 'year' => date( 'Y' ), 'week' => strftime( '%U' ), 'post_type' => array( 'post' ), ); if ( $newscard_settings['newscard_footer_featured_latest_post'] == 'category' ) { $footer_post_type['category__in'] = $footer_newscard_cat; }
-
AuthorPosts
- You must be logged in to reply to this topic.