Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic ??

    You can use the jetpack_widget_get_top_posts filter to remove specific posts from the Top Posts widget.

    The filter can be found here, and you can find an example use of it here.

    I hope this helps.

    Thread Starter telatabi

    (@okulsayfam)

    i dont know enough english. i would like remove my register page from homepage.
    i found “jetpack/modules/widgets/top-posts.php” file, what changes could i do?

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic ??

    Isn’t there a risk that the changes will be overwritten with future Jetpack updates? Would it not be better to be able to specify excluded pages within the widget admin area, and have the post/page IDs saved in the database?

    Edit: Sorry Jeremy, I should have read your tutorial before posting. It’s a nice solution, but possibly a bit complex for people who don’t want to make plugins or edit their functions.php file. I’d still prefer it if the exclusions could be added directly into the widget settings.

    Thread Starter telatabi

    (@okulsayfam)

    Thank a lot @jeremy Herve, the solution worked for me.
    i would like removing two post on “Popular Posts & Pages” list. How can i do?
    it may be?(it didnt worked) :

    function jeherve_remove_post_top_posts( $posts, $post_ids, $count ) {
    foreach ( $posts as $k => $post ) {
    // Replace 2500 by the ID of the Post you want to remove
    if ( ‘2500’ ‘531’== $post[‘post_id’] ) {
    unset( $posts[$k] );
    }
    }
    return $posts;
    }
    add_filter( ‘jetpack_widget_get_top_posts’, ‘jeherve_remove_post_top_posts’, 10, 3 );

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic ??

    I’d still prefer it if the exclusions could be added directly into the widget settings.

    @gorky5 That’s in the works. We plan on adding more settings to the widget in Jetpack 3.6, allowing you to exclude some Post Types from the widget.

    i would like removing two post on “Popular Posts & Pages” list. How can i do?

    Something like this would work:

    if ( '2500' == $post['post_id'] || '531'== $post['post_id'] ) {

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘i dont like some pages&posts in "Popular Posts & Pages" list.’ is closed to new replies.