Support » Plugin: WP Store Locator » Description field not showing after updating

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

    (@tijmensmit)

    The content of the description field is moved to the main post content area after the update. So it’s still there, just in another field.

    If you want to show the content from the post content field under ‘More info’, then add this to the bottom of the functions.php file in your theme folder.

    add_filter( 'wpsl_include_post_content', '__return_true' );

    After doing that go to settings -> tools and click the ‘clear store locator cache’ button.

    janet4now

    (@janet4now)

    still awesome :)

    OK, that worked, thank you!

    Thanks, the above worked for me too, except when I changed where I wanted the “more info” detail to appear from the store list to the “info window on the map” (setting in the User Experience section of the Store Locator Settings).

    Is there a fix for this – it worked in version 1.8.

    I have the same problem as rjwyatt, no matter what I try I cannot get the post content to display in the “info window on the map”. It was working before I upgraded to the new version, and all of my stores still have their post descriptions but I just can’t get them to display.

    Plugin Author Tijmen Smit

    (@tijmensmit)

    Add this code to the functions.php, and if a description is available, it will show up.

    Thank you, Tijem, that seems to do it!

    Thank you Tijmen, I appreciate your help. Are you going to add this back into the default code or something? Won’t this change disappear once we upgrade the plugin?

    I am really not sure why this happened in the first place since you have a toggle to enable showing info, including the description field, in the map listing. Shouldn’t this be something changed in a plugin update?

    Also, I just realized that while the code fixes the missing descriptions in the store info window, it also made the store’s phone numbers and hours disappear. The phone numbers and hours were all I was getting in the info windows before I entered the new code, so I figure this must have something to do with that. What needs to be added to bring it back?

    I fiddled with the code that you posted to try and get some of my lost data back, and I don’t know what I’m doing so its pretty slapped together. Nevertheless, I got my phone, fax, and email back on to the info window in the map. I lost the bolded labels on those things though, which is annoying because I’m not sure how to add them back in. They are also ignoring my settings to allow the email link to be clickable.

    Here is what I added within the code that you posted.

    $info_window_template .= "\t\t" . '<p>' . "\r\n";
        $info_window_template .= "\t\t" . '<% if ( phone ) { %>' . "\r\n";
        $info_window_template .= "\t\t" . '<%= phone %>' . "\r\n";
        $info_window_template .= "\t\t" . '<% } %>' . "\r\n";
        $info_window_template .= "\t\t" . '</p>' . "\r\n";
    
        $info_window_template .= "\t\t" . '<p>' . "\r\n";
        $info_window_template .= "\t\t" . '<% if ( fax ) { %>' . "\r\n";
        $info_window_template .= "\t\t" . '<%= fax %>' . "\r\n";
        $info_window_template .= "\t\t" . '<% } %>' . "\r\n";
        $info_window_template .= "\t\t" . '</p>' . "\r\n";
    
        $info_window_template .= "\t\t" . '<p>' . "\r\n";
        $info_window_template .= "\t\t" . '<% if ( email ) { %>' . "\r\n";
        $info_window_template .= "\t\t" . '<%= email %>' . "\r\n";
        $info_window_template .= "\t\t" . '<% } %>' . "\r\n";
        $info_window_template .= "\t\t" . '</p>' . "\r\n";

    Plugin Author Tijmen Smit

    (@tijmensmit)

    This code will fix it.

    You can see another example of how to change the template code here, the “Make the Email Address and Phone Number Clickable” section will show you how to turn the email into a link again.

    Is this code and/or the opening hours code coming back in a future update?
    Would be very useful. 🙂

    This is broken again as of the last update, and your code examples are all 404 broken links. Would you please add these features back into the plugin? They disappear when we update our plugins due to their volatile location which really isn’t meant for user edits. Perhaps you could give us an enduring “custom post template” entry area like wordpress gives us an entry area for our custom css that isn’t wiped out in updates?

    I had to figure this out last time, without really understanding how, and now I have to do it all over again because I lost a note that I had pasted the successful code data into.

    The setting to show the description in the info window is not functional, it ought to do what we are now having to write custom code to make it do. That setting does nothing when selecting display in info window, it only works on the display in list selection.

    Happy new year, I hope you are well. Thank you for your time and assistance.

    Oh, I actually just found my old file. Hooray! Im going to post it here for others since this thread is stickied. I still would appreciate it if you would build this back in Mr. Smit, it existed in the form that we are attempting to reinstate when you first made this plugin, and its very useful. Most people don’t know how to muck around in code like this.

    
    add_filter( 'wpsl_include_post_content', '__return_true' );
    
    add_filter( 'wpsl_info_window_template', 'custom_info_window_template' );
    
    function custom_info_window_template() {
        
        global $wpsl;
       
        $info_window_template = '<div data-store-id="<%= id %>" class="wpsl-info-window">' . "\r\n";
        $info_window_template .= "\t\t" . '<p>' . "\r\n";
        $info_window_template .= "\t\t\t" .  wpsl_store_header_template() . "\r\n";  // Check which header format we use
        $info_window_template .= "\t\t\t" . '<span><%= address %></span>' . "\r\n";
        $info_window_template .= "\t\t\t" . '<% if ( address2 ) { %>' . "\r\n";
        $info_window_template .= "\t\t\t" . '<span><%= address2 %></span>' . "\r\n";
        $info_window_template .= "\t\t\t" . '<% } %>' . "\r\n";
        $info_window_template .= "\t\t\t" . '<span>' . wpsl_address_format_placeholders() . '</span>' . "\r\n"; // Use the correct address format
        $info_window_template .= "\t\t" . '</p>' . "\r\n";
    
        $info_window_template .= "\t\t" . '<% if ( description ) { %>' . "\r\n";
        $info_window_template .= "\t\t" . '<%= description %>' . "\r\n";
        $info_window_template .= "\t\t" . '<% } %>' . "\r\n";
    
        $info_window_template .= "\t\t" . '<% if ( phone ) { %>' . "\r\n";
        $info_window_template .= "\t\t" . '<span><strong>' . esc_html( $wpsl->i18n->get_translation( 'phone_label', __( 'Phone', 'wpsl' ) ) ) . '</strong>: <%= formatPhoneNumber( phone ) %></span>' . "\r\n";
        $info_window_template .= "\t\t" . '<% } %>' . "\r\n";
        $info_window_template .= "\t\t" . '<% if ( fax ) { %>' . "\r\n";
        $info_window_template .= "\t\t" . '<span><strong>' . esc_html( $wpsl->i18n->get_translation( 'fax_label', __( 'Fax', 'wpsl' ) ) ) . '</strong>: <%= fax %></span>' . "\r\n";
        $info_window_template .= "\t\t" . '<% } %>' . "\r\n";
        $info_window_template .= "\t\t" . '<% if ( email ) { %>' . "\r\n";
        $info_window_template .= "\t\t" . '<span><strong>' . esc_html( $wpsl->i18n->get_translation( 'email_label', __( 'Email', 'wpsl' ) ) ) . '</strong>: <%= email %></span>' . "\r\n";
        $info_window_template .= "\t\t" . '<% } %>' . "\r\n";
        
        $info_window_template .= "\t\t" . '<% if ( hours ) { %>' . "\r\n";
        $info_window_template .= "\t\t" . '<div class="wpsl-store-hours"><strong>' . esc_html( $wpsl->i18n->get_translation( 'hours_label', __( 'Hours', 'wpsl' ) ) ) . '</strong>' . "\r\n";
        $info_window_template .= "\t\t" . '<%= hours %>' . "\r\n";
        $info_window_template .= "\t\t" . '</div>' . "\r\n";
        $info_window_template .= "\t\t" . '<% } %>' . "\r\n";    
        
        $info_window_template .= "\t\t" . '<%= createInfoWindowActions( id ) %>' . "\r\n";
        $info_window_template .= "\t" . '</div>';
        
        
        return $info_window_template;
    }
    
    add_filter( 'wpsl_thumb_size', 'custom_thumb_size' );
    
    function custom_thumb_size() {
        
        $size = array( 150, 150 );
        
        return $size;
    }
    

    Ah, I take it back, now my code which worked perfectly a few updates ago isn’t working correctly. The “more info” buttons won’t open location descriptions and nothing comes up when clicking on map location pins. Please help Mr. Smit!

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Description field not showing after updating’ is closed to new replies.