WordPress.org

Ready to get started?Download WordPress

Forums

Featured Posts Grid
[resolved] Having trouble showing only one category (5 posts)

  1. Luk Gaming
    Member
    Posted 1 year ago #

    I tried using the code listed on the Plugin site to show only one category but it doesn't work for some reason and I'm still seeing the latest posts. I've tried everything, using the category id, the slug and the full name - none of it seems to work.

    The category is called 'Banner Posts', the slug is 'banner-posts' and the id is '1816'.

    Any help would be much appreciated.

    This it the code I tried to use:

    <?php if (function_exists('fpg_show')) {
                $args = array(
                    'cat'     => 'Banner Posts',/* comma separated list of category ids to include (put '-' in front of ids to exclude) */);
                echo fpg_show($args);
            }?>

    http://wordpress.org/extend/plugins/featured-posts-grid/

  2. chadhugo
    Member
    Posted 1 year ago #

    Hi,

    i have the same problem, it displays all categories. i've also tried to exclude all categories except the one i need, but it didnt work.

  3. Chaser324
    Member
    Plugin Author

    Posted 1 year ago #

    If you're using the cat parameter, you have to use the category ID, not the slug.

    If you want to filter on the slug, use the category_name parameter.

  4. chadhugo
    Member
    Posted 1 year ago #

    Thanks, it's working.

    Actually, i'm using a french version of wordpress, and "slug" is translated to "identifiant" (=id), so i thought that this category ID was this "identifiant"...

    thanks

    I dont think Luk Gaming has made the same mistake than me but just in case : to know the cat ID, go to your categories menu, put your mouse over the category you need, and in your adress bar you'll see "http://*****.com/wp-admin/edit-tags.php?action=edit&taxonomy=category&tag_ID=xx&post_type=post

    the cat ID is the "xx" (in tag_ID=xx)

  5. Luk Gaming
    Member
    Posted 1 year ago #

    Hi Chaser, that wasn't the issue for me, I used the Category ID and it still didn't work neither does category_name. What is the exact code needed?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic