• Resolved barceloch

    (@barceloch)


    I want to show a different slider in the author page, so, is there a way to filter /get slides by author/user with shortcodes?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author rochdesigns

    (@rochdesigns)

    Hi @barceloch if it’s image sliders, there’s no built-in function yet to filter by author. What you can do, if there’s just a few authors is:

    • Create slideshow for each author
    • update your theme’s author.php – the template for the Author Page and add the code like this:
    • 
      //8 as author id
      if( is_author('8'); ) {
          <?php echo do_shortcode('[metaslider id="123"]'); ?>
      }
      
      if( is_author('12'); ) {
          <?php echo do_shortcode('[metaslider id="456"]'); ?>
      }

    Hope this helps.

    • This reply was modified 2 years, 3 months ago by rochdesigns.
    Thread Starter barceloch

    (@barceloch)

    Thanks for your answers, in the end what I have done is add a custom field to the user to assign a slider, then in author.php

    
    $slider = get_user_meta( $author_id, 'user_slider', true );
    <?php echo do_shortcode('[metaslider id="'.$slider.'"]'); ?>
    Plugin Author Steve Burge

    (@stevejburge)

    Awesome, thanks for using MetaSlider, @barceloch

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘shortcode param filter and show slider by author’ is closed to new replies.