list of posts by category plugin for wordpress
List of Posts from each Category plugin for WordPress
Notice: This plugin is only working properly in WP up to 3.0
This plugin displays a list of the posts from each category of your WordPress installation. It can be added to a post or page, or used directly in a template file. In the plugin’s options page you can choose the header. Is very useful if your posts are under one unique category.
Download
* postsbycategory.txt up to WordPress 2.0
* postsbycategory.txt for WordPress 2.3 (new)
Installing
* Download one of the above files, rename it to postsbycategory.php (from .txt to .php), and upload it to your plugins directory /wp-content/plugins/
* Enable the plugin.
* Configure the plugin options (under postbycategory).
Using
There are two ways you can use this plugin.
1) In a post or page, insert the following line:
<!-- postsbycategory -->
2) In a template file, insert the following code:
<?php echo posts_by_category(); ?>
Change Log
* 09-07-07 - v1.0 First release.
* 27-07-07 - v2.0 Second release. (Problem with Polyglot fixed)
* 09-11-07 - v3.0 Third release. (Plugin for WordPress 2.3)
Options
Here are the options available in this plugin?s options page in the WordPress admin panel.
Header text: This is shown above the list of posts.












July 12th, 2007 at 8:21 pm
[...] I have developed my first wordpress plugin: list of posts by category plugin for wordpress (I need it for a new website I’m [...]
July 26th, 2007 at 3:34 pm
Hi, thanks for the plugin, works great. There?s only one problem: i?m using Language Switcher witch is based on Polyglot, and the texts that are sorrounded by the language tags are not parsed. they look like the plugin were deactivated. How can I make it work? any ideas?
Thanks!
July 26th, 2007 at 3:51 pm
Hi Marcelo. Are you able to put it alive somewhere and I can take a look. I don’t understand your problem at all! thanks
July 26th, 2007 at 4:15 pm
Hi, I?m afraid it?s not public yet. But I?ll try to explain better.
This is how it looks:
*How-to?s
Como postear en los 3 idiomasHow to post in different languages
It should look like:
*How-to?s
How to post in different languages
Polyglot uses this tags
some textAlg?n texto
And this is what?s not working.
I apologize if my english is not very good.
Thanks for your quick response!
July 26th, 2007 at 4:46 pm
Mm… I don’t know… sorry!
All I do is print out the post_title!, do you know if Polyglot (I have never worked with) repeat it for each language?
ah! I am spanish, my english is worst than yours
July 26th, 2007 at 4:57 pm
Ahh entonces va a ser mas f?cil esto :). Soy de Argentina, Buenos Aires. La verdad no tengo ni idea por que Language Switcher me traduce las otras secciones de mi wordpress, y esta que esta armada con tu plugin no. Tambi?n habia probado el plugin Latest From Each Category de dagondesign.com y me paso lo mismo. Si me escribis un email te puedo pasar un usuario y contrase?a para que veas como esta quedando el blog. Esto es lo ultimo que me falta para terminar de armarlo, y aunque al principio va a salir solo en espa?ol, quiero dejarlo bien para cuando se agreguen los otros idiomas.
Abrazo
July 27th, 2007 at 4:47 pm
Please Marcelo test it now, now it should work with Polyglot!
July 27th, 2007 at 5:06 pm
Thanks Fruco!!!! It worked perfectly! Now texts change when I switch the language.
Lots of hours saved!
The best category plugin by far…
July 27th, 2007 at 5:59 pm
Just one tip for internationalized category creation
for translated names should use:
[lang_en]News[/lang_en][lang_es]Noticias[/lang_es]instead of
<lang_en>News</lang_en><lang_es>Noticias</lang_es>otherwise it won?t work for category names.
July 28th, 2007 at 8:17 am
Thanks for the plugin. Just wondering - Is there an easy way to include category description and the date of the post? I tried playing around with it to get these included, but my PHP skills are beyond poor.
July 30th, 2007 at 10:46 am
Should be easy, if you couldn’t do it yet, let me know and I’ll help you!
Regards
August 31st, 2007 at 2:31 pm
hello
I’m interested in your plugin.
but i am a beginner … I am ok with the first steps : I have downloaded it and activated it in the “plugins” thumbnail in my admin interface.
But it doesn’t show anywhere, as if i had done nothing.
Would you take some time to help me with that ?
thanks a lot
September 4th, 2007 at 2:48 pm
Would it be possible to make the plugin arrange posts by subcategories? I have topics in some subcategories which are quite specific for that particular subcategory. For example, posts in “photography -> digital” are quite different from the ones in “photography -> film”. It would be nice if we could have an option to list posts only in the exact category where it was published. Unfortunaetly I don’t have the skills to do it myself
September 4th, 2007 at 3:30 pm
Hi Astrobobo!
I am busy right now, but I will try to sort it out for you as soon as I am free!
Thanks
September 5th, 2007 at 11:40 pm
Thanks, you are very kind!
September 6th, 2007 at 3:19 am
Hi, I very much appreciate the plugin you created. I have one question though. My Wordpress is setup currently with multiple PAGES. Now I’ve been trying to find a way to put Posts on those pages, but you cant as that is a limitation with WordPress. However, is there a way to use a script/plugin similar to this one that can list posts from specific categories on specific pages? Let me know. Thanks
September 6th, 2007 at 4:08 pm
Hi Neil! There is always at least one way to build a pluggin that do whatever you need… but unfortunately I am very busy to build everything people is asking me… anyway, you can edit my pluggin and spcify from which category do you want to show the posts, and then copy-paste the pluggin as many categories you have… Thanks!
September 11th, 2007 at 2:32 pm
[...] Visit [...]
September 20th, 2007 at 9:42 pm
Hi Neil,
Great plugin, one question, how can I get the plugin to only show the posts of one category?
thanks
Robert
September 20th, 2007 at 10:30 pm
Hi, Thanks!
You can edit it easily. Change the “Select post_id FROM $wpdb->post2cat WHERE category_id =$posts->cat_ID” for the next one: “Select post_id FROM $wpdb->post2cat WHERE category_id=X” where X is the ID of the category you want to show.
Let me know if you have any problem.
September 21st, 2007 at 11:02 am
Hi Neil,
Thanks for that, if I do that I can only use this script to show posts from one category.
This is what I would like to do, when in one category, show all posts in that category in the sidebar, then when in another category show posts in the sidebar only belonging to the category that the visitor is in.
In other words, how can I make this dynamic, so it reads the catid from the page it is on and feeds that into the script.
Thanks for your reply, if this can be fixed, man I will buy you your beer for sure!
thanks
Robert
September 21st, 2007 at 11:30 am
True, hehe!
Should exists a function to get the category from the page is on… try this function “get_category_by_path()” from the category.php
if not, you can do a simple thing, on your uri structure, choose to show the category, then split the url and having the name you can know the ID easily with “get_cat_ID”…
Sorry I don’t do it but I am very busy with other stuff!
I hope it helps!
Frucomerci
September 21st, 2007 at 1:32 pm
Thanks for the reply, but that goes beyond my skills, I only know what I would like, too bad, will see if I can find it elsewhere.
All the best,
Robert
September 21st, 2007 at 2:15 pm
I don’t think this plays nice with wordpress 2.3 - seemed to create a lot of errors and eventually made some posts lose their categories even without calling the plugin. I could only fix it by disabling the plugin even though I had no page using it.
September 21st, 2007 at 2:48 pm
I don’t know, I have tested only with wordpress up to 2.2….
Sorry, I will try to sort it out as soon as I can!
September 23rd, 2007 at 8:16 pm
Thanks..
[?] A?ıklamalı 232 Wordpress eklentisi (Agu. 15, 2007 !!) (Wordpress plugin list),[?]
September 25th, 2007 at 11:13 pm
yeah
it’s broken with 2.3
September 26th, 2007 at 1:24 pm
The plugin not work with Wordpress 2.3
Bye, Paolol
September 28th, 2007 at 8:40 am
There’s a new way of doing sql queries using $wpdb->prepare() in 2.3.
Thanks for the plugin.
September 29th, 2007 at 3:00 pm
Please, is there anyone who tells me exactly where i must make the changes?
(or send me by mail the modified file!!)
My email: logatto [AT] jumpy.it
Thank you, Paolo.
October 1st, 2007 at 2:00 am
i don’t really understand the fix — has there been any update to the plugin yet? my site’s on hold until i can get hold of this useful plugin. thanks!
October 1st, 2007 at 10:27 am
The fix posted on a comment was not for this plugin…. I am very busy next two weeks but I will update the plugin as soon as I have sort this problem with WP 2.3. out… anyway, if someone has fixed and is so kind as to send send me the updated plugin I will appreciate it so much.
October 10th, 2007 at 10:59 am
Has some ERROR:
[Table 'www_db.wp_post2cat' doesn't exist]
SELECT post_date, ID, post_title, cat_name, cat_ID FROM wp_posts, wp_post2cat, wp_categories WHERE wp_posts.ID = wp_post2cat.post_id AND wp_categories.cat_ID = wp_post2cat.category_id AND post_status = ‘publish’ AND post_type != ‘page’ AND post_date
October 17th, 2007 at 10:05 am
Hi there — has there been any progress with this plugin fix yet for 2.3? Thanks in advance.
October 20th, 2007 at 8:51 pm
How to limit the number of posts listed under the categories?
October 25th, 2007 at 4:46 am
[...] ???? [...]
October 27th, 2007 at 9:23 pm
Your plugin rocks - but how about the update for 2.3
November 2nd, 2007 at 11:34 am
Hi There .. with the template I use links do not show in bold, therefore my Categories are not being distinguished from the posts by showing in bold. Can you provide me with a code to indent the posts instead?
November 2nd, 2007 at 12:10 pm
Hi Rachel,
you can edit the plugin easily if you now a bit of html,
Categories are shown on this line:
<li><strong><a href= . get_category_link(posts->cat_ID) .> . apply_filters(list_cats, posts->cat_name, $posts) . </a></strong></li>and Posts:
<li><a href= . get_permalink(arcresult->ID) . > . apply_filters(the_title, arcresult->post_title) . </a></li>
I hope it helps u!
November 2nd, 2007 at 2:10 pm
I know HTML but not PHP so thanks for that.
November 8th, 2007 at 5:36 pm
I’d love to see an update for 2.3 as well. This is exactly the sort of thing I’m looking for.
I’m not a huge fan of ‘me too’ism except that you have no other way of knowing how desirable your plugin is.
Cheers
November 9th, 2007 at 11:55 am
Hi there! I’m eagerly awaiting your update for 2.3, as yours seems to be the only one to do the job. Fingers crossed!
November 9th, 2007 at 1:31 pm
Hey people, yesterday I was working on the 2.3 update, I hope will be finished very soon!! Is almost done!
November 10th, 2007 at 1:04 am
[...] I had time (even though I am very busy, I promise) to fix the wordpress plugin: list of posts by category plugin for wordpress for WordPress [...]
November 10th, 2007 at 9:20 am
Good news! Thanks F.
November 12th, 2007 at 12:45 am
Like Robert Feddes above, I want to know:
How can I make this dynamic, so it reads the catid from the page it is on and feeds that into the script?
David (Frucomerci) replied:
To get the category from the page is on? try this function ?get_category_by_path()? from category.php. If not, on your uri structure, choose to show the category, then split the url and having the name you can know the ID easily with ?get_cat_ID??
I added
to category.php, but that showed nothing, so I replaced it with, but that still showed nothing, so I think that means the function won’t work within the posts-by-category code.My Options - Permalinks are set to include the category in the uri/url.
How do I split the url to extract only the cat name?
How do I code to convert the name to a cat_ID?
php get_cat_ID(name)?
Thanks.
I look forward to Wordpress having this functionality, thanks to your plugin.
November 12th, 2007 at 1:26 pm
I tried to include code in the above (within
brackets, but it was eliminated, so I'll repeat that part here.I added to category.php, but that showed nothing, so I replaced it with , but that still showed nothing, so I think that means the function won?t work within the posts-by-category code.
November 12th, 2007 at 1:41 pm
One final try - I had added spaces around the > and
November 12th, 2007 at 2:05 pm
Finally - I had added spaces around the greater than and less than signs, which usually gets the code treated as not-code, since no code has spaces by the greater/lesser brackets, but it was eliminated, so I’ll repeat it here.
I added
?php get_category_by_path(); ?
to category.php, but that showed nothing, so I replaced it with
?php echo get_category_by_path(); ?
, but that still showed nothing, so I think that means the function won?t work within the postsbycategory.php either.
November 12th, 2007 at 2:28 pm
P.S.
I’m using WP 2.3.1 and your brand new Posts-by-Category 3.0 for WP 2.3.
November 17th, 2007 at 1:40 am
Is there a way to limit the number of posts under each category? For example, I want to list only the most recent 10 posts. Thank you. This is a very good plugin. Easiest to use and does what it promises.
November 17th, 2007 at 4:44 am
If you want to have the recent 10 posts, you need to change the Sql query string,
put this:
If your plugin is for < 2.3
$arcresults = $wpdb->get_results("SELECT *, COUNT( `ID` ) FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' AND ID IN (Select post_id FROM $wpdb->post2cat WHERE category_id =$posts->cat_ID) GROUP BY 1 ORDER BY post_date DESC LIMIT 0 , 10;");if is for => 2.3
$arcresults = $wpdb->get_results("SELECT *, COUNT( `ID` ) FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' AND ID IN (Select object_id FROM {$tp}term_relationships, {$tp}terms WHERE {$tp}term_relationships.term_taxonomy_id =" . $posts->term_id . ") GROUP BY 1 ORDER BY post_date DESC LIMIT 0 , 10;");Should work!
November 17th, 2007 at 5:59 am
Yes, that worked. Thank you!!
November 17th, 2007 at 10:41 pm
Little question: Is there a way to not show empty categories? thanks in advance!
Y muy buen trabajo
November 19th, 2007 at 4:28 am
Hi, when I tried activating this plugin, it gave me the following error above each post:
“Warning: Invalid argument supplied for foreach() in (the postsbycategory PHP filename) on line 114.”
Line 114 is: foreach ( $arcresults as $arcresult ) {
How do I fix it? The plugin works, but the error is a big deal, especially since it repeats itself 3 times per post!
Thanks for any help/suggestions, I’m new at this!
November 19th, 2007 at 8:45 am
Javier: I will take a look as soon as possible, but if the categorie is empty, why do you have it?
Melissa: Put this before the line 114
if (is_array($results) || is_object($results)){don’t forget to close the } (just before $the_output .= ”;)
November 19th, 2007 at 11:01 pm
Hi, thanks so much! That fixed it, but I have another question…it shows only a list of the categories, and not the posts within each category, even though the posts exist. I’m sure the fix is very simple but I don’t know what to do…
November 20th, 2007 at 3:44 pm
Melissa, try changing:
if (is_array($results) || is_object($results)){
for
if (is_array($arcresults ) || is_object($arcresults )){
November 23rd, 2007 at 9:03 pm
I was curious if you could show how to indent the subcategories so there is a heirarchy. I figured out how to adjust my list so that my categories are h3 headings and the unordered list begins after that, but it just lists all my categories in one big list, even though some have subcategories. Is there a way to account for this in the display? I’m not that well-versed in PHP.
Thanks!
November 24th, 2007 at 12:19 pm
Hi
I don’t know if anyone had this problem:
In the term_taxonomy table the term_taxonomy_id and the term_id are not always the same number. I think the selection in the plugin presumes that they are equalled.
for example in my term_taxonomy table they are equal until 19 but from there:
term_taxonomy_id: 21,22,23,24,40,26
term_id: 20,21,22,23,38,24
The term_id : 20 is a category here. And nothing shows up in the final page. Why?…
When the plugin makes the selection by this:
term_relationships.term_taxonomy_id =” . $posts->term_id . ”
it looks for term_taxonomy_id=20 but it should look for 21…
(I don’t know if I’m clear enough..)
I came up with this but I’m little-more-than-beginner in mysql/php:
I changed this:
term_relationships.term_taxonomy_id =” . $posts->term_id . ”
to this:
term_relationships.term_taxonomy_id =(Select term_taxonomy_id FROM {$tp}term_taxonomy WHERE term_id=” . $posts->term_id . “)
If there’s a better solution for security/performance reasons please post it.
Sorry for the long post…
November 28th, 2007 at 1:30 pm
Hi
Thx before for this nice plugin….
but theres a problem when i use it in my site http://www.bali-weddingplan.com
Theres a sql error ….
Can you help me ??
November 28th, 2007 at 2:03 pm
Which WP have you installed??? 2.3? I think you have installed the pluggin for 2.3 and you have a previous version…
November 29th, 2007 at 3:28 am
hi man thx for the reply
i use 2.3 version, but i have mysql 4 in my server (no problem in mysql 5)
i’ve got this error
WordPress database error: [You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'Select object_id FROM wp_term_relationships, wp_terms WHERE wp_]
SELECT * FROM wp_posts WHERE post_type = ‘post’ AND post_status = ‘publish’ AND ID IN (Select object_id FROM wp_term_relationships, wp_terms WHERE wp_term_relationships.term_taxonomy_id =1) ORDER BY post_date DESC
November 29th, 2007 at 11:01 am
Hi again, i’ve a solution for Mysql 4.x (not support sub queries) you can read the manual at http://www.devchunks.com/dev/subquery-workaround-in-mysql-4/ sorry 4 disturbin you man…
Thx again for this plugin
December 5th, 2007 at 11:44 pm
Hi, Great Plugin.
Is it possible for your plugin to do the same thing but list posts by Year Headings?
December 8th, 2007 at 8:53 pm
Great plugin, so thanks! Quick question:
I want a page listing only the categories that currently have posts in them.
I don’t want links to the individual posts, just to the categories.
I don’t want links to categories that are empty (like “Uncategorized”).
Can I edit the plugin to do this? Thank you!
Yours,
J
December 9th, 2007 at 5:57 am
[...] Postsbycategory [...]
December 10th, 2007 at 12:12 pm
#jmoney, of course you can edit it. Php is opensource, isn’t it?
December 10th, 2007 at 11:03 pm
Hi,
Is there was way to make the categories listed in a hierarchical fashion? I had a quick look at the php, but I’m anything but proficient at it, but if you post the snip that would need to be changed… if indeed that is all it would take.
Cheers!
Michael
December 11th, 2007 at 12:15 pm
#Michael, there is always a way, unfortunately I don’t have time to do it, so busy I can’t do everything people ask me… Sorry man!
December 11th, 2007 at 4:35 pm
No worries!
Thanks for a great plugin.
December 11th, 2007 at 8:30 pm
I am wondering if anyone has figured out how to include the category description (for the 2.3 version). I’ve been struggling with this all day.
Thanks!
December 20th, 2007 at 6:03 pm
Excellent plugin - thank you. I’m having trouble on this site: http://brownfields-development.com/site-map/ Not all of the posts for the category are being shown.
I am running WP2.3 and used the correct plugin (although both seem to have the same version #?)
January 1st, 2008 at 8:37 pm
Hi there,
Do you know how I could list the posts of one particular category only, as opposed to posts from all the categories?
Thanks.
January 2nd, 2008 at 3:25 pm
Hi, I would also like to know how I can list a post of one category instead of all. You have described it in version 2.2 before but I’m using 2.3. Which lines should I change?
Thanks a lot your plugin is one of the most useful out there!
January 3rd, 2008 at 5:03 am
Hi,
thanks for the plugin!
on my website Kicktopia.com, on the right you can see I’m using your plug-in. However, under the heading JB, it is displaying posts from a different category which makes no sense. It also doesn’t display the post found at the top of the page which is filed under the JB category.
how do I fix this, i need help urgently!
thanks!
January 4th, 2008 at 3:51 am
bump!
January 4th, 2008 at 11:21 am
Chris Masse and Nick, the easiest way to do it is put this after “foreach ($last_posts as $posts)”:
if (apply_filters(’list_cats’, $posts->name, $posts) = “CATEGORY_NAME”) {
//actual code
}
Close it after $the_output .= ”;
I haven’t tried but shoud works, :p
January 4th, 2008 at 11:31 am
Bryce, no idea what is going on with your navigation man, is weird! Why only happens with JB and New Balance and the rest are fine?
You should take a look to the database and the two sqls to print out the posts
$last_posts = (array)$wpdb->get_results……. catch the categories
$arcresults = $wpdb->get_results(”……….. catch posts from one category
January 4th, 2008 at 6:22 pm
Hi Frucomerci, I’m no wiz with PHP so I couldn’t find any problem with it.
As much as I love the plugin, I had to leave it, and hacked Dagon Design’s sitemap plugin and it’s working better now. Let me just say, yours was a lot easier to understand than this one! haha.
thanks anyway!
January 4th, 2008 at 10:13 pm
Hey Bryce, sorry but PHP is not my strength language neither… glad you find a solution!
January 5th, 2008 at 6:28 am
Thanks Frucomerci
January 5th, 2008 at 10:38 am
i was looking for this solution for a long time! the plugin is great!
Thx!
Manele
January 7th, 2008 at 1:52 am
Having this same problem of the post being mixed up in the categories.. Please tell us a fix.. This is the only plugin like this I can find that almost works right!
January 8th, 2008 at 8:22 am
Hi,
I have a similar request to a couple of posts above. I would like to list the posts of only 3 of my categories - Articles (ID 12), Reviews (ID 11) and Interviews (ID 13). This will make up the content of the “Press” page of my website.
Is this possible and are you able to give me the change to the code necessary?
Thanks in advance!
mtchairs
January 8th, 2008 at 11:29 am
#Mtchairs, put this after ?foreach ($last_posts as $posts)?:
if ((apply_filters(?list_cats?, $posts->name, $posts) = “Articles”) || (apply_filters(?list_cats?, $posts->name, $posts) = “Reviews” ) || (apply_filters(?list_cats?, $posts->name, $posts) = “Interviews”)){
//actual code
}
Close it after $the_output .= ?;
January 8th, 2008 at 3:23 pm
Thanks so much for you plugin and for your quick response. Would you mind sending the file as it should be? I tried following your instructions above and got a fatal error message. I’m not sure what I’m doing when it comes to php.
mtchairs
January 8th, 2008 at 6:43 pm
Sorry #mtchairs, I had an error on the PHP code, please change it for this one:
if (( apply_filters(’list_cats’, $posts->name, $posts) == “Articles” ) || ( apply_filters(’list_cats’, $posts->name, $posts) == “Reviews” ) || ( apply_filters(’list_cats’, $posts->name, $posts) == “Interviews” )){
I hope it fixes your problem.
January 8th, 2008 at 7:01 pm
[...] On some of my blogs I have compiled a list of 101 various things, and in order to display each post on the list I went WordPress plugin searching and ended up with Posts by Category. [...]
January 9th, 2008 at 12:25 am
Nice code. I need to tweak it so that it only displays a list of the posts in the current category. Not on an archive page, but on a single post page. I’m displaying the list in a sidebar.
I read through the comments and there are some people who were wanting to do the same thing, but a solution was never really given clearly. And if it was, I missed it.
So… how do you do it? What needs to be tweaked?
Thanks in advance.
January 11th, 2008 at 2:36 pm
Hi,
I’ve still got problems with the posts that are showing up for the two categories that I’ve chosen to display.
The category ‘Articles’ should have 11 posts - instead 2 posts from the ‘Theatre’ category are appearing there.
The category Reviews should have 11 posts - instead 10 posts from the ‘Articles’ category are appearing there. Only 1 post is showing up correctly.
Any ideas how to sort this out? Would using the Cat ID be any better at matching the correct posts to the correct category?
Thanks
mtchairs
January 11th, 2008 at 3:08 pm
#mtchairs ,
Man, I don’t know what is going on with this new version of WP, for some people the plugin runs fine, for some not.
Yes, may be try that, change the Cat ID instead of the Name, my strength is not PHP, what I do, is play with the database fields and functions from WP until something works.
Sorry but I am very busy and also I don’t have 2.3 installed on my blog…
Anyway, good luck and have a nice weekend!
January 14th, 2008 at 12:23 am
Hi, this is a very handy plugin that I use for my blog, I think the idea of using it for a site with uncategoriezed posts is a cool little hack that i have blog it would be really good for. Thanks!
January 16th, 2008 at 7:51 pm
Hello:
The plugin is working on my site, but I request you to help me in beautifying it more!
I need a couple of blank lines inserted before “Archives by month:”. and also before the “” in the Archives.php.
Also, the entire result comes aligned to the left edge of the page. What to do so each line starts with a couple of blank spaces?
Please help! Thanks!
January 16th, 2008 at 7:55 pm
Please read “php get_footer()” code above in the “”. The actual code was written there, but the system hid it!
Thanks again!
January 17th, 2008 at 8:45 am
Is there a way to set the number of post the plugin takes. I wanted to se it to 5 posts.
Thanks great plugin
January 22nd, 2008 at 12:56 pm
[...] Plugin Homepage [...]
January 27th, 2008 at 1:01 am
[...] Postsbycategory [...]
January 27th, 2008 at 1:02 pm
Hi there
I just came across, and used very successfully, your posts by cat
plugin. Nice work! I have no idea myself, but dabble some.
I made a few amends.
NESTED LIST:
I (too?) couldn’t work out where to place the to create a nested
list, so went for giving child items a class, which then has a left
margin applied.
EXCLUDE EMPTY:
$last_posts = (array)$wpdb->get_results(”
SELECT {$tp}terms.name, {$tp}terms.term_id
FROM {$tp}terms, {$tp}term_taxonomy
WHERE {$tp}terms.term_id = {$tp}term_taxonomy.term_id
AND {$tp}term_taxonomy.taxonomy = ‘category’
AND {$tp}term_taxonomy.count > 0
{$hide_check}
“);
The net effect of these looks like the attached.
I don’t know how to make exclude empty a setting option, sorry.
I hope you find these useful.
Ed
January 31st, 2008 at 6:27 pm
Very NICE! and exactly what i was searching for.
But is there any way to exclude a Category? Please help
February 2nd, 2008 at 7:05 pm
I love hte plugin. I tried to edit it to shwo only one category and it came up as a fatal error. I am using 2.3. Can you be more specific on how to make the change?
February 3rd, 2008 at 6:27 pm
Can anyone please explain to me how i can order the categories shown and how to hide specific Categories. Thanx
February 3rd, 2008 at 9:13 pm
same here, Plugin doesnt work for subcategories correctly and I dont know how to rearrange the Categories. Please Help. Could someone right an totorial?
February 27th, 2008 at 11:34 am
Hi, I’m using the version for WP2.2 and am also trying to exclude categories… The above method creates a fatal error, as said. Can anyone figure out a way to do it?
Thanks!
March 7th, 2008 at 2:31 pm
Thanks, you are very kind!
March 13th, 2008 at 2:07 am
Hey there,
I changed this (WP2.3.3) to make it render nested lists, instead of 1 very big list.
$the_output .= 'term_id) . ‘”>‘ . apply_filters(’list_cats’, $posts->name, $posts) . ‘‘;becomes
$the_output .= 'term_id) . ‘”>‘ . apply_filters(’list_cats’, $posts->name, $posts) . ‘‘;and before this:
}
$the_output .= '';
you add this:
$the_output .= '';
so that it looks like this:
$the_output .= '';
}
$the_output .= '';
March 20th, 2008 at 9:20 pm
I used the helpful info on the discussion to limit the p2cat from showing the empty “uncategorized” category. Thank you Ed!
However, I still have a problem and would appreciate some guidence:
I only have two non-empty categories “News” (3) and “Projects” (5)
News has 8 posts and Projects has 11 posts.
However, on the page I see all 8 News items and Only 1 of my Projects posts.??
Any thoughts or suggestions?
- Grant
March 20th, 2008 at 9:27 pm
also….
a suggestion: A way to include the number of comments with each post would be very helpful. It would draw readers to the most active/commented posts.
Just a thought.
-Grant
April 12th, 2008 at 9:14 am
I have the same problem, that Melissa. The plugin shows only the main categories, but no posts. Anyone can help me?
Thanks.
April 21st, 2008 at 6:15 pm
Hi! First of all, your plugin is great and really helped me in my site. However, I found a problem. I have limited the posts by category to 10 (to make lists shorter) and everything works fine until I have 2 categories. If I want to add the third one or the 4 one, the posts under these categories are not shown. So basically, I have two categories with posts under and 2 without any posts. Can You help me with solving that? Thanks!
April 21st, 2008 at 10:44 pm
Hi and thanks for the plugin Frucomerci.
But i’m not only here to thank you. I have a problem to.
I’d like to style the current category with css. So it would be great if the current category had a class like “.current”.
I’d gave it a try with “if (is_category())”… but failed.
So i thought perhaps you like the idea.
Greetings
-Moguul
April 21st, 2008 at 11:21 pm
Hi everyone,
I am really sorry but I am very busy with other stuff and can’t fix the plugin or find a solution for each one of you… Anyway, you are free to change it, update it or customize it.
I hope you understand, sorry about that, good luck and keep trying, there is always a solution out there!
Regards, Frucomerci
April 25th, 2008 at 6:03 pm
[...] list of posts by category plugin for wordpress Uncategorized [...]
April 30th, 2008 at 9:35 pm
Hey, great plugin. I had an issue that i resolved which may help others. Please note, i am NOT good at the programming stuff, but managed to do this.
I have a list of sub categories that i needed displayed using your plugin, so i needed to specify a parent category. I added this to line 158:
AND {$tp}term_taxonomy.parent = $cat
you know, where $cat = whatever your parent category ID is. Alternatively, if you wanted to specify a specific category, you would do:
AND terms.term_id = $cat
So, hope that helps. btw, this is a great plugin. it’s just what i was looking for. thanks!
June 5th, 2008 at 5:52 pm
It would be great if we can choose only one category…. and display the posts of this category
June 22nd, 2008 at 8:28 am
[...] Category list list of blog post titles by category. (modified) PHP script from David Sanchez [...]
July 28th, 2008 at 2:13 pm
[...] List of Posts from each Category plugin for WordPress ?????????????? ??. ???? [...]
July 28th, 2008 at 2:14 pm
[...] List of Posts from each Category plugin for WordPress ?????????????? ??. ???? [...]
August 2nd, 2008 at 5:06 am
[...] Does this plugin provide the functionality you’re looking for? list of posts by category plugin for wordpress __________________ - Rick Beckman, DIY Themes Support How to Ask Support Questions the Smart [...]
August 15th, 2008 at 9:44 am
[...] Postsbycategory [...]
August 19th, 2008 at 5:49 am
[...] List of Posts from each Category plugin for WordPress ?????????????? ??. ???? [...]
September 6th, 2008 at 12:55 pm
[...] List of Posts from each Category plugin for WordPress ?????????????? ??. ???? [...]
September 22nd, 2008 at 1:42 pm
[...] of Posts from each Category plugin for WordPress ?????????????? ??. ???? RelatedPosts ??Wordpress??????? ???? ?????????????. [...]
October 6th, 2008 at 8:08 pm
[...] © Postsbycategory TEST Her hangi bir sayfa da veya yan menünüzde sergileyece?iniz kategorilerin içeri?indeki [...]
October 12th, 2008 at 2:26 pm
[...] List of Posts from each Category plugin for WordPress ?????????????? ??. ???? [...]
October 26th, 2008 at 12:33 pm
[...] List of Posts from each Category plugin for WordPress ?????????????? ??. ???? [...]
October 29th, 2008 at 4:55 pm
[...] had taken an original plugin, Frucomerci’s ‘List Posts by Category Plugin and modified it for her own use. After she had what she liked, she then shared it with the world [...]
November 14th, 2008 at 6:52 am
[...] List of Posts from each Category plugin for WordPress ?????????????? ??. ???? [...]
November 15th, 2008 at 11:05 am
[...] List of Posts from each Category plugin for WordPress ?????????????? ??. ???? [...]
November 21st, 2008 at 1:49 am
[...] list of posts by category - “displays a list of the posts from each category of your WordPress installation. It can be added to a post or page, or used directly in a template file.” [...]
November 21st, 2008 at 5:09 pm
[...] ©? Postsbycategory? TEST? Her hangi bir sayfa da veya yan menünüzde sergileyece?iniz kategorilerin içeri?indeki [...]
November 25th, 2008 at 4:53 pm
[...] © Postsbycategory TEST Her hangi bir sayfa da veya yan menünüzde sergileyece?iniz kategorilerin içeri?indeki [...]