WordPress.org

Ready to get started?Download WordPress

Forums

Quick and Dirty category-post viewing! (2 posts)

  1. palgaming
    Member
    Posted 10 years ago #

    Okay, so after a few hours of hunting around, looking at various hacks and code, i've come up with a way to show the posts in a certain category. I think it's alot easier to implement if, like me, you want to display the different category posts on one page, but have more than one category shown.
    How you do it:
    Add the WP-Loop code to a blank php file (no whitespaces!) in the way that you'd like to display your posts. Make sure there's no <head> or <body> tags or anything like that. <meta> tags are fine, but no <body> or <head> tags, we need a plain php include file.
    Okay, once you've got the display sorted, at the top of the file where you have:
    <?php
    $blog = 1;
    include('wp-blog-header.php');
    ?>
    Put "$cat = X" where X is the category ID of the category posts you want to show, ABOVE "$blog = 1".
    Now all you do is include the file into your index.php or whatever php page where you want it displayed like so: <?php include('your-include.php');?>.
    Hope this helps anybody who wants the same style system as me, even though it's very dirty lol.

  2. mage111
    Member
    Posted 10 years ago #

    thanks dude, i think this may be just what im looking for
    your effort & time trying to figure it out is definitely appreciated
    <3

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.