Single news page with post slider - don’t show current post

info's Avatar

info

04 Mar, 2021 02:41 PM

Hi Dmitry,

I’ve added a post slider into a single news page. However it’s showing the current news post in the slide.

Is there a function for this plugin that removes this?

Thank you  for your help.

Jim

  1. Support Staff 1 Posted by Dmitry Semenov on 05 Mar, 2021 12:00 PM

    Dmitry Semenov's Avatar

    Hello,

    You may use filter http://help.dimsemenov.com/kb/wordpress-royalslider-advanced/wp-mod...

    function royalslider_exclude_current_post($args, $index) {
        $args['post__not_in'] = array(get_the_ID());
        return $args;
    }
    add_filter('new_royalslider_posts_slider_query_args', 'royalslider_exclude_current_post', 10, 2);
    

    (also note about the cache http://help.dimsemenov.com/kb/wordpress-royalslider-advanced/wp-mod... )

  2. 2 Posted by info on 05 Mar, 2021 04:08 PM

    info's Avatar

    AWESOME! thanks so much for your help.

    I've used your plugin for many years now .. :)

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac