I’m pretty sure I’m missing something in the index.php that allows wordpress to do all of the filtering.
Having read these usage notes, I think you have the wrong type of theme for what you’re trying to achieve.
I’ve read the usage notes also. I have change the setting in the index.php to allow for displaying posts instead of pages. Just missing the script that allows wordpress to filter by category so that this will work:
/index.php?cat=category_name
Can’t I just install/add the script that performs this function into the index.php file?
I guess you could try passing in like you’ve got there and then change the query_posts
query_posts(category_name=$cat);
I’ve tried implementing that and it’s definitely getting closer, I have no posts coming up now when I use the cat.
Here’s the whole query_posts line
<?php query_posts(‘post_type=post&order=asc&category_name=$cat’); ?>
And I’m trying to call it using
http://www.opportunitiesworkathome.com/Newsletter/index.php?cat=introducton
I have a category Called Introduction which has slug introduction with one post in it.
I’m guessing it’s a syntax problem, but I’m very confident this will work.
Just a thought, not much of a php wiz, but do I have to define cat or something like that somewhere?
You should have double quotes otherwise $cat will be interpreted literally.
try:
<?php
$cat = $_GET['cat'];
query_posts("post_type=post&order=asc&category_name=$cat");
?>
That’s IT!
You are a genius huggie. Thank-you so much for your help.
Dave
No problem, I’m off to be now though as it’s 3:35am here!
Can I trouble for one more tidy up… is there a way that I can make it display a specific post/category if no category is parsed? Sort of like a catch-all/default.
Thanks again
Sorry just saw your last post… thank-you so much for all of your help, I’m pretty sure I can find a way to create the variable as a default first myself. Have a good sleep.
Dave
Try this:
<?php $cat = (empty($_GET['cat'])) ? 'introduction' : $_GET['cat']; ?>;
Of course you should also probably check that if the category is entered that it exists.