Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements to the popular posts widget #330

Closed
philipt18 opened this issue Mar 10, 2014 · 6 comments
Closed

Improvements to the popular posts widget #330

philipt18 opened this issue Mar 10, 2014 · 6 comments
Labels
[Closed] Duplicate Duplicate of an existing issue. [Feature] Extra Sidebar Widgets [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it

Comments

@philipt18
Copy link

There are three things that would make that popular posts widget better (IMHO):

  1. Being able to select Posts, Pages or Both

  2. Being able to select one or more categories as a filter (as include or exclude)

  3. Being able to define the time period. Right now I think it's a rolling popularity over 24-48 hours? That seems odd to me as only very high traffic sites with many posts per day would benefit from that. For most sites, they'd want to be able to set it to a month, or a year, or from the beginning of the site.

@jeherve
Copy link
Member

jeherve commented Mar 10, 2014

Being able to select Posts, Pages or Both

That's something we've been working on #54. Feel free to subscribe to that issue to follow our progress on this.

Being able to select one or more categories as a filter (as include or exclude)

We created the jetpack_widget_get_top_posts filter in 9f45741, that will allow you to do just that. It's not part of Jetpack yet, but it will be included in the next release.

Being able to define the time period.

You can use the jetpack_top_posts_days filter to change the timeframe (ref). It was added to Jetpack in 2.8.

I hope this helps.

@philipt18
Copy link
Author

Concerning #54, that's a closed issue, so would subscribing to it actually get updates?

Concerning the filters, are those available in the widget? If not, then I don't see why this should be closed. I'm suggesting those be added to the widget.

@georgestephanis
Copy link
Member

#54 is actually open. The closed you're seeing, I believe refers to this issue (#330) being closed in the linkback.

@jeherve
Copy link
Member

jeherve commented Mar 10, 2014

are those available in the widget?

These filters are indeed available with the Top Posts widget. For example, if you wanted to change the timeframe used by the Top Posts widget to 30 days, you could use the following code in a functionality pluginto hook into the jetpack_top_posts_days filter:

function jeherve_top_posts_timeframe() {
    return '30';
}
add_filter( 'jetpack_top_posts_days', 'jeherve_top_posts_timeframe' );

@philipt18
Copy link
Author

So to get this functionality with the Top posts widget, I need to install another plugin and addd custom php code? I'm not saying I can't do that, but my request was to add this functionality into the widget directly. That's the feature request - to add it to the widget directly.

@jeherve
Copy link
Member

jeherve commented Mar 12, 2014

So to get this functionality with the Top posts widget, I need to install another plugin and addd custom php code?

That's correct. We've chosen not to add these options to the widget itself, not to overload the widget settings with too many options. Jetpack includes many filters (306 at the moment) to allow you to customize the default behaviour of the plugin without having to edit the core plugin files.

We are, however, considering adding a Post Type option, as per #54.

I hope this clarifies things a bit.

blobaugh added a commit that referenced this issue Mar 25, 2014
The main blog in a multisite install is typically ID 1. This can be altered by
altering the database directly. This commit dynamically pulls the proper main
blog id.

Resolved #330
@blobaugh blobaugh reopened this Mar 25, 2014
@jeherve jeherve closed this as completed Mar 25, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Closed] Duplicate Duplicate of an existing issue. [Feature] Extra Sidebar Widgets [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it
Projects
None yet
Development

No branches or pull requests

4 participants