• Resolved ma2t

    (@ma2t)


    Hey there,

    I’m using the great popularity contest plugin, and want it to show (in single) the popular posts from the same category.

    The plugin can show this on the category page, but I want it to show on the single page also.

    <?php akpc_most_popular_in_cat(5,'<li>','</li>','X'); ?>

    If I manually replace X with the category ID it works great.

    <?php the_category_ID(); ?> works to get the cat ID for me fine, but if I combine them to do it automatically as below, it doesn’t work.

    <?php akpc_most_popular_in_cat(5,'<li>','</li>','<?php the_category_ID(); ?>'); ?>

    Any ideas people? I have spent too many hours on this already.

    Any help would be much appreciated!
    Many thanks,
    Matt

    Note: I only post my posts into one category.

Viewing 4 replies - 1 through 4 (of 4 total)
  • I have exactly the same problem! I’m trying to find out what’s wrong.

    Edit: It seems that

    <?php akpc_most_popular_in_cat('7','<li>','</li>', the_category_ID()); ?>

    …does approximately work. HOWEVER, it prints the category ID in the HTML just before the list!

    How do you tell the plugin “display popular posts in the same category as the single post”?

    Any help welcome!

    Thread Starter ma2t

    (@ma2t)

    Well I’m very glad you were having the same problem as me!, I thought I would never fix it.

    Thanks for posting your modified code, with it I was able to get it working perfectly ??

    By using:

    <?php akpc_most_popular_in_cat('5','<li>','</li>', the_category_ID(FALSE)); ?>

    and adding FALSE, it renders it for PHP and stops the category ID showing.

    Many thanks kReEsTaL, I’m glad we could help each other!

    Wow, perfect! Thank you so much for solving this! :))

    I want to show only 5 most popular posts…how do i do that. by default it shows 10 most popular posts..

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: Popularity Contest] Show popular category posts on single’ is closed to new replies.