• OK, I cannot get any hacks I have seen to work, all I want to do is to show one category per page, to use this almost as a CMS, I am thinking of completely starting from scratch at this rate with a different program, as I have posted many requests and no one helps. I have seen many sites with it done so it must be possible. I’ve tried the “show-one-category” etc hacks on wiki, and just adidng $cat=? etc and none of it works.
    Please Help.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Can we have a url to your site ?
    Help will come your way ??

    Thread Starter ammonia

    (@ammonia)

    That is quite easy in fact.
    You simply need to create a menu bar that will list all categories. Clicking on that link will lead the visitors to all posts inside the selected category.
    It works on my web site (click my name to get the address), using the following piece of code (highly formated with CSS) :
    <div class="meta"><div id="categories"><?php _e('Categories:'); ?><?php wp_list_cats('optioncount=1'); ?></div></div>
    Isn’t it pretty much what you are asking for ?

    Thread Starter ammonia

    (@ammonia)

    Ok that seems to have worked, but how can I set the page so by default it loads category 2 only.

    Look inside the archives.phps file for how to display only one category.
    I have no time (I mean right now) to explain it further, but if you’re ready to get your hands dirty, go for it ??

    Actually, just put $cat=1; or $cat=2; or whatever Category you want right after $blog = 1; at the top of the page.

    cyb3rllama you mean in the address bar ?
    That would only work if you have no rewrite rule enabled…

    Either have a sticky post at the top of your home page, or try something like this at the top of index.php:
    <?php
    /* Don’t remove these lines. */
    $blog = 1;
    $cat= 1;
    require(‘./wp-blog-header.php’);
    $posts_per_page = 5;
    // Uncomment the next line if you want to track blog updates from weblogs.com
    //include_once(ABSPATH.WPINC.’/links-update-xml.php’);
    ?>
    (Obviously change the cat number to whichever category you want to show.)
    I set up a site for a friend like this. I had nine pages entitled things like resources.php, about.php etc. Then at the top of each page I changed the cat number to match that the resource. Then the menu bar simply pointed directly to the right php page.
    Is that the kind of thing you’re after?

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Desperatly need help only showing one category’ is closed to new replies.