Tagged: 

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #1264564

    Hi,
    I am trying exclude a category in masonry portfolio but i don’t know how i can do it.
    Could you help me, please?
    Thanks.

    #1264847

    Hey Lidia,

    Please have a look at the following thread:
    https://kriesi.at/support/topic/exclude-category-or-tag-from-masonry-pullavoid-duplicate-posts-on-frontpage/#post-351738

    If you need further assistance please let us know.

    Best regards,
    Victoria

    #1264850

    Hi Victoria
    Yes i saw it, but i only want to exclude in a block. Not in all portfolios.
    I want exclude it only in homepage.
    Could you tell me how i have to add the code in funtions.php?
    Thanks.

    #1265292

    Hi aquihaydominios,

    Can you give us temporary admin access to your website in the private content box below, so that we can have a closer look?

    Which category do you need to exclude?

    Best regards,
    Victoria

    #1265435
    This reply has been marked as private.
    #1265573

    Hi aquihaydominios,

    Which category do you need to exclude?

    Best regards,
    Victoria

    #1265574

    Hi,
    I want exclude category “Reservado” but only in home page. In antother pages, i want to see that category.
    Thanks

    #1265613

    Hi aquihaydominios,

    The website did not load on my end. Please check the link.

    Best regards,
    Victoria

    #1265618

    I don’t understand… the web is working…

    #1265624

    Hi aquihaydominios,

    Maybe you have a plugin or the hosting provider is blocking requests from certain locations. I am from Ukraine :)

    Best regards,
    Victoria

    #1266070

    Yes, it is… Could you tell me your ip, please?

    #1266980

    Hi,

    The Appearance > Editor panel is not accessible, so we were not able to edit the functions.php file. Please try to replace the snippet with the following code.

    function avia_masonry_custom_query( $query ) {
    	if(is_page(38)) {
    		$exclude_cat = array('category__not_in' => '38');
    		$query = array_merge((array)$exclude_cat, (array)$query);
    	}
    
    	return $query;
    }
    add_filter('avia_masonry_entries_query', 'avia_masonry_custom_query');

    Or enable the file editor by setting the DISALLOW_FILE_EDIT to true so that we could adjust the snippet.

    // https://wordpress.org/support/article/hardening-wordpress/#disable-file-editing

    Best regards,
    Ismael

    #1268393
    This reply has been marked as private.
    #1268963

    Hi,

    Thank you for the info.

    We adjusted the filter in the functions.php file a bit to remove the items that belong to the Reservados category.

    function avia_masonry_custom_query( $query ) {
    	if(is_page(38)) {
    		$query['tax_query'][] = array(
    			'taxonomy'  => 'portfolio_entries',
    			'field'     => 'id',
    			'terms'     => 38,
    			'operator'  => 'NOT IN'
    		);
    
    	}
    	return $query;
    }
    add_filter('avia_masonry_entries_query', 'avia_masonry_custom_query');

    Best regards,
    Ismael

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