Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

Excluding posts from related posts based on post status

$
0
0

Replies: 0

Guys,

I currently have a custom post status “archive” that is public but I don´t want to appear in related posts.

There I want to know if it is possible to exclude posts from the related posts functionality based on the post status. I have tried this:

function jetpackme_filter_exclude_status( $filters ) {
$filters[] = array( ‘not’ =>
array( ‘post_status’ => ‘archive’ )
);
return $filters;
}
add_filter( ‘jetpack_relatedposts_filter_filters’, ‘jetpackme_filter_exclude_status’ );

But to no avail, any help would be appreciated

pete


Viewing all articles
Browse latest Browse all 59525

Trending Articles