WordPress.org

Forums

one category per page (8 posts)

  1. flakkito
    Member
    Posted 11 years ago #

    Hello, sorry if this has already been asked but i have been working on it so long my brain is fried.
    i am using the nightly build with sub cats.
    simply put, i have these categories:
    general
    music
    lyrics
    stuff
    i would like to click on "music", see only the posts from "music" and the corresponding sub categories (lyrics,stuff), and not see "general".
    1) how can i modify this code to only show cat 3:
    <?php list_cats() ?>
    2) i found this code in the wiki, but do not know how to implement it. I am not very skilled php wise.
    <?php
    if ('/' == $_SERVER['REQUEST_URI'])
            $cat = 1;
    ?>
    can someone elaborate on this code and also, is this code good with the newest version?
    thanks!

  2. Anonymous
    Unregistered
    Posted 10 years ago #

    Yes, I would like to do this too.
    Is there an answer anywhere?
    Del

  3. davidchait
    Member
    Posted 10 years ago #

    Ummm... it doesn't do that already? It should already show you a view filtered by the chosen category. Maybe I'm missing something.
    -d
    http://www.chait.net

  4. carthik
    Member
    Posted 10 years ago #

    flakkito, a link to your site with these cats would help others see how it behaves.
    If music is a subcat of general, then when you see general, all the music posts will be shown too, that's the normal WP behaviour.

  5. takeiteasymama
    Member
    Posted 9 years ago #

    No, the question is: I make a page called Music and I only want the Category Music posts to be seen on that page. Can you direct one category per page?

  6. Kafkaesqui

    Posted 9 years ago #

    Why do you need to create a Page for a category of posts??? Posts can already be displayed by category through the category listings. Setting up a Page to do this would be redundant. It's recreating the wheel.

    Now, if this is an issue of displaying all posts within a category at one time, look at these plugins:

    http://mattread.com/archives/2005/03/custom-query-string-plugin/
    http://wordpress.org/support/topic.php?id=24031#post-136906

    Beyond that (i.e. category on a Page), look on the forums for info about "query_posts", and see the Codex about custom Page templates:

    http://codex.wordpress.org/Pages#Pages_can_use_Different_Templates

  7. rk
    Member
    Posted 9 years ago #

    It is not recreating the wheel. I will remove the posts of a certain category from the main page, and will only be featuring in a page. Please suggest how to do it. I had seen someone suggesting changing the link of the page to something like ....index.php/category/thatone , so that page will fetch the posts from this category. But I am not finding how to change the link to a page. Pages are fetched from database and I can not manually change the url of a page. I dont want to create myself a link because in that case I will have to do everytime I change my themes.
    Is there a way to do it at database itself ?

    The worst part is I had seen the solution in one of the forums, but am not getting it when it is needed today [after desparate 2 hours search]

  8. rk
    Member
    Posted 9 years ago #

    Got the solution here:http://wordpress.org/support/topic/39698?replies=7

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.