Hi guys, i´ve knoledge of html/css/±js and im just knew to wordpress&php stuff.
Im building my own template and im having so much trouble finding the information i need…and i hope someone could give me a light, heres the deal:
I wanna make a section of a page that filter the 5 most recent posts with categories of my wish.
Example: in this section it will show the most 5 recent posts within the categories “food” and “restaurant”. If theres none show a message and if theres more then 5 show a button like “show more” or something like that…
I know there´s a PHP code for that and im searching, made some tries but i cant get it to work…
Assuming you are using Wordpress here is some code that should do the trick. Replace category ID’s with the ones you would like to be displayed though:
Thanks for the fast reply @mike.fro but i want something a little more complicated, as my english fails i illustrated to show more accurately the idea!
Here it is:
Basically it wil show:
1: The Mother Category (if ti has one).
2: The Category.
3: The Categorie description (it is already defined when the categorie was created).
4: The posts that has both categories.
Yes, not a problem. Glad I could help. Like I said, it will take some customizing on your end to make it look however you’d like but the core is there for you to work with.