Using get_posts – where should I add this?
-
Hi apologies in advance as I am sure this is a dumb question. I have been reading the Codex and just starting to have a delve under the covers as it were in terms of customising some of my content.
So for example if I want to display posts from a certain category I understand how I can do that by adding get_posts with a set of parameters – the question is though – where do I add this code? It doesn’t make sense to add it into an existing template file as I’m thinking it would form part of a page or a post. So for example if I have a post content with a few paragraphs of text then I want to say “and here is a list of what we are talking about” and then list posts from a certain category. Do I just make a new template file and code it in there and then assign that post to use that template file (can I do that?). What about if I want 10 pages like this, each listing a different category – 10 template files required?
Thanks in advance.
- The topic ‘Using get_posts – where should I add this?’ is closed to new replies.