• I am trying to have the permalink within the store name lead directly to the external store website. I am using this tool as a medical-practice locator so we want it to lead to the practice’s site rather than the store page within. Is this possible? I use the CSV manager to upload and have included the URL for each practice. I understand there is a “Visit Website” button but I would like to eliminate that and just have the store name be clickable/permalink and lead to the practice website. This makes it much more accessible for our population. Thanks!

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi!

    That is totally possible. You will have to create the wpsl_store_header_template filter in your active theme’s functions.php file with these contents:

    add_filter( 'wpsl_store_header_template', 'custom_store_header_template' );
    
    function custom_store_header_template() {
        
        $header_template = '<% if ( wpslSettings.storeUrl == 1 && url ) { %>' . "\r\n";
        $header_template .= '<h3><a href="<%= url %>"><%= store %></a></h3>' . "\r\n";
        $header_template .= '<% } else { %>' . "\r\n";
        $header_template .= '<h3><%= store %></h3>' . "\r\n";
        $header_template .= '<% } %>'; 
        
        return $header_template;
    }

    So, instead of the store permalink, the store name will link to the URL, if it exists.

    I hope that helps!

    • This reply was modified 1 year, 11 months ago by farroyo.
    Thread Starter jgeorgetti

    (@jgeorgetti)

    Hi,

    Thank you so much for your help! I think I understand what you mean, but I’m not familiar with coding. Can you break down the steps a bit more?

    Hi again!

    No problem! This sometimes depends on your theme, but with most themes all you have to do is go to Appearance > Theme File Editor, and then select “functions.php” in the pane in the right.

    Then you have to paste the code snippet I sent you and click “save”.

    That should do it, but get back to us if you need more help.

    Regards,

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Permalink to external store URL’ is closed to new replies.