/ Published in: PHP
                    
                                        
Had many people ask me how I display all posts in a category when they click on the category link in the header @<a href="http://www.vagrantradio.com">http://www.vagrantradio.com</a>. 
There's a lot more involved, but here's the quick and dirty;
                There's a lot more involved, but here's the quick and dirty;
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
//if is articles page, get posts from this category id and show 9 of them.
<?php
if (is_page('7') ) {//articles
query_posts('cat=4&showposts=9');
} elseif ( is_page('9') ) {//freebies
query_posts('cat=5&showposts=9');
} elseif ( is_page('356') ) {//inspiration
query_posts('cat=30&showposts=9');
} elseif ( is_page('949') ) {//tutorials
query_posts('cat=6&showposts=9');
} else {
$cat = '';
}
?>
Comments
 Subscribe to comments
                    Subscribe to comments
                
                