• Resolved WPAlex

    (@alber)


    Hi.

    I need to get current category ID when using this plugin:
    http://ww.wp.xz.cn/extend/plugins/featured-posts-scroll/installation/

    This code:
    <?php if (function_exists('fps_show')) {
    $args = array(
    'cat' => '',/* comma separated list of category ids to include (put '-' in front of ids to exclude) */
    'tag' => '' /* comma separated list tag slugs to include */);
    echo fps_show($args);
    }?>

    shows only posts from specific categories defined by their IDs.

    But I need this code for category.php that will display slider with posts ONLY from current category.
    So please help me with this bit of code:
    'cat' => '',/* comma separated list of category ids to include (put '-' in front of ids to exclude) */

    Thanks.

Viewing 1 replies (of 1 total)
  • Thread Starter WPAlex

    (@alber)

    Here is the code for this:

    <?php function get_current_cat_id(){
     if(is_category())
     $cat_ID = get_query_var( 'cat' );
     return $cat_ID;
     }
     $k=get_current_cat_id();
     $args = array('cat' => $k);
     echo fps_show($args); ?>

Viewing 1 replies (of 1 total)

The topic ‘[Plugin: Featured Posts Scroll] Current category ID for slider plugin’ is closed to new replies.