WordPress.org

Ready to get started?Download WordPress

Forums

Have a category show one one page (13 posts)

  1. life1134
    Member
    Posted 2 years ago #

    I wanted to know if there was an easy way to have a blog category show on a page? That way I can have the category matt show on the page matt and the category office show on the category office.

  2. esmi
    Forum Moderator
    Posted 2 years ago #

  3. life1134
    Member
    Posted 2 years ago #

    i am so lost on this I am not a programmer I just want the category jennifer to load on the page called jennifer. I read all this code and I can not make it work. Can someone please help me out?

  4. Emphacy
    Member
    Posted 2 years ago #

    Hello.

    Unfortunately pages are static and are not able to display dynamic content (categories).
    If I'm understanding you correctly, you want all the posts in the category 'Jennifer' to show up when you click the page 'Jennifer'?

    There's a way to redirect the page you click to the 'Jennifer' category however, which will look like it accomplishes the same task, but sadly you need to do a little bit of code editing.

  5. life1134
    Member
    Posted 2 years ago #

    this link http://codex.wordpress.org/Pages#A_Page_of_Posts shows how to make a category load on a page but I just dont understand where to place the page name and the category name

  6. Emphacy
    Member
    Posted 2 years ago #

    Ignore that page, it'll only confuse you even more. Now that I know what you want to do though, I can link you to an article I wrote for people willing to do this...

    I wanted to do the same thing when I first got WordPress. I really hope it helps you out since it's what I wrote it for...

    Unfortunately, it does require some very simple code editing, but it does tell you what code to use and where to put it...

    http://www.nerd-centre.net/how-to-redirect-pages-categories-wordpress/

    :)

  7. life1134
    Member
    Posted 2 years ago #

    the reason why I want it to load in a page is because I have a image slider that loads at the top of the page. I can already set up a menu link that send them to a page with just a category i need but I need to find a way to load it into a page. What is this guy doing? http://www.youtube.com/watch?v=4lRhwino5pc&feature=related

  8. jeezyo
    Member
    Posted 2 years ago #

    What id probably do -- edit your archive template that is displaying category archives. test for individual categories, and have it display your slider if its the right category.

  9. life1134
    Member
    Posted 2 years ago #

    you lost me

  10. life1134
    Member
    Posted 2 years ago #

    is this really that hard to do in word press this guy in the video made it look so easy he just added a little code and Done.

  11. jeezyo
    Member
    Posted 2 years ago #

    Its really not that hard. but its also not something you can easily accomplish just from the wordpress dashboard. you have a few options, but the basis of all of them, is that something in the template file showing those category posts, needs to know to display your slider. So you could,
    1) create a template page that queries posts and says to display only posts of the category http://codex.wordpress.org/Function_Reference/query_posts#All_Posts_in_a_Category and also includes your slider. then just create a page for it in the dashboard, and publish. or,

    2) what i was explaining above. basically, when you put a category into your menu, it displays all of the entries from that category when the link is clicked, using most likely, your themes archive template. So what you could do inside that template, is use conditional tags to determine if its the category or categories you want to display the slider for. http://codex.wordpress.org/Conditional_Tags . So the page would output different html say, if it were category A, vs category B, vs a tag or an author archive.

    hope that makes slightly more sense :-)

  12. life1134
    Member
    Posted 2 years ago #

    the first one is what I want to do I tried that by just adding this to the page.php`<?php if(is_page("matt"))(query_post"cat=4"):)?>
    //your code
    <?php endif;?>`

    But it did not work

  13. keesiemeijer
    moderator
    Posted 2 years ago #

    Duplicate page.php and call it jennifer.php and put this at the top of this new file:

    <?php
    /*
    Template Name: jennifer
    */
    ?>

    Now you have created a custom page template.

    Put <?php query_post('cat=4'); ?> above the loop
    Publish a "Page" with the title jennifer and give this Page the Page template "jennifer" found under "Page Attributes" on the edit Page screen. If all is well the Page jennifer will now show posts with a category of jennifer.

Topic Closed

This topic has been closed to new replies.

About this Topic