How to change ramdom post from last 7 days

Posted in: Newsmag
Post count: 54

Hi,
i know where is the code

case 'random_7_day':
//$wp_query_args['orderby'] = 'rand';
$wp_query_args['date_query'] = array(
'column' => 'post_date_gmt',
'after' => '1 week ago'
);
break;

i add //$wp_query_args because i dont want random , is working great

But i have one problem. I want to show only one post by category. I have one category where we add one post every two days, thus we see all the time 3 post in the list from this ctegory and i dont like that. Only one was better.

thanks

Post count: 6535

Hi

This cannot be done easily using wp-queries but instead you can use post limit filed from block’s settings and set it to 1: http://screencast.com/t/75BipsxW7
If this is not what you mean please provide more details about the desired result so I can get back to you with a more accurate answer, also provide your site url.
Thanks!

Post count: 54

i know this option and is working great. But that mean i must make a block for each category and i have 30 different category.

Post count: 6535

HI

For the moment this is the only option available, the block’s must be added manually which takes some times if you have many categories. We may have some additional options fro blocks in future theme’s updates which may optimize this process but I can’t promise anything for sure.

Thanks!

Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic.