• Hi,

    I would like to change the store results listing of stores that are shown.
    Where can I change the info that is shown.

    I searched the filters, and found wpsl_listing_template.
    I used it in my functions.php and changed something, but it doesn’t seem to work.
    Even after cleaning transient cache it does not change.

    How can I change the results listing?

    Question 2:
    The more info button does the content of the store.
    But I would like to use the excerpt of the store (or a custom field).
    Is that possible?

    Regards,
    Jan

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Tijmen Smit

    (@tijmensmit)

    Which specific part would you like to change? Just include a custom value below the address details, or show it in the more info field?

    If it’s below the address, then you indeed have to use the wpsl_listing_template filter, if it’s inside the more info field, then you have to use this filter instead. If that’s what you did, then can you share the code you used. Also make sure no JS errors show in the browser console.

    How to include the post content data in the search results is described in this article.

    Thread Starter Jan Lucas

    (@jb_walton)

    Thanks Tijmen,

    You put me in the right direction.
    The wpsl_more_info_template is where I can change the results below the address.

    In there I see ‘description’, what gives me “the_content”.
    Instead of the content I would like to see “the_excerpt”.
    Is that possible through a filter or in any other way?

    Thanks,
    Jan

    Plugin Author Tijmen Smit

    (@tijmensmit)

    You can do this with the wpsl_store_meta filter. This filter allows you to add custom data to each location

    It’s untested, but this should work.

    
    add_filter( 'wpsl_store_meta', 'custom_store_meta', 10, 2 );
    
    function custom_store_meta( $store_meta, $store_id ) {
        
        $store_meta['excerpt'] = apply_filters( 'the_excerpt', get_post_field( 'post_excerpt', $store_id ) );
        
        return $store_meta;
    }
    

    Then access the excerpt under ‘excerpt’ in the template.

    Thread Starter Jan Lucas

    (@jb_walton)

    Hi Tijmen,

    Works perfect.
    Thanks.

    Jan

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Results listing / More info excerpt’ is closed to new replies.