• Resolved rinchent

    (@rinchent)


    I want to make a different color which represents each category via CSS. To do this, I need to be able to get the category ID and add make that a class name.

    I’ve highlighted in the post_html where I want the category ID to be.

    <?php
    if ( function_exists('wpp_get_mostpopular') ) {
        
        $args = array(
            'excerpt_length' => 200, 
            'title_length'=> 36,
            'post_type' => 'post',
            'limit' => 6,  
            'post_html' => '<div class="most-popular-box cat-[CATEGORY ID HERE]"><div class="wpp-excerpt"><div class="popular-box-thumbnail">{thumb}</div><p class="popular-box-title">{title}</p><a href={url}><p class="popular-box-summary">{summary}</p></a></div><footer>{category}</footer></div>',
            'range' => 'all',
            'stats_category' => 1,
    	'thumbnail_width' => 300,
       	'thumbnail_height' => 60,
        'stats_category' => 1
        );
        wpp_get_mostpopular( $args );
    }
    ?>

    Is this possible to do?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Hector Cabrera

    (@hcabrera)

    Hi there!

    As a rule of thumb: if there isn’t a Content Tag for what you’re trying to do, then chances are you’ll need to use WPP’s filter hooks to accomplish that.

    If you need some help with it, let me know and I’ll be glad to lend a hand.

    Thread Starter rinchent

    (@rinchent)

    Hi,

    It’s unfortunately not in the content tag.

    I’ve just had a look at WPP filter hooks. I understood that I can make my own function in order to do what I want it to do. However, do you know if I am just able to edit the wpp_get_mostpopular() function?

    Thread Starter rinchent

    (@rinchent)

    I’ve figured it out myself how to use the filter hooks. Cheers for the link!

    Plugin Author Hector Cabrera

    (@hcabrera)

    I’m glad you got it working ?? Good job!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Can you get a posts category ID?’ is closed to new replies.