Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #634834

    Hope all is well!

    Is it possible to prevent posts of a certain type or category from being included in the side post navigation? I want to prevent any “link” posts from displaying in that edge post navigation. (I’m using link posts to allow some pages to collect and appear in post sliders / grids…and when they appear in the edge post navigation they don’t actually link to the pages, they go to the link post instead.)

    Please advise. Thanks!

    #635660

    Hey smittypages,

    Thank you for using Enfold.

    Hide the link format posts with this:

    .newsbox .post-format-link {
        display: none !important;
    }

    Best regards,
    Ismael

    #635978

    Thanks for being in touch – I’m trying it, but its not preventing the link format posts from displaying in the side .avia-post-nav. Any other ideas?

    #636859

    Hi,

    not sure what you want to achieve. I can’t find any issues on your site. Can you explain further please? and please add some screenshots to make things clear for us. Use imgur.com or dropbox.

    Best regards,
    Andy

    #636965

    Andy – thanks for checking in on this. All I’m hoping to do is prevent posts of a specific category “case studies” or posts of a certain format “Link” from appearing in the avia-post-nav that appears on the left/right edges when viewing individual posts. (We use “Link” post formats to create post slider and grid links that lead to pages instead of posts, but don’t want these “Link” posts of the “case studies” category to be included in the edge avia-post-nav.) I will share a DropBox link in private message. Thanks!

    #638432

    Hi,

    I see. I didn’t understand you at first because I thought that you’re referring to the news widget when you said “side post navigation”. Please add this in the functions.php file:

    add_filter('avia_post_nav_entries', 'avia_post_nav_entries_mod', 10, 2);
    function avia_post_nav_entries_mod($entries, $settings) {
    	$settings['excluded_terms'] = 5;
    
    	if(version_compare($settings['wpversion'], '3.8', '>=' ))
    	{
    		$entries['prev'] = get_previous_post($settings['same_category'], $settings['excluded_terms'], $settings['taxonomy']);
    		$entries['next'] = get_next_post($settings['same_category'], $settings['excluded_terms'], $settings['taxonomy']);
    	}
    	else
    	{
    		$entries['prev'] = get_previous_post($settings['same_category']);
    		$entries['next'] = get_next_post($settings['same_category']);
    	}
    
        return $entries;
    }

    After that, edit the posts with link format then add a unique category to them. Replace the value of the $settings[‘excluded_terms’] variable with the id of the new category.

    Best regards,
    Ismael

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.