Flex block Filter – Popular – time range

Posted in: Newspaper
Post count: 16

Hello all!
Switched to Newspaper theme for my news website. I am facing now one issue, and I am not able to fix it. I have a section “Most popular” on my homepage. It is a Flex block, with sort filter “Popular”. For example in the last 24 hours.

Everything works fine, but it is a news website, and sometimes old news get spikes in traffic. This leads to the block including old posts in the most popular section.

In the previous version of the website (different theme and using the “most popular” widget) it was filtering in different way – it was selecting the most popular posts, published in the specific time range – the last 24 hours. In the case of newspaper, it is the most popular in the last 24 hours, published anytime on the website.

I am trying to find an option, to show the most readed, but also published in this period. If there is no solution, I will have to use a plugin for this, and it would be a shame, to have this amazing option built in the theme, but using extra plugin to tune it.

Thanks in advance

Post count: 27744

Hello,

This type of sort option can be done with custom work https://tagdiv.com/web-development-services/

Thank you!

Post count: 16

Oh, really? This logical and simple thing for a news website? That a lot of free plugins are offering? Is this a joke?

Isn’t newspaper a theme specialized for news publishers? Why on earth will a publisher want to put on his homepage an old news publication?

Post count: 35449

Hi arajioni, the popular option is referring to all posts you have on your website and based on the selected option ,let’s say popular last 24 hours, will display the most view posts in the last 24 hours from all your website posts, this is because most of the time there are old posts that are much more viewed than some newer posts.
If you want to use an option perhaps similar to the one specified above by you, please try the “Popular option (jetpack + stats module required) Does not work with other settings/pagination” – https://i.imgur.com/bky38Ma.pnghttps://forum.tagdiv.com/flex-block-settings-guide/ this will use the jetpack plugin for popular posts.
Thankyou for your understanding!

Post count: 16

Thanks Calin, but I know several solutions with third party plugins, and in this case – using jetpack only for this option doesn’t seem the optimal one.

Maybe this should be included as a built in filter option in Newspaper theme, as it is more logical for news publishers to display most popular in time range + published in that time range.

Is there an option to submit this to the theme creators?

Post count: 27744

Hi,

As I said, this kind of filter option can be done with custom work. My colleague offered you an alternative.

I appreciate your understanding!

Post count: 16

As I said in my first comment – I know alternative methods.
As I asked in my last reply – is there an option to suggest this to be included in future updates to the theme creators? The only question left, and not addressed in your wise last comment.

  • This reply was modified 2 years by arajioni.
Post count: 27744

Hi,

This is added to our list, but I don’t know if this will be added to the theme.

Thank you!

Post count: 16

If there are others with the same request, I think this code will do it (Add it to your child-theme functions.php)

/* ----------------------------------------------------------------------------
Enable date-based filtering for popular posts
*/
define('TD_POPULAR_BY_DATE_ENABLED', true);

add_filter('td_data_source_blocks_query', function($wp_query_args) {
if (isset($wp_query_args['sort'])) {
$wp_query_args['popular_by_date'] = true;
}
return $wp_query_args;
});

Now you should see a new option under the “Sort order” called “Popular by date” which you can enable or disable.

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