• charlotte

    (@charlotte23)


    Hi there, I bought the search widget and it’s super thank you.

    However I want to highlight the first store in the locator page list by adding the content(description) to the first entry. (I was going to use css to only show the extra content for the nearest store).

    So I have tried adding this to my functions.php to pull in the content which would be fine:

    [php]add_filter( ‘wpsl_include_post_content’, ‘__return_true’ );[/php]

    and I tried adding this in functions too within the other listing_template code which I already edited to add in the email link – which works.

    $listing_template .= “\t\t” . ‘<% if ( description ) { %>’ . “\r\n”;
    $listing_template .= “\t\t” . ‘<%= description %>’ . “\r\n”;
    $listing_template .= “\t\t” . ‘<% } %>’ . “\r\n”;

    only neither of those do anything ??

    Also, I want to add a link to the listing which says “click here for more information” which goes to the main store locator page which has some extra info.

    Can you help me achieve these things?
    Thank you so much.

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

    (@tijmensmit)

    Can you try to flush the WPSL transient cache on the WPSL settings page -> Tools section.

    This code will add the click here for more information and link to the single store page.

        
    $listing_template .= "\t\t\t" . '<% if ( permalink ) { %>' . "\r\n";
    $listing_template .= "\t\t\t" . '<p><a href="<%= permalink %>">click here for more information</a></p>' . "\r\n";
    $listing_template .= "\t\t\t" . '<% } %>' . "\r\n";
    

    What’s the URL?

    Thread Starter charlotte

    (@charlotte23)

    Thank you so much for your help.

    That’s all working for me now I added in in my functions.php

    [php]
    `
    add_filter( ‘wpsl_include_post_content’, ‘__return_true’ );

    
    [/php]
    and added this on the listing template stuff I already had in my functions.php
    [php]
       

    $listing_template .= “\t\t\t” . ‘</p>’ . “\r\n”;
    $listing_template .= “\t\t\t” . ‘<% if ( permalink ) { %>’ . “\r\n”;
    $listing_template .= “\t\t\t” . ‘<p><a href=”<%= permalink %>”>click here for more information</a></p>’ . “\r\n”;
    $listing_template .= “\t\t\t” . ‘<% } %>’ . “\r\n”;
    $listing_template .= “\t\t” . ‘<% if ( description ) { %>’ . “\r\n”;
    $listing_template .= “\t\t” . ‘<div class=”contentwpsl”><%= description %></div>’ . “\r\n”;`
    [/php]

    and then I used li.first:child selector to show .contentwpsl on the first result I think I’m grand now. I’m not entirely sure why it didn’t work before…

    Thanks for being so helpful.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Changing the listing template to include content / excerpt and a read more link.’ is closed to new replies.