Adding posts from mulitple categories to one page
I’ve been busy with this one for a couple of hours now but it seems i’ve reached the limit of my PHP skills 😉
What i want doesn’t seem to be that hard or complicated.
Basicly, i’ve made a template for a specific page. Within this template i’m trying to make a function like this:
Just before the loop.
Within this loop then, i want four posts appearing from random categories (i’ve got 6 now in total) and all of these posts can be random too.
The thing is, when i run this piece of code i also get posts from the same category. I don’t want that. For each of those 4 posts i want them all to be from a different category. Perhaps i should use something like this ?
Thanks a lot for any help or feedback!
Maybe usefull to know. These are posts from a portfolio template, hence the: ” post_type=portfolio&get_term=term_id ” in my code snippet.
- The topic ‘Adding posts from mulitple categories to one page’ is closed to new replies.