Title: Exclude pinned posts
Last modified: November 30, 2023

---

# Exclude pinned posts

 *  [marekduse](https://wordpress.org/support/users/marekduse/)
 * (@marekduse)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/exclude-pinned-posts/)
 * Hello, how can I exclude pinned posts?

Viewing 1 replies (of 1 total)

 *  Thread Starter [marekduse](https://wordpress.org/support/users/marekduse/)
 * (@marekduse)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/exclude-pinned-posts/#post-17242968)
 * OK i found it:
 * In hook.php find line 278-297 and replace to this code:
 *     ```wp-block-code
       if($sort_by == "Comments")
       		{
       			$args = array(
       					'post_type' 	=> $select_posttype,
       					'posts_per_page'=>	$no_posts,
       					'orderby'		=>	'comment_count',
       					'order'			=>  'DESC',
       					'ignore_sticky_posts' => 1,
       			);
       		}
       		else
       		{
       			$args = array(
       					'post_type' 	=> $select_posttype,
       					'posts_per_page'=>	$no_posts,
       					'meta_key'		=>  'wli_pp_post_views_count',
       					'orderby'		=>	'meta_value_num',
       					'ignore_sticky_posts' => 1,
       			);
       		}
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Exclude pinned posts’ is closed to new replies.

 * ![](https://ps.w.org/popular-posts-by-webline/assets/icon-128x128.jpg?rev=1041723)
 * [Popular Posts by Webline](https://wordpress.org/plugins/popular-posts-by-webline/)
 * [Support Threads](https://wordpress.org/support/plugin/popular-posts-by-webline/)
 * [Active Topics](https://wordpress.org/support/plugin/popular-posts-by-webline/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/popular-posts-by-webline/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/popular-posts-by-webline/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [marekduse](https://wordpress.org/support/users/marekduse/)
 * Last activity: [2 years, 6 months ago](https://wordpress.org/support/topic/exclude-pinned-posts/#post-17242968)
 * Status: not resolved