Filter pages in top-post widget using CSS
-
Hello,
is it possible to filter, just with css, the pages to be shown in the top-posts widget?
I mean: i would want only posts, not pages, in the top-posts widget.
Thanks a lot in advance.
The blog I need help with is: (visible only to logged in users)
-
You might be better off using the display posts shortcode in a text widget. You can set it to order by comment count according to this support page, give it a try and see.
-
is it possible to filter, just with css, the pages to be shown in the top-posts widget?
CSS can change the appearance of things that are already on the page, but it cannot filter content like you described.
hallluke’s suggestion to try the display posts shortcode might be the best alternative though!
-
Thanks @hallluke and @designsimply Just one comment: but I´m actually filtering -hide- posts, using CSS, of just one category in my home page:
.home article.category-sumarios {
display: none;
}Anyway, thanks both of you!
-
You have that option with posts because the tags and categories are assigned as classes. The top posts widget doesn’t include that sort of information so you can’t target just posts or just pages individually with CSS. You should be able to set up something very similar using the shortcode though, it will let you pull in the featured images as well as take care of the filtering.
-
Thanks @halluke. Very usefull the info you gave me in your last comment…one last question please: Is it possible to insert wp shortcodes in text widget? in your first comment here, i think, you do not recommend it…
Thanks again
-
Yes you can (and I definitely recommend it in this case!). The text widget behaves like the text editor when creating a post or page so HTML and/or shortcodes are both fine.
-
- The topic ‘Filter pages in top-post widget using CSS’ is closed to new replies.