SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Aug 2009
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Limit a Page to Only One Category - Wordpress

    I'm sorry in advance if this ground has already been covered but, the search function keeps timing out on me.

    I would like to be able to set up an extra page on my Wordpress blog that will display the full text of posts out of one specific category.

    My goal is to review a book every few weeks in a post. What I would like to do is have a separate page to aggregate all of my book review posts without visitors having to click too much to get to the text of the review.

    I'm a programming dunce so, does anybody know an easy way to get this done (such as a nice plugin ).

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Categories automatically have category pages, which list posts in that category alone. You do not need a plugin.

    For customizing the appearance and functionality of the category pages, refer to the Template Hierarchy in the WordPress codex.

    - If your theme has a category.php file, that is used as the template
    - If your theme has no category.php file but has an archive.php file, that is used as the template
    - If your theme has neither category.php nor archive.php, index.php is used as the template

    If you don't already have a category.php file in your theme to edit, then copy index.php, rename it to category.php, and start there. Use the_content() instead of the_excerpt() to display full post text instead of excerpts.

  3. #3
    SitePoint Member
    Join Date
    Aug 2009
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The issue that I'm running into is that if I use the_content() instead of the_excerpt() then all of my category pages will show the full text.

    Is there a way to assign a template to only one specific category without altering the others?

  4. #4
    Is Still Alive silver trophybronze trophy RetroNetro's Avatar
    Join Date
    Jul 2003
    Location
    Texas
    Posts
    6,883
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Yes, copy the contents of category.php and paste it into a new file and save that as category-ID#.php (replace the ID# part with the categories actual ID#, ie: category-4.php) for the category you want to display full posts on, then replace the_excerpt() with the_content() and upload it to the theme folder.

    http://codex.wordpress.org/Category_Templates


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •