Šta je Posts per Cat?
Posts per Cat je dodatak za WordPress platformu za blogovanje koji omogućava listanje poslednjih N naslova za sve ili samo za kategorije najvišeg nivoa na blogu. Naslove po kategorijama grupiše u kućice i slaže ih u dve kolone.
Odakle da preuzmem Posts per Cat?
Posts per Cat u verziji 0.0.14 možete preuzeti odavde: Posts per Cat 0.0.14 (104) ili iz Vordpres riznice na adresi http://wordpress.org/extend/plugins/posts-per-cat/.
Ovaj dodatak nastao je kao rezultat davanja primera polaznicima druge generacije Škole veb novinarstva o izmeni i unapređivanju naslovne stranice bloga.
Kako se instalira?
Preuzetu datoteku raspakujte pomoću arhivera (preporučujem program 7zip), a potom dobijeni direktorijum posts-per-cat/ pomoću FTP klijenta (preporučujem program FileZilla) postavite na server u direktorijum wp-content/plugins/ Vaše Vordpres instalacije.
Ako koristite Vordpres 2.9 ili noviji, instalaciju obavite sledeći donje video uputstvo.
Podešavanja dodatka
Kao što ste u gornjem video uputstvu mogli da vidite, podešavanja dodatka Posts per Cat vrše se u odeljku Kontrolne table do koga se dolazi preko menija Podešavanja → Članci po kategorijama.

Pozicija dodatka Posts per Cat u meniju Podešavanja
Opcije za podešavanja podeljene su u četiri sekcije — Kutije, Opcije kategorija, Postavke članaka i Opciono.
Kutije
U odeljku Kutije određuje se minimalna visina kućice koja sadrži izlistane naslove članaka, kao i broj kolona po redu. Podrazumevano se prikazuju dve kolone (kućice) po redu, dok se opciono može izabrati prikaz jedne kućice po redu, razvučene celom širinom članka.
Opcije kategorija
U ovom odeljku mogu se odrediti kategorije koje će jedino biti prikazane, odn. sakrivene, da li će se prikazivati samo kategorije najvišeg nivoa, te po čemu će se vršiti sortiranje kućica (po ID broju ili nazivu kategorije).
Postavke članaka
Karakteristike izlistanih članaka određuju se u sekciji Postavke članaka. Može se odrediti broj članaka čiji će naslovi biti izlistani, opciona dužina naslova u karakterima sa opcijom za aktiviranje skraćivanja dugačkih naslova. Ako na blogu postoje istaknuti članci (eng. Sticky posts), oni se mogu sakriti iz listanja aktiviranjem odgovarajuće opcije.
Ovde se takođe može izabrati opciono prikazivanje sažetaka članaka sa sve ili samo prvi članak u kućici. Takođe se može odrediti dužina sažetka u karakterima.
Opciono
Ukoliko nije uključena opcija za primenu stila nabrajanja koji dolazi uz Posts-per-Cat, biće upotrebljen podrazumevani stil teme koji u neki mtemama može izgledati loše. Da bi rešili takav problem uključite opciju za primenu PPC stilova u ovoj sekciji.
Kako se koristi?
Za upotrebu, t.j. prikaz kućica sa kategorijama na blogu, neophodno je dodati jednu liniju kôda za pozivanje Posts per Cat funkcije za štampanje sadržaja.
Jednostavno u šablon teme treba umetnuti sledeći kôd na mesto gde se želi dobiti spisak naslova po kategorijama:
<?php do_action("ppc"); ?>Preporučujem da ovaj kôd umetnete u šablon glavnog indeksa (datoteka indeks.php) iza paginacije:
<?php endif; ?>
<?php do_action("ppc"); ?>
</div>Kako izgleda?
Kada ste dodatak instalirali, podesili ga i dodali na željeno mesto, dobićete nešto nalik na sledeće dve slike.
Karakteristike
- podesiv broj naslova po kategoriji
- izbor listanja ili zaobilaženja naslova iz određenih kategorija
- izbor prikaza naslova iz kategorija najvišeg nivoa
- izbor poretka kategorija (ID ili naziv)
- određivanje dužine naslova i sažetka članka
- određivanje minimalne visine kućice za kategoriju
- prikaz dve kolone po redu ili samo jedne kolone celom širinom
- koristi sopstveni CSS koji se izmenom može prilagoditi potrebama korisnika
- preveden na srpski jezik (podrazumevani jezik je engleski)
- daje validan XHTML 1.1 kôd
- objavljen pod GNU GPLv3 licencom
Urađeno
- prilagođeno za Vordpres 3.1, dodata lokalizacija na francuski jezik zahvaljujući Pepita Pop 0.0.14 (2011-04-09)
- rešen problem sa putanjom do CSS-a u instalacijama Vordpresa koje nisu u korenom direktorijumu domena 0.0.13 (2010-05-27)
- otklonjen problem sa punom širinom kutije u IE6 0.0.12 (2010-05-18)
- dodato rešenje za skraćivanje UTF8 teksta na serverima koji nemaju PHP funkciju mb_strlen(), dodata opcija za filtriranje kategorija na stranici arhive, dodata opcija za prikaz umanjene slike sa sažecima, dodata opcija za prikaz samostalne veze do arhive kategorije 0.0.11 (2010-04-24)
- dodata opcija za prikaz dve kolone po redu (podrazumevano) ili samo jedne kolone celom širinom (opciono) 0.0.10 (07.01.2010)
- ceo naziv članka kao veza do članka, otklonjena greška koja proizvodi nevalidan XHTML kôd 0.0.9 (09.10.2009)
- dodat izbor kategorija koje će biti, odn. neće biti izlistane, prikaz sažetka za prvi ili sve članke u kategoriji, skraćivanje naslova i sažetka zapisa na željenu dužinu, određivanje minimalne visine kućice kategorije, permalinkovi za kategorije i članke 0.0.8 (26.09.2009)
- dodat action hook ppc, dodatak objavljen u Vordpres riznici 0.0.7 (04.03.2009)
- ispravljena greška za CSS URI na podstranama 0.0.6 (03.03.2009)
- dodata opcija za upotrebu pripadajućeg CSS stila za liste 0.0.5 (20.02.2009)
- sređen problem sa pozicioniranjem i listama 0.0.4 (20.02.2009)
- objavljeno probno izdanje 0.0.3 (16.02.2009)



@pep: Can you please post a URL to your blog with active PPC, so I can see that bug?
Many thanks for taking the time.
Here’s the blog : http://www.enfants-spectacle.com/
I have changed back to full title but when I select ‘shorten’ the display is the same as far as the rows and boxes are concerned (but the title does shorten).
@pep: Please, check is there a real file http://www.enfants-spectacle.com/wp-content/plugins/posts-per-cat/ppc.css because I got 404 Error page. That give us two solutions:
You can edit default theme, add
<?php do_action("ppc"); ?>in index.php and check theme preview. If you get two columns, then problem is in theme you use.Thanks again.
There is a real ppc.css in the folder (i downloaded it and checked it was not empty).
I tried to add the php code you mentioned in the index.php of my template, did not work either (and I tried in the page.php as well since I use the plugin in a page, did not work either).
It’s weird…
I have no idea what to do.
@pep: No, no, I mean to check default WP theme by adding that PHP code in default theme (click here to open index.php for default WP theme). If PPC works OK in default theme, feel free to send me theme you use so I can fin a bug.
Hi Alexander, thank you so much.
I tired that : the code in the default theme’s index.php.
It did not work.
So I begin wondering if there isn’t a conflict between several plugins…If I find, I’ll let you know.
Thanks any how !
@pep: OK, I found problem. You installed WP in subdeirectory WordPress. Now I added individual installation path for CSS in version 0.0.13. Please upgrade.
Whoooaaaooo ! You’re the best ! It works !
Thank you soooo much !
By the way, if you plan to have it translated into French someday, I’d be glad to help. Contact me on my email.
@pep: Done!
Hello, do you have the English version one? I think this might the exact tutorial I’ve been looking for. I hope you have it in english, thanks in advance!
is it possible to add a post date? Nice work. Thanks.
@Yurckk: No, right now I don’t have full tutorial in English. I hope Google translate can help, anyhow?
@bouba: When you hover title link, tooltip display date and time of post publishing. Do you think on that, or some other functionality?
@Aleksandar:
Ah, yes, very nice.
I wondered if the date could be inserted right next to the actual post.
Thanks again.
@bouba: That can be added as option in Widget control… Just give me some sugestions which options to add (only date after title, option to put date before or after title, etc)?
@Aleksandar:
Thanks a lot for answering.
The options would be to have the date (or time, or both) appear at the end of the post title (or at the beginning), as in:
“this is the post” – June 10, 2010
I hope this makes sense.
@bouba:
I’ve used the following to display the date:
How would I format the output?
@bouba: Use this hack:
echo mysql2date('j M Y', $clanak->post_date);just use proper PHP date format instead of ‘j M Y’.
@Aleksandar:
Fnatastic! Supach! Thanks very much.
Dear Aleksandar,
Thank you for this fabulous plugin, it did exactly what I was looking for! A couple questions:
1) Is there a way to get it to not show the category title at the top of the box?
2) Is there a way to get it to show the author of the post alongside the title of the post?
Thank you again for this fantastic plugin! Do you have a paypal or donation page set up? I would be more than happy to send something your way, for the time you’ve saved me!
All the Best,
Gabe Barber
Reading Local
Thanks Gabe. About asked questions, right now none of that is not implemented in PPC, but can be (added to TODO). I’ll send update here when I add this to trunk.
In Google Chrome, the lists appear as a courier-type font that is different from what is in my theme. I corrected this by adding a font-family definer in the posts-per-cat/ppc-list.css. Add it in the /*list style*/ section of the plug-in:
/* list style */
#ppc-box .ppc-box .ppc ul {
font-family: Arial, Tahoma, Verdana;
list-style: none;
margin: 0;
padding: 0;
}
Hope that helps some others.
Is there a way to have the lists ordered alphabetically?
Hi
I use your widget on my page, but it does not work as expected.
1) there are no excerpts (by the way: is this able to work with the more-tag?)
2) one of my categories (Schöne Sachen with pics on the right inner sidebar) is not shown – no categroy, no articles, no thumbnails
Any ideas?
This would be very helpful, this is just the widget I need for my page
Thanks!
1) PPC require defined excerpt in posts (text w/o formatting), more tag is not supported.
2) You must to have posts associated with that category, not subcategories. Your posts is in subcategories of ‘Schöne Sachen’, so there is problem.
wow, quickest answer ever!
Excerpts are no problem, there is this extra area in the article I think?
Any workaround for the subcategory-issue – perhaps I can add another category just for this and ignore it otherwise
Just enter intro text in Excerpt area on Post edit page, and that’s all.
For categories and subcategories, you can:
1) Uncheck ‘Only top level categories’ option on PPC Settings page and enter ‘Schöne Sachen’ category ID in ‘Exclude category’ on PPC Settings page, or
2) Add all posts from ‘Schöne Sachen’ subcategories to category ‘Schöne Sachen’ too.
I played around a bit and the exceprts work. But the thumbnails do not work?
And I unchecked the “top level categorie”….
About thumbnails – do you use WP post thumbnails feature or some custom plugin? PPC grabs thumbnails from WP core with function get_the_post_thumbnail().
hm, not sure. I do nothing “extra” to get the thumbnails i.e. for my right sidebar. Should I? And what do I have to do to make it work with your widget?
Hi I repeat question asked before:
Is there a way to have the posts list displayed alphabetically?
Would be a great feature.
Thanks,
K.
Not possible. I tried to enable that, but w/o success, for now.
sta ima novo razvojna verzija plugina?
Evo ga dnevnik izmena:
= 1.0.0 =* Adds option to use post content in stead of post excerpt
* Adds option for custom category ordering (as listed in Include category)
* Adds option to display PPC in one, two, three or four columns
* Adds available category list in Options page
* All coments in code translated to English
* Follow WP coding standards
* Renamed from Posts-per-Cat to Posts per Cat
Hello
Where can I download Posts per Cat 1.0.0 ?
Get development version.
Thank you, Aleksandar)
you are real master of php, you ppc is great
thanx
Hi,
I’m trying to use PPC on a page, but I just can’t work out how to do it! I just want one page, and all I want on it is PPC. I tried inserting with code tags around it, but obviously I need to put the code in my theme somewhere. But I can’t work out where to put it since I just want it on one page, not at the end of every post. Anyone got any quick tips on how to do it?
Thanks so much.
You can try with this solution: in template directory create new template file page-ppc.php with content:
<?php /* * Template Name: Posts per Cat page */ get_header(); ?> <div id="primary"> <div id="content" role="main"> <?php do_action("ppc"); ?> </div> </div> <?php get_footer(); ?>Then set template Posts per Cat page on page edit and please say is this work for you?
I would like to use your plugin for my ecommerce store. But it is made for bringing up posts. Is there a way to bring up all the product posts? Please let me know. I use your plugin for other website and they work well. Thank you.
Did you try to set specified category for include category field?
Still waiting for a reply. Thank you.
I used your plugin for other sites and it works great. For this site, we use jigoshop to post products. It is not post, it is product post. I believe.
I would like to use your plugin to bring up all the product categories and product post names under categories. Is it possible?
Thank you.
PPC does not support custom post types, only type `post` (and, I think `page`, but not sure).
It’s possible to enable custom post types in PPC, but right now I have not free time to develop that.
Aleksandre,
sve pohvale za plugin. Imam jedno pitanje. Da li je, i kako, moguće da se
naslovi članaka u okviru plugina bolduju? Pokušavao sam nešto u css fajlu, ali nisam uspeo. Ako je moguće, zamolio bih Vas za detaljnije objašnjenje.
Hvala unapred.
Pozdrav.
Postavljanje „masnih“ naslova u PPC boksu može da se postigne definisanjem sledeće CSS definicije:
.ppc li a:nth-child(1) { font-weight: bold; }Aleksandre, uspelo je.
Hvala još jednom na pomoći.
Pozdrav.
Aleksandre,
da li je moguće, i kako, promeniti boju linka u naslovu pojedinih članaka?
Trenutno su linkovi crveni, a trebaju mi ili crni ili tamno plavi.
Hvala Vam unapred.
Pozdrav.
Naravno, korišćenjem CSS definicija za boje véza. Pri sebi nemam instaliran PPC pa ne mogu da vidim koja tačno klasa treba da se menja, ali inspekcijom izvornog kôda ispisa dodatka nije teško pronaći šta treba stilizovati.
Pokušavao sam da pronađem, ali sam relativno nov u svemu ovome, pa nisam uspeo da nađem šta treba da se promeni. Ne vidim da je igde ispisana neka oznaka za boju, npr ‘red’ ili tako nešto. Ako budete u prilici da negde pogledate kod, bio bih Vam vrlo zahvalan da mi napišete šta bi trebalo uraditi.
Pozdrav.
Izgleda da sam imao više sreće nego pameti!
Nekako sam uspeo da ubacim liniju koda na pravo mesto. Hvala mnogo, Aleksandre. Nadam se da nije problem da Vam se obratim ako budem imao još neko pitanje?
Pozdrav,
Sava
Nije problem, samo je pitanje sa konkretnim primerom (linkom na „problematični“ blog) bolje od virtuelnog problema
Can I use this on more than one page? I would like different categories to show on different pages.
Well, U can use it on different pages, but only one settings is available right now. There is no option to set different settings for more than one PPC instance.
Hello, I would like to ask how to print the excerpt(thumbnail) for the first post before the post title, and also how can I add the permalink of the post to the exceprt. Thanks a lot
Hi there,
I’d like to link the thumbnail to the article. Just like the headline. What do I need to add to the code?
Hi, i like your plugin and am thinking about a page to display it on my site. However, I have another problem: I would like to limit the posts that are displayed on my category and tag pages. I can’t find any plugin that does that and wonder why. Do you have any suggestions?
Thank you in advance
Pablo
Can you please explain more detailed, how you like to limit the posts on category/tags archive pages? Do you have some example and specs?