Hi there!
Yes, that should work. Please post the full code here so I can check it out.
Thread Starter
jonsby
(@jonsby)
`<?php
foreach((get_the_category()) as $category) {
$myCats .= $category->cat_ID . ‘, ‘;
}
?>
<?php
if (function_exists(‘wpp_get_mostpopular’))
wpp_get_mostpopular( ‘range=”all” limit=3 thumbnail_width=215&thumbnail_height=100 stats_views=0 cat=”‘ . $myCats . ‘” post_type=”post,blogg’ );
?>
Is that code inside the loop? If the answer is no, then you need to pass the post / page ID to the get_the_category() function for it to work. Try the following:
<?php
global $post;
$categories = get_the_category($post->ID);
foreach($categories as $category) {
$myCats .= $category->cat_ID . ', ';
}
// remove trailing comma
$myCats = rtrim($myCats, ', ');
?>
<?php
// You had a few errors in here, I fixed them for you
if (function_exists('wpp_get_mostpopular'))
wpp_get_mostpopular( 'range="all"&limit=3&thumbnail_width=215&thumbnail_height=100&stats_views=0&cat="' . $myCats . '"&post_type="post,blogg' );
?>
Thread Starter
jonsby
(@jonsby)
Works great!
Thanks for the help and for providing such excellent support.
I donated a few bucks from the plugin page. Should be enough for a beer or two 🙂
Don’t mention it. And thank you for the nice gesture! 🙂