Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #850622

    Hallo,

    ich habe eine Frage zum “Einträge-Slider”.
    Ich habe mehrere Beiträge in der Kategorie “X”. Jeder dieser Beiträge hat einen “Einträge-Slider”, der alle Beiträge aus der Kategorie “X” listet.
    Leider wird auch der gerade “aktive” Beitrag gelistet – wie kann ich es einstellen, dass der gerade “aktive” Beitrag nicht im Slider ausgegeben wird?

    Vielen Dank,
    Neverlands

    #850682

    Sorry, totally forgot to write in English.. You can delete the one above.

    I have a question concerning the “Post Slider”.
    I have several posts wihtin the category “X”. Each of those posts has a “Post Slider” that shows all posts from category “X”.
    Unfortunatley the “active” post is also shown in the slider – what can I do that only the other posts of the category are shown but not the active one?

    Many thanks,
    Neverlands

    #850895

    Hi Neverlands,

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

    Best regards,
    Victoria

    #850989

    H Victoria,

    thanks for your reply!
    You find the admin access in the private data.

    Best regards,
    Neverlands

    #851087

    Hi Neverlands,

    Here is the code you can put in your funtions.php

    
    add_filter('avia_post_slide_query', 'avf_custom_post_grid_query');
    
    function avf_custom_post_grid_query ( $query ) {
      if(is_singular('post')) {
          global $post;
    
          $query['post__not_in'] = array($post->id);
      }
      return $query;
    }
    

    If you need further assistance please let us know.

    Best regards,
    Victoria

    #851122

    Hi Victoria,

    thanks for the code!
    Unfortunately it did not change anything.
    More details in the private data..

    Best regards,
    Neverlands

    #851832

    Hi,

    We modified the code a bit. Please remove browser cache or hard refresh before checking the page.

    Best regards,
    Ismael

    #852005

    Hi Isamel,

    many thanks – it works perfectly now!

    Is this the code I have found in the functions.php of the child theme?:

    /* Einträge Slider aktiven Beitrag ausblenden */
    add_filter('avia_post_slide_query', 'avf_custom_post_grid_query');
    
    function avf_custom_post_grid_query ( $query ) {
      if(is_singular('post')) {
          global $post;
    
          $query['post__not_in'] = array($post->ID);
      }
      return $query;
    }

    Do I have to take care about something with the next Enfold theme update?

    Best regards,
    Neverlands

    #852400

    Hey!

    Yes, that is the filter. You don’t need to do anything because it’s in the child theme folder.

    Thank you for using Enfold.

    Cheers!
    Ismael

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