September 3, 2022 at 1:18 am
#101741
gadgsphere
Participant
Hi,
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;
}