Forums

[Plugin: Wordpress Popular Posts] Omitting certain posts and manual update (7 posts)

  1. jimjamming
    Member
    Posted 6 months ago #

    HI,
    2 quick questions.

    1. Is it possible to omit certain posts from being registered by WP Popular Posts?

    2. I need to update the plugin manually. Will i loose the accumulated data on the posts popularity?

    thanks a lot!

  2. Ikki24
    Member
    Posted 6 months ago #

    Hi jimjamming,

    1. You'd need to hack my plugin to do that, but yes it is possible. For pages that WPP has not registered yet:

    # Find the function update_mostpopular (line 284 on wordpress-popular-posts.php)

    # Below "$postid = $wp_query->post->ID; // get post ID" (line 289), add this code:

    $exclude = array(1,2,3); // the id's of the posts you wish to exclude (separated by comma)
    if (in_array($postid, $exclude)) return $content;

    For pages that WPP has already registered, but that you want to exclude from the listing:

    # Find "$mostpopular = $wpdb->get_results" (line 162)

    # Right after $nopages, add " AND $wpdb->posts.ID NOT IN(1,2,3) " (without quotes).

    2. No, you won't lose any data so don't worry.

  3. onedeep
    Member
    Posted 6 months ago #

    Along the same lines as question 1, is there a way to have this ignore certain post categories?

  4. Ikki24
    Member
    Posted 6 months ago #

    That'd require a more complex sql query, onedeep. I'll try a few different ideas and get back to you once I get a solution that won't require an extensive use of the database.

  5. jimjamming
    Member
    Posted 5 months ago #

    Thanks for the replies. Much appreciated.

  6. taeke
    Member
    Posted 5 months ago #

    Hi Ikki24,

    any news on excluding categories? I could really use this possibility

    Thanks!

  7. smcgilvray
    Member
    Posted 2 weeks ago #

    Hi Ikki24 and taeke,

    any news on excluding categories? I could really use this possibility

    Thanks!

Reply

You must log in to post.

About this Topic