CSS mod to display only posts with the Top Posts & Pages widget?
-
Hello fellow WordPress.com users,
I know my issue involves a widget, but I think this is mostly a CSS question, which is why I posted here.
I would like to utilize the Top Posts & Pages widget but have it only display posts (not pages). I have customized CSS on my blog and was wondering if there was a way to use the CSS to modify the widget to hide pages. Or, is there any other way to have posts only display with the Top Posts & Pages widget?
On the Jetpack site (link below), it gives the option to only have posts display. But, this functionality was apparently lost when the widget was incorporated into WordPress.com.
https://jetpack.com/support/extra-sidebar-widgets/top-posts-pages-widget/I would not be surprised if the functionality is still in the widget, I just wonder if there is a way to turn it on. On line 66 of the Top Posts & Pages widget php code (link below), it lists ‘types’ and has the options of ‘post’ and/or ‘page’.
https://github.com/Automattic/jetpack/blob/3.8.2/modules/widgets/top-posts.phpI know nearly nothing about CSS and have not been able to get the desired results my tinkering. I can manipulate how the widget is physically displayed through .widget_top-posts (then a command), but I have not had any luck altering the actual content of the widget.
I am currently not using the widget on my blog because I rather have nothing display than have the pages display. But, I’m happy to activate the widget for experimentation purposes. I hope that someone much more knowledgeable about CSS and the like can comment and share their thoughts and opinions.
Thank you for your time,
Bill
The blog I need help with is: (visible only to logged in users)
-
Hi there, the Jetpack software was developed here and was used for quite some time before it was made available for self-hosted WordPress sites.
Since there aren’t any identifying CSS classes or ids to differentiate between pages and posts in the widget html, there is no way for us to exclude pages.
This would require changes to the actual Jetpack plugin code used here, and that is something that cannot be edited by users.
I will pass your suggestion on to our Jetpack team for consideration as a requested enhancement to the WordPress.com version.
-
Hello thesacredpath,
Thank you for your response and for sending in the suggestion.
Regards,
Bill
-
You are welcome. I think this would be a good enhancement to the Top Posts and Pages Widget.
- The topic ‘CSS mod to display only posts with the Top Posts & Pages widget?’ is closed to new replies.