WordPress.org

Ready to get started?Download WordPress

Forums

TPG Get Posts
[resolved] Preventing Sub-Category Posts from being displayed? (4 posts)

  1. PKimpton
    Member
    Posted 2 years ago #

    Preventing Sub-Category Slugs/Posts name from being displayed?
    I have my Posts category structure setup to match my Page Folder structure.
    For example, I have;
    Page Structure Layout of: Computers – Dell – Latitude
    I want to be able to have my post categories in the same structure layout with post category “Dell” under “Computers”, likewise, “Latitude” under “Dell” under “Computers”.
    The trouble is that any post I place in the slug/category “Latitude” also appear in the “computers” and “Dell” lists.
    How do I tell it to only display the category I choose and NOT the sub categories?
    [tpg_get_posts category_name="latitude"] show Latitude posts (this is ok)
    [tpg_get_posts category_name="dell"] shows dell & Latitude posts!!
    [tpg_get_posts category_name="computers"] shows computers, dell and latitude posts!!

    http://wordpress.org/extend/plugins/tpg-get-posts/

  2. cswaim
    Member
    Plugin Author

    Posted 2 years ago #

    I will set up a similar structure and see what is happening with this. At the moment, I have 2 projects with tight deadlines, so it may be a couple of weeks before I get this checked out.

    In the meantime, if you use the category, does it work? The category is the number associated with a category name. If you would try that and let me know the results, that would help me find the error.

    thanks

  3. PKimpton
    Member
    Posted 2 years ago #

    Thanks.
    For now, I've simply moved them out of a structure for the areas I dont want replicating but it would have been nice to keep the structure orderly. I was just hoping there would have been a command I could add to [tpg_get_posts category_name="computers"] maybe something like [tpg_get_posts category_name="computers" view_subcats="no"]

    All the best

  4. cswaim
    Member
    Plugin Author

    Posted 1 year ago #

    The selection to do this is a category__in=(nn,nn,nn). This parameter requires an array be passed to the wp query. I implemented this in the 2.0 premium version as it was more than a simple change. I hope if you still need this functionality, you will consider the upgrade.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic