Viewing 16 posts - 1 through 16 (of 16 total)
  • Author
    Posts
  • #1417153

    Hi Support,

    This is one of the posts of custom post type and when you scroll down to related posts section you can find this posts there and I want to show other posts of this category excluding this but not able to get this done.
    Need you support to solve this.
    I have enfold 5.2.1 installed but child theme is activated.

    #1417300

    Hi Support,

    Still not received any feedback regarding this from you end.

    #1417378

    Hi Support,

    Still no response.

    #1417687

    Hi Support,

    Still not received any feedback regarding this from the support team.

    #1417840

    Hi Support,

    Is thee anyone to look into and solve my issue??

    #1417857

    Try this snippet in your child-theme functions.php:

    function ava_exclude_current_post($query) {
      if (is_singular('post') || is_singular('portfolio') ) {  
        $exclude = avia_get_the_ID();
        $query->set( 'post__not_in', array($exclude) );
      }
    }
    add_action('pre_get_posts', 'ava_exclude_current_post');
    // in the if-clause you can use aswell  :   if(is_single()){
     
    #1417876

    Hi,
    Thank you Guenni007 this looks like it solved NicomIT issue since the “MORE ESCORTED TOURS” section doesn’t include the same post.

    Best regards,
    Mike

    #1417887

    i guess not – maybe the custom-post type had to be first included to ALB support:

    Replace the “event” with the name of your CPT:

    function avf_alb_supported_post_types_mod( array $supported_post_types ) {
      $supported_post_types[] = 'event';
      return $supported_post_types;
    }
    add_filter('avf_alb_supported_post_types', 'avf_alb_supported_post_types_mod', 10, 1);
    
    function avf_metabox_layout_post_types_mod( array $supported_post_types ) {
      $supported_post_types[] = 'event';
      return $supported_post_types;
    }
    add_filter('avf_metabox_layout_post_types', 'avf_metabox_layout_post_types_mod', 10, 1);
    
    #1417894

    Hi,
    Why, did you see the same item in the “MORE ESCORTED TOURS” section? I didn’t

    Best regards,
    Mike

    #1417928

    no – but if you go further to f.e. “Rail across Canada” that Post is still on the slider.
    So try to include your CPT ( guess it is: escorted-vacations) to the alb handling

    #1417957

    Hi,
    Good point, he did say it was a CPT.

    Best regards,
    Mike

    #1418000

    or Mike …. maybe it is first needed to include the CPT to search – as you have done it here: https://kriesi.at/support/topic/seiten-aus-der-enfold-suche-ausschliesen/#post-1396760

    #1418008

    Hi,

    Thanks Mike & Guenni007, for the help and support, it helped me a lot to solve the issue.

    Please check my other issue that I have created long time but no body responded yet.

    #1418016

    Hi Mike & Guenni007,

    journey_start_date & journey_end_date are the two custom post meta filelds that we have created for CPT escorted-vacations and we want to sort in ascending order with orderby journey_start_date, can you please help me regading this.

    #1418022

    Thanks Mike & Guenni007, for the help and support, it helped me a lot to solve the issue.

    would you please share your working solution …

    #1418241
Viewing 16 posts - 1 through 16 (of 16 total)
  • The topic ‘How to exclude current posts from related posts grid’ is closed to new replies.