2015年4月25日 星期六

Jetpack: take away a submit from the Prime Posts Widget

Should you use the Jetpack plugin, you are in all probability acquainted with the Stats module. As soon as you’ve got activated the module, you can too use the Prime Posts widget to show an inventory of the preferred posts in your website.

However what if there’s one submit that you simply by no means need to show there, even when it is a widespread one? You possibly can exclude particular posts from the widget because of the jetpack_widget_get_top_posts filter.

To take action, paste the next code right into a functionality plugin:

perform jeherve_remove_post_top_posts( $posts, $post_ids, $rely ) 
        foreach ( $posts as $okay => $publish ) 
                // Exchange 1215 by the ID of the Submit you need to take away
                if ( '1215' == $publish['post_id'] ) 
                        unset( $posts[$k] );
                
        
        return $posts;

add_filter( 'jetpack_widget_get_top_posts', 'jeherve_remove_post_top_posts', 10, three );

The post Jetpack: take away a submit from the Prime Posts Widget appeared first on DICKLEUNG DESIGN 2014.

沒有留言: