Black Friday sale! Get 25% off WPSP Pro! Discount automatically applied at checkout.

[Support request] Create an auto slider with WP Show Posts?

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support Create an auto slider with WP Show Posts?

  • This topic has 3 replies, 2 voices, and was last updated 1 week ago by elvin.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #22830
    Lawrence
    Participant

    I’m curious if anyone has made a home page auto slider with WP Show Posts? I would LOVE if I could do this! I’ve got as far as having the carousel showing only 1 slide at a time but I’m not sure about getting the auto-sliding happening and the CSS to layout the card more to what I would like.

    Also, could we have the excerpt show by default so I could have Title/Exceprt as an H1/H2 combo?

    Thanks in advance,

    Lawrence

    #22832
    elvin
    Participant

    Hi,

    You can actually make the slider autoplay by adding this PHP snippet:

    add_filter( 'wpsp_carousel_args', function( $args ) {
        $args['autoplay'] = true;
    
        return $args;
    } );

    Here’s how to add PHP – https://docs.generatepress.com/article/adding-php/

    To add: you can even adjust the speed. Check the replies here on how to do it: https://wpshowposts.com/support/topic/carousel-animation/#post-20319

    Also, could we have the excerpt show by default so I could have Title/Exceprt as an H1/H2 combo?

    I’m not exactly sure I understand what you mean. WPSP generates an excerpt from the post with a defined number of words if no manual excerpt is added.

    As for changing the Title’s markup, you can change its element under WPSP list’s Setting > Content.

    As for excerpt, you’ll have to set the display content type setting to “None” and write your own markup hooked to WPSP filters like wpsp_before_content.
    Reference code: https://github.com/tomusborne/wp-show-posts/blob/35e410d7800273fc66f211c0f80d553e95d17f83/wp-show-posts.php#L467

    #22835
    Lawrence
    Participant

    Thanks elvin! This is going to give me a good start!

    Do you know if there is a way to make the featured image a background image (that I could set to cover the entire slider)?

    I’m not exactly sure I understand what you mean. WPSP generates an excerpt from the post with a defined number of words if no manual excerpt is added.

    What I mean with this is, I’d like to use the post title as a large title on the slider, then have the excerpt as the follow up text like you’d see on slider or hero banner. Then add in the “Read More!” button.

    Thanks again!

    #22867
    elvin
    Participant

    Do you know if there is a way to make the featured image a background image (that I could set to cover the entire slider)?

    Under Cards settings, I believe “Overlay” works similarly. Although, the image isn’t exactly added as a “background-image” css property.

    Here are some demos of Card settings available to WPSP Pro.
    https://demos.wpshowposts.com/cards/

    What I mean with this is, I’d like to use the post title as a large title on the slider, then have the excerpt as the follow up text like you’d see on slider or hero banner. Then add in the “Read More!” button.

    While there’s no easy way of changing the markup of the excerpt, you can still change its font size by adding custom CSS:

    Example:

    .wp-show-posts-entry-content * {
    font-size: 20px;
    }

    What this does is, it changes the font size of all(p,span, h1-h6 etc) excerpt content elements of the post.

    If you must specify, simply change * on the css selectors to match your markup.

    Example/s:
    .wp-show-posts-entry-content p for <p>
    .wp-show-posts-entry-content h3 for <h3>

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