Forums

Is there a plugin that shows all posts from one category? (9 posts)

  1. andrewb123
    Member
    Posted 3 years ago #

    I want to be able to show all posts from a particular category on a new page that I create. However, I want the posts to look like on my main blog page (not just a list of posts).

    Is there a plug-in that does this?

    Thanks,

    Andrew

  2. Michael Fields
    Theme Wrangler
    Posted 3 years ago #

    This is more of a theme issue, I think... your current theme is probably using a shortened form of The Loop to display your category archives. My advice, would be to replace The Loop in the theme file that displays your categories; typically this is either category.php or archive.php - but this depends on your theme. Which theme are you using?

  3. andrewb123
    Member
    Posted 3 years ago #

    I'm using the Upsilon Theme by LivingOS.

    I would prefer if this could be done with a plugin (from the front end) rather than by making a new template file for each page. Also, could I do this by altering the html section of the page (i.e. by running a loop)?

    I just want to show the posts from a particular category on a page that I have created.

    Thanks

  4. Michael Fields
    Theme Wrangler
    Posted 3 years ago #

    I think the best solution would be to Create a Custom Page Template which makes use of a customized loop. That shows only posts of a given category. This page template can then be assigned to any page in your blog. To choose the category from /wp-admin/, you could create a Custom Field which stores the category of that you want displayed on your page.

    My question for you is: "Why would you use a page to display posts when there are already category archive views that do this for you". It's kinda like reinventing the wheel when you own a wheel store....

    Just my opinion though :)

  5. andrewb123
    Member
    Posted 3 years ago #

    I am creating a site for a non-profit organization with chapters at various universities. My main page shows posts from all chapters. But I also have sub-pages for the various chapters where I want only posts from that chapter (posts are categorized as chapters) to be shown.
    It is extremely un-elegant to have to make a new template for each chapter plus I would have to do it myself for every new chapter (something I don't intend to do). I already have a separate template for every different chapter (because I want each sidebar area to be different). I don't want to have to make yet ANOTHER template (a news sub-page) for each chapter. So your idea of a custom field seems good but I can't find anywhere that shows me the code for such a page. Do you know of a place that I can get the complete code for showing the posts of a particular category?

    I am completely and utterly shocked that there is no plug-in that does what I am asking. It seems like the most fundamental of features - so much so that I would have expected it to be built in to wordpress itself.

  6. Michael Fields
    Theme Wrangler
    Posted 3 years ago #

    Do you know of a place that I can get the complete code for showing the posts of a particular category?

    Yes, I have something like this somewhere... I'll have to dig through old files to find it... might be a few days though.

    I am completely and utterly shocked that there is no plug-in that does what I am asking. It seems like the most fundamental of features - so much so that I would have expected it to be built in to wordpress itself.

    This functionality is already supported by WordPress only it is a bit different. You need to think of pages and posts as two separate entities.

    "Pages" are organized by a one to many type relationship: one page can be a parent of many but may have only one parent. "Posts" do not naturally fit into the world of pages at all.

    "Posts" are organized by Categories by a many to many type relationship. One Category can contain many posts while one Post may exist in many categories. "Pages" do not fit into the world of Posts or Categories at all.

    Knowing this. It is natural that posts be organized by category and not page. If I were in your shoes, I would create a category Named "Chapters" with a sub category for each chapter. These sub categories would show the posts for each chapter naturally using built in functionality.

    Hope this explains a little....

  7. andrewb123
    Member
    Posted 3 years ago #

    Right. It is natural that posts be organized by category. I'm not disputing that. But I do think that using "pages" only for static content is a little limited. For example, I might want to make my contact information easier to find by putting it on a separate page. Ok, no problem. I can do this. On the same token, I might want to put all of the posts from a particular event that I might be blogging about on a separate "event page" as well. So why should I only be able to do the former and not the latter? Pages are there for organization of information. Posts contain information.

    Yes, I have something like this somewhere... I'll have to dig through old files to find it... might be a few days though.

    Thanks a lot. I appreciate it.

  8. andrewb123
    Member
    Posted 3 years ago #

    Hey. Have you found that code yet?

  9. andrewb123
    Member
    Posted 3 years ago #

    mfields, where are you?

Topic Closed

This topic has been closed to new replies.

About this Topic