Hello,
Is there a way to disable Posts from showing anywhere on the site and only accessible by direct link?
Hey w3developing!
Please add following code to Functions.php file in Appearance > Editor
function avia_exc_post($query) {
if ($query->is_search) {
$query->set('cat','5,9');
}
return $query;
}
add_filter('pre_get_posts','avia_exc_post');
5 and 9 here are category ID’s. You can give additional category to your posts that you would like to exclude from search and replace the ID’s in the code.
Regards,
Yigit
Ok, thanks but this does not solve the problem. For example see the links in the private post.
I found this code for the accordion:
‘post__not_in’ => (!empty($no_duplicates)) ? $avia_config[‘posts_on_current_page’] : array(),
Is there a hook to replace this query or modify it to hide specific posts from the image accordion?
Hello?
Hi!
Try to use this:
function avf_accordion_entries_query_mod($query, $params) {
$query['category__not_in'] = array( 27, 18 );
return $query;
}
add_filter('avf_accordion_entries_query','avf_accordion_entries_query_mod');
Again, you can add a unique category to the posts that you want to exclude. Use the id of that category to replace 27 and 18 in the example above.
Best regards,
Ismael
Hi!
You can try using the “avf_magazine_filter” on line 255 in the /enfold/config-templatebuilder/avia-shortcodes/magazine.php file for that. Are you trying to exclude these posts from all queries?
Cheers!
Elliott
Can you give me an example of using the magazine filter?