A
A
awerka742018-08-25 11:24:47
WordPress
awerka74, 2018-08-25 11:24:47

How to hide an entry on a category page?

Hello! How can I hide an entry in category.php but make that entry available via a link?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dvakarandasha, 2018-08-25
@awerka74

2 ways:
1) in function.php write:
function exc_post($query) {
if ($query->is_category || ($query->is_home || ($query->is_feed)))
{$query->set ('post__not_in', array(888, 999) );} // 888,999 is the post id.
return $query; }
add_filter('pre_get_posts','exc_post');
2) WP Hide Post Plugin

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question