WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Showing all posts, not just those within categories

[Resolved] Showing all posts, not just those within categories

  • I just installed this plugin… I’ve entered the code to pull up posts within a certain category, but it is instead showing all posts from all categories.

    Here is one example of the code I am using:

    [tpg_get_posts show_meta="false" category_name="swelling-and-water-retention" numberposts=all show_excerpt="true" show_byline="false" show_meta="false"]

    I tried changing “all” to a number, but that doesn’t effect the result.

    Here is a link to the page as it is currently showing:
    http://happymamahealthybaby.com/remedies/swelling-and-water-retention/

    The only post that falls within the specified category on that page is the first one. The rest should not be shown.

    Oh, and I’m using the 2012 theme, if that makes a difference.

    I’m kind of a newbie, so responses spoken slowly and loudly would be greatly appreciated. Thanks in advance for any help!

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

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author cswaim

    @cswaim

    Generally, when the plugin behaves like this it is because the parms are not valid – ie misspelling, invalid, ….

    On your shortcode, numberposts is numeric and the show_meta is listed twice. But recheck your category names, usually this is the problem. Show the meta line so you can see how each post is categorized and can verify the spelling.

    I would suggest removing all the parms except the category and then add them one by one to figure out which is causing the problem.

    With the latest release, I tried to simplify the parms so your final shortcode could look like this:

    [tpg_get_posts fields=”title,content” show_excerpt=”true” cat=”swelling-and-water-retention” numberposts=99]

    Thanks for getting back to me cswaim… I took out everything extra and shortened my code to this:
    [tpg_get_posts category_name="Swelling-and-Water-Retention"]

    Still showing everything. I also double checked the spelling from the meta and it looks right to me.

    Here’s how the page looks now:

    Swelling and Water Retention

    Plugin Author cswaim

    @cswaim

    I believe your cat name slug is swelling-and-water-retention. Caps are important! I think the wp query uses the slug and not the description.

    Sorry, I noticed that and edited on my site, but not in time to edit in my last post… It’s now correct on the site (typed and then even copy and pasted from the slug to be extra double sure it’s correct) and it’s still not working. I am 100% certain the problem is not in the category description on my end.

    As an update, I tried deactivating this plugin and installing a similar one… Still having the same issues, so now I’m really confused. It looks like there’s something going on with my category tags in general that’s causing the issue. I really like this plugin, so I’m hoping I can find a way to resolve this issue. Any ideas?

    Found a workaround for now… I installed Redirection plugin and am just redirecting pages to category archives since those are still working. I’d still rather use this plugin, but until I can find our what’s going on with the categories issue, redirecting seems to be my only workable option.

    Plugin Author cswaim

    @cswaim

    I misspoke in my earlier post….The category_name (or cat) uses the category name not the slug. So if your category name is Swelling and Water Retention then use cat=”Swelling and Water Retention”

    Be sure the post is assigned to the category. It looks like your post title is the same as the category, which is not a problem, but the post does have to be assigned to the category. I hope that clears up the problem.

    Yay! That works! Thanks for your help… I really appreciate your responsiveness.

    Just for the benefit of anyone else having a similar issue, here’s the code that did the job:
    [tpg_get_posts show_meta="false" category_name="Swelling and Water Retention" numberposts=99 show_excerpt="true" show_byline="false"]

    I’m also having issues with not being able to get rid of the comments box on the pages using your plugin, but I know there are other threads about that problem, so I’ll see what I can figure out based on what others have said.

    Thanks again for all of your help!

    Fixed the comment issue too… Just copied page.php into my child theme and removed this line altogether:
    <?php comments_template( '', true ); ?>

    Comments are now turned off on all static pages, including those using TPG Get Posts.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Resolved] Showing all posts, not just those within categories’ is closed to new replies.