Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi there,

    Depends on how you are implementing related posts, but you will want to have a look at https://codex.www.ads-software.com/Function_Reference/is_user_logged_in to get an idea of how to approach the conditional you desire.

    Thread Starter daniish

    (@daniish)

    I am using Related Posts Slider, which can be manually inserted into the template single.php with:

    <?php if(function_exists('get_related_posts_slider')) {get_related_posts_slider();} ?>

    and as Schulte suggested, the user logged in call is:

    <?php
    if ( is_user_logged_in() ) {
    
    } else {
    
    }
    ?>

    So can anyone tell me what i need to do?

    Just circling back — have you tried this?

    <?php
    if ( is_user_logged_in() )
      if(function_exists('get_related_posts_slider')) {get_related_posts_slider();}
    ?>
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘related posts only for logged users’ is closed to new replies.