Читать эту страницу на русском языке / Read this page in Russian.
This plugin filters posts by tags and/or categories. It allows to filter posts for the main page as well as for a particular page. You can set up a filter for any page but it’ll work only if you’ve placed the shortcode at that page. There is also the possibility to turn off the filter for a particular page not losing the page’s filter settings.
You can download this plugin here. Read more about this plugin below.
The plugin filters posts by three ways:
- Category,
- Tag,
- both Category and Tag.
Few notes about the plugin’s behavior
- the plugin outputs post if and only if the post has at least one category that is marked in plugin’s settings page,
- the plugin outputs post if and only if the post contains at least one tag that is marked in plugin’s settings page,
- the plugin outputs post “by category and tag” if and only if the post has the category and the tag that are marked in plugin’s settings page.
You can set the number of posts per page for a particular page. By default, “Posts per page” (Settings → Reading) option is used.
Shortcode
You need to place the shortcode to make the filter work at the particular page. With that shortcode you can also setup some options. Here is how it looks by default:
[wppf]
This way, the plugin filters posts using it’s default settings or settings defined in plugin’s settings page. Here is the full writing of the shortcode:
[wppf heading_tag=”h2” heading_class=”entry-title” content_tag=”div” content_class=”entry-content” per_page=”10”]
There is no necessity to write all the parameters in the shortcode.
Parameters definition:
heading_tag
— html tag for the post title.h2
by default,heading_class
— css style for the post title.entry-title
by default,content_tag
— html tag for the post excerpt.div
by default,content_class
— css style for the post excerpt.entry-content
by default,per_page
— number of items per page. Settings → Reading “Posts per page” or 10 by default.
Feel free to comment, suggest etc. You can also start a discussion topic about the plugin here. Feel free to use issue tracker if you find bugs or want new features to be implemented. If you want to translate this plugin to your language, you can take wp-posts-filter.pot
file (located in the root directory of the plugin) as the basis for translation. Contact me if you want your translation to be included into the plugin.
I have the same problem as Steve. My menu disappears if I turn on the plugin. If there is a solution I would be grateful for your help
Hi Mateusz, I haven’t got an answer from Steve regarding his problem anymore since I sent him Simon’s (Pagelines developer) message. Here it is:
Since that, I’m asking you to give me a list of plugins you’re using in your WP installation. You can send the list directly to my e-mail. I also need to know a version number of your WP installation.
Hi Oleg,
Thank you so much for your help! I’ve now got the date showing, thanks to your instructions!
However, I’m still not quite understanding the categories. Would I be able to email you or IM you on Skype (I’m rossautomatica on there) to try and get this set up? I would also like to donate something to you via Paypal as a thank you for your time.
Thanks, Ross
Hi Ross,
sure, email me and I’ll try to help you with that. My contact email is
Thank you! I’ve just sent you an email. We’re almost ready to launch the site, we just need to get this part finished!
Hi, I have been very happy with your plugin, but recently it has stopped working on our homepage. When I click on the “next page” link at the lower right of the home page, it doesn’t actually go to the next page of blog posts. Do you know why this might be happening? No Wordpress / system changes took place as far as I know. Thank you for yoyur time.
Hi, it’s the blog engine that does the pagination in case if you set up it to display recent posts on the homepage, not the static page. So, if there were no plugin/engine/php/dbms updates or db changes at all before the pagination’s been broken, I doubt I have an answer. If you set up your blog to display some static page as the homepage, and enable a filter to display some posts on that page, it’s the plugin that does the pagination. I’d expect some plugin settings have been broken in that case. Or, for both cases, it might be that the plugin code’s been changed by someone. If I were in your shoes, I’d try to disable the plugin and check if the blog started working as it should. Reinstalling the plugin would help in case the database or plugin scripts were changed. Before making any actions, I’d check if the system and the blog engine and it’s plugins (especially pagination ones) have been updated.
Please let me know the update on your question so I could be able to help you out
Thank you for the prompt response. Yes the plugin is doing the pagination (as the homepage is actually a static page I created, which lists posts based on category - and not the default Wordpress homepage). I don’t think the plugin is completely broken - because it works on another page in the site.
http://connection.sagepub.com (pagination doesn’t work here)
http://connection.sagepub.com/insight/ (pagination works here)
I updated Wordpress and two other plugins, but this did not fix the situation.
Any ideas? I am stumped.
I forgot to mention that I uninstalled the plugin and its files from the dashboard, then reinstalled and set up the plugin again… and I still have the same issue.
Hello, how can I show the featured image in a filtered post list? Currently I only get the heading and text.
Thanks!
Hello Markos, right now there is no such a feature. But I plan to add it to the next version.
This was working perfectly for me. Now, however, when I try to go to our blog page (http://www.commetrex.com/blog/; all the posts on this page are filtered by your plugin using the category “blog”), this is what I get:
Danger: Malware Ahead! Google Chrome has blocked access to this page on www.commetrex.com. Content from cilfl.org, a known malware distributor, has been inserted into this web page. Visiting this page now is very likely to infect your computer with malware. Malware is malicious software that causes things like identity theft, financial loss, and permanent file deletion.
Update: I’ve removed the filter shortcode from the page, but I still get the malware warning.
It means that the problem you have is not connected to the plugin functionality. Anyway, I checked the blog and the main page of your website and haven’t found any includes for my plugin (screenshot attached for the blog page). Also, I found that you had a js include before the doctype definition on your blog page (screenshot). It either the developer mistake or (most likely) the website is hacked. These includes can appear because of trojan on the computer having ftp/sftp passwords saved inside ftp/sftp-client application. Regarding the plugin, the only javascript it includes in the web pages is the toggle disable/enable functionality in the plugin settings page. If you’re not sure about it, you can observe the source code for the plugin
Sorry, here is the attached screenshot
Hi, i have a question regarding the plugin, here is my website page that filters posts with the plugin: http://www.arinternacional.com.ar/blog/eventos/
is there a way to have separators or divisions between the posts? like an horizontal line or maybe even some space between them.
Thank you so much!
Hi Lisandro,
If you’re using the latest version of the plugin, 0.3, this can easily be done by altering either the default template or creating the new one. Please refer to the README file for details on how to do that, as I still need to update plugin info page here on the blog :)
Regards, Oleg
Thank you Oleg! Figured it out with that hint.
You are welcome!
i have the same problem that steve, can you help me? thank
great job, the plugin is very simple but work very good!!! (except with the menu :( )
I’ve contacted with one of Pagelines developers, he tested my plugin with Pagelines and found that the menu works good on his installation. Anyway, I’ll try to find a solution to this problem to help you and Steve. Could you send me more info about your WP installation (you can either post it here or mail it to me)?
Hi,
Thanks for the plugin it is extremely helpful… Exactly what I was looking for!
I am trying to put some static text about the posts on some pages of my website, is it possible to do this?
Thanks
Hi Alyce, glad to know it was helpful. Currently, you can put any text on a page with [wppf] shortcode and it’ll be shown under the posts on that page. This is because of the WP Shortcode API (which was used for the shortcode). I’m trying to find a workaround for this feature now, and if I do, it’ll be included in the next version of the plugin.
Hi again Alyce, I’ve updated WP Posts Filter. With version 0.2 you can put selected posts anywhere on the page. SInce it has changed own behavior, you probably need to place shortcodes in new places on your pages.
I do not know all options available to use in your plugin. I want to display certain Category Posts on a page. I am trying the following code but it is not working:
[wppf heading_tag=”h2” heading_class=”entry-title” content_tag=”div” content_class=”category” category_class=”23” per_page=”10”]
Brett You need to set up the filter for your page in the plugin’s settings page (Settings->WP Posts Filter). All filters are turned off by default.
Hello, I am alittle confused as to where I should place the shortcode. I turned on the filters through the setting but I am not sure what else I should do to get the plugin to work
Thank You
Hello Erika, say, you have a page named “sample page”. To make a filter work, you should set up and turn it on for that page (“sample page”) in the plugin settings page. After that, you need to edit “sample page” and place a shortcode wherever you want in that page. Then save the page. You can now go to your “sample page” and see what filter displays.
Hi Oleg,
Still loving the plugin, but I have another question! Sorry!
At the moment, I’m only able to display excerpts on each page. I want to set it up so that I can show the full post on the NEWS page, but still just the excerpts on the other pages I’m using the plugin.
Is there a way to do this, or do you know of a plugin I can use in conjunction with yours to make this happen? I know I could edit the plugin source to display the_content on all pages, but is there a way to do it just for one category?
Would really appreciate it if you could let me know how to work around this!
Thank you, Ross
Hi Ross,
No worries, ask and I’ll try to help ;) For your question, I’d use categories functionality: add the News category for all posts that are representing news and use the URL for the category as a starting point for users (like this http://olezhek.net/category/linux ). WP will then use it’s template functionality ( http://codex.wordpress.org/Category_Templates ). You will probably need to customize a template file for this, e.g. category-news.php for News category or category.php for all categories you have.
Oleg
I installed v 0.2 of the plug-in and it works very well indeed. Now it does exactly what I want, placing static text on the page exactly where I want it and how I style it, with the filtered posts following.
Very good work. Congratulations and thank you!
Matt Thanks a lot!
Hi Oleg,
Love this plugin - it’s saved me on a couple of projects where I couldn’t get the categories to show on separate pages for various reasons.
Just got one question - is there a way to show the post date? I’d really like to be able to show the date of a post for a specific category…
Hope you can help!
Thanks, Ross
Hi Ross,
glad you find the plugin helpful! Currently, there is no such a feature in the plugin. The only thing you can do here is change the code of the plugin so that it could be able to display dates. I’ve added your question as a feature request, so I suppose I’ll implement this feature.
Thanks, Oleg.
Hi Oleg,
Thanks for your response!
No rush - it would just be a nice feature to add! :)
Could you tell me where I could add it in the plugin code so I could add it myself?
Thanks, Ross
Hi Ross,
sorry for late answer, wasn’t able to reply. You can modify the wp-posts-filter.php, method called wppf_shortcode() . This method is resposible for displaying the list of posts on any page but the home one. Find the foreach() loop (lines 378 - 388). This is the place where html-code is generated and filled with posts. Here you can add your html-code and fill it with anything you need. I’d use get_the_date() for date. If you need to do the trick with the home page, you’ll need to modify it’s template file located in your theme directory.
Cheers, Oleg
I have everything working well, except when I go to the page it have the posts in a box with the scrolling bars? How do I fix this?
Thanks! ~Jenny
Hi, you’ve probably setup your style-sheet to enable scrollbar for an element containing the plugin output.
I’ve tried to find where I can change this, but I’m not having any luck. I made the page and put the code exactly as you state to do so. So on there it says nothing about a scrollbar. I looked in my style-sheet and I’m not sure where I would need to change the code to fix this?
Hi Oleg
I have issue with the setting page of this plugin. The toggle in page setting is not working. I have tried to deactivate all plug-in but it does not work. I use both chrome and firefox broswer
WordPress 3.5 Plugin version 2.0 List of plugins:
Akskimet Hello Dolly Page-list WooTumblog WP Posts Filters
Link blog.washingtonpacificgroup.com
Thanks
Hi Phi Dang,
thanks for your report, let me check it tonight as I’m in the office right now.
Oleg
Sorry Oleg - another query. I’ve tried to include the date like you mentioned above.. and I’ve used the following code, but nothing shows up:
Do you think you’d be able to help me via email on this one? My client would now like the date to show up on the posts and I can’t get it to show!
Thanks, Ross
Here is what is in the plugin (wp-posts-filter.php:378-388):
What we need is to add the date. We’ll use get_the_date() for this. Let’s suppose we need to add the post date in the beginning of the post title, so it’ll become looking like “2012-12-31: New year’s eve!”. To get this working, you need to add get_the_date() call so that the code I posted above will be looking like this:
(find the line inside the -tag). Replace the code from 378-388 with the resulting code from this comment and try. You’ll probably need to clean up the copy-paste as sometimes it copies the incorrect symbols for quotes for example.
Im developing a site, and the plug-in very much serves a need. However, when the post is picked up, the plug-in seems to strip out all of the HTML formatting from the post [h3, p, strong, em, linebreaks, etc ] whtn the post is displayed on the page.
Compare: http://www.peopletopeopleinc.org/wordpress/index.php/events/ http://www.peopletopeopleinc.org/wordpress/index.php/blog/
Any thoughts?
I’ll need to have this working before I hand over the “keys” to the client to make their own posts & edits. Using WP 3.4.2 with a customized PicoLight theme.
Hi Kurt,
seems like you have your [cci]ul[/cci]-tag wrapped with the [cci]code[/cci]-tag. That’s why you have all formatting stripped out. Since my plug-in doesn’t generate any html-code containing the [cci]code[/cci]-tag by himself, I would suggest you to check your plug-in settings and the page template. For plug-in settings, it could be the tags and styles settings, either global or the page ones.
Hi Oleg, I’m trying to use your plugin for the first time and am having the problem where it causes my primary navigation to disappear from only the Home page. It is present on the other pages. The Home page is all most recent posts. The navigation does not contain any categories - it is all links to other pages outside the WordPress posts & pages.
I can’t figure out how to get the navigation back into the page. I’ve deactivated all other plug-ins but that doesn’t not help. If I comment this line, it gives back the navigation but of course it does not filter the category any longer: $filter_by = isset( $wppf_opts[‘frontpage’][‘filterby’] ) ? $wppf_opts[‘frontpage’][‘filterby’] : ‘none’;
thank you for any help you may be able to give. If I get this working, your plug in is by far the best I have found for filtering categories. Very good plug-in.
Hi Sheela,
I think it might be related to the theme you’re using. What happens when WP is about to get posts is that WP Posts Filter applies the condition set up in the plugin admin page to that generic WP query. After that, WP executes the query, gets the data from the db, formats things and so on… So here, I think, might be the case when the theme you’re using (or a menu plugin) does the same as my plugin does. Thus, the query gets broken and you get nothing. The quick fix for that could be to setup WP to display some static page not the recent posts. Then, you need to go to my plugin settings page and setup a filter for the page you defined as a main page of your blog. After that, you need to edit the page by putting a shortcode into it. Then Save and try it.
If you’d like fix that anyway, then I’d ask you what theme and what plugins you’re using. If there’s an incomaptibility and I can fix it in my plugin, then it’s better me to do that. Otherwise, a plugin/theme developer’s participation is needed.
Please let me know the update on your question.
Regards, Oleg
Hi Oleg, thank you very much for your answer. I tried 2 additional themes and the navigation disappears on both of them. If I deactivate the wp-posts filter plug-in, they are again visible. One thing about my navigation all the items are links that are outside of the blog, so are not actually linked to any of the blog posts. I have deactivated all other plugins, so yours is the only one active. I tried different themes, one is named Houston by Woothemes. It gives the option to use links for the primary menu. Thank you for any help you can give.
Priviet, Whenever I turn on the Plugin, it makes the Navigation from my brandnav disapear. If you have any Ideas on how to fix this, please write me, since ur plug-in is EXACTLY what I need. Spaciba, baka, Istvan
PS: Please dont reply in Russian, cause I can’t really speak it.
Hello Istvan, please check your inbox (wrote you a mail to the address you’ve pointed while posting this comment).
Hi, I checked the install aigain. The problem is within the Pagelines Framework. I’m using Pagelines Framework, which adds a new type of menu you can use (brandnav). If I use the standard (Branding + Navigation) your plugin works correctly. But when I use the brandnav (navigation) it just doesn`t display it on the Blogpage. So the problem is with Pagelines, not being compatible with your plugin. So, I can work around it, not using the brandnav and instead styling (css) the branding and navigation to make it look the same (like brandnav). But if you want to give your Plugin more compatibility, then here is the html which differs when using brandnav instead of branding and navigation: http://pastebin.com/jEb8rJG1 It would be awesome if u supported this aswell.
I’m using no plugins, for now, so there is no point in a scr. I’m using the 3.3.1 version (latest) with the new type of menu. Hope I could help u help me and in making the plugin even greater then it already is. Thanx, Istvan