• Resolved barrenas

    (@barrenas)


    Hi great pluging

    Could be great have the option to “exclude current” in post and pages blocks like grid or masonery.

    Other suggestion is have the option to select pages or page one t one or by ID.

    Thank u

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support Team Brainstorm Force

    (@brainstormteam)

    Hey @barrenas ,

    You can do this using the filter hook.
    You can add the below-given code to your functions.php file.

    add_filter( 'uagb_post_query_args_grid', function( $args ){
    	$args['post__not_in'] = array( 123, 456 );
    	// Add IDs of the posts with comma separation, you want to skip in place of 123, 456.
    	return $args;
    } );

    I hope this helps.
    Also, here is a link to document regarding some more such filters and actions – https://www.ultimategutenberg.com/docs/filters-actions-for-post/

    Regards,
    Vrunda Kansara

    Thread Starter barrenas

    (@barrenas)

    Hi

    At first thanks for ur quick answer

    But i have a problem, i use the grid to show related posts with a nice style in many posts.
    For this reason i need a funtion that exclude current post for each grid, not in general for specifics ids.

    Thanks again

    Plugin Support Team Brainstorm Force

    (@brainstormteam)

    Hey,

    You have to modify the code a little to achieve what you want. Try the below code

    add_filter( 'uagb_post_query_args_grid', function( $args ){
    	$args['post__not_in'] = get_the_ID();
    	return $args;
    } );

    I hope that helps.

    Regards,
    Vrunda Kansara

    Thread Starter barrenas

    (@barrenas)

    Hi again
    I have tryed this lines with my code snippet, but it doesnt works correctly.

    it makes that post grid desappear.

    Thanks again

    Plugin Support Team Brainstorm Force

    (@brainstormteam)

    Hey @barrenas ,

    You can reach us out here for quicker response – https://ultimategutenberg.com/support

    Regards,
    Vrunda Kansara

    Thread Starter barrenas

    (@barrenas)

    Hi again:

    I have wrote to suport for two times with no answer

    Anyway, i have solved, if any have the same problem the code is:

    add_filter( 'uagb_post_query_args_grid', function( $args ){
    	$args['post__not_in'] = array( get_the_ID() );
    	return $args;
    } );

    Like suggestion could be a great idea for future release include a tab in back end to do it.

    See u

    Plugin Support Team Brainstorm Force

    (@brainstormteam)

    Hey @barrenas ,

    I am glad you found the solution. That does not happen ideally with us. We make sure we answer every request. Sometimes the wrong email ID or some other such problem might create such glitches.

    Nevertheless, you can always get back to us if you have any other issues.

    Regards,
    Vrunda Kansara

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘New option on post block’ is closed to new replies.