went to that, I only see this:
query_posts(‘category_name=Staff Home’);
It doesn’t show me how to grab multiple categories by name? I am really sorry If I sound like a total idiot, I am more comfortable with front end design and back end PHP stuff tends to easily confuse me.
I even tried putting just a space between the words and it broke the thing, again a comma doesn’t do it, any more advice?
You need to use category ids if you want to pull from multiple categories. From the page I linked to:
Multiple Category Handling
Display posts that are in multiple categories. This shows posts that are in both categories 2 and 6:
query_posts(array(‘category__and’ => array(2,6)));
How do I find out the numbers associated with my categories?
When in admin mode when I hover over “pages” I see the numbers associated with the pages at the end of the URL, however, the part i need to pull from is in the “posts” section and it doesn’t give you a simple number that is associated with the post category.
I hope this makes sense, if I can find that out then I can put your advice into practice and see if it works for me….
sorry, figured out the categories part, got those numbers, will now try out your code. will let you know what happened
OK, sadly for me that made everything break, as I mentioned before I am not exactly a programmer although I am expected to get these things fixed.
Below is the entire code chunk for what I am trying to do, just incase this sheds more light on a potential problem or makes it easier to see what I am doing wrong
[Code moderated. Please post code snippets between backticks or use a pastebin for larger blocks of code]
The top part:
<?php query_posts(‘category_name=blog&showposts=1’); ?>
Shows the most recent post, it shows the excerpt from the page with the date etc.
The next part:
<?php query_posts(‘category_name=press&showposts=10&offset=0’); ?>
I need to keep that showposts=10 part to show the last 10 posts…. could be why it all broke?
This is where I tried to change it to the other code with the ID’s – Just for the record my ID’s are blog=7 and press=3
Can you let me know if this even makes even the most remote bit of sense?
Ok, this ALMOST did exactly what I wanted it to do….
<?php query_posts(array(‘category__and&showposts=10&offset=0’ => array(3,7))); ?>
The feed did show a mix of the 2 categories, BUT! – it didn’t show any more than the most recent and the next one, thr part where I have it saying showposts=10 didnt seem to register. Any ideas?
<?php query_posts('category__and' => array(3,7) . '&posts_per_page=10'); ?>
thanks man, but that made the whole page vanish, I reverted though so its cool,
I know I am so close yet so far from getting this to work…..