Support » Plugin: WP Show Posts » Can I display the list title at the top of the list?

  • Let’s say I have a WP Show Posts list called “Upcoming Events.” It pulls from the category “upcoming events.” I make a shortcode block on a page, and insert the shortcode for this list. The selected posts appear in this block. Is there a way to have the title, Upcoming Events, appear at the top of the list of posts, without adding it to the layout? (I’m using the free version but could upgrade.)

Viewing 1 replies (of 1 total)
  • Plugin Support Elvin

    (@ejcabquina)

    Hi there,

    Unfortunately, there’s no feature within the UI that displays the indicated list name on the WPSP list.

    You’ll have to add a PHP snippet to add it in.

    That said, try this:

    add_action( 'wpsp_inside_wrapper', function( $settings ) {
        // Lists we're targeting, replace with actual list IDs.
        $lists = array(
            '4447'
        );
    
        if ( in_array( $settings['list_id'], $lists ) ) {
            echo '<div class="wpsp-list-title">' . get_the_title( $settings['list_id'] ) . '</div>';
        }
    } );

    You then style it with CSS:

    .wpsp-list-title{
    /* your style here */
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Can I display the list title at the top of the list?’ is closed to new replies.