Forums

How to Exclude Pages in Popularity Contest? (4 posts)

  1. Kejatz
    Member
    Posted 1 month ago #

    I'm using the latest popularity contest plugin. I want to display 10 most popular posts (pages excluded) in a normal text widget.

    I have no knowledge of PHP, but I found this code to b working but it does not exclude pages.

    <?php if (function_exists('akpc_most_popular')) { ?>
    <ul>
    <?php akpc_most_popular(); ?>
    </ul>
    <?php } ?>

    PS. I don't mind having popularity rating on pages I just don't want them displayed with most popular posts in my text widget.

    Thanks!

  2. MichaelH
    moderator
    Posted 1 month ago #

    You'd probably have to modify the get_top_rated_posts function in that plugin to ignore posts with a post_type of 'page'.

    Also to execute PHP in a Widget, consider downloading and installing Otto's PHP Code Widget.

  3. Kejatz
    Member
    Posted 1 month ago #

    Thanks for the answer but I have no idea how to do that.

    I already have a plugin that executes php in widget and I'm already using the above code in a text widget. I just need info on how to ignore posts with a post_type of 'page', like you said.

  4. jdingman
    Member
    Posted 3 weeks ago #

    Any update on this? I'm still trying to figure it out.

    Anyone know specifically how to exclude pages from Popularity Contest?

Reply

You must log in to post.

About this Topic