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

    (@tijmensmit)

    Are you 100% sure you placed all the code in the functions.php inside your active theme folder?

    Do any errors show up in the browser console on the store locator page? Also make sure to flush the browser cache, and if you’re using it, also the cache from any caching plugins.

    Thread Starter Chetan Prajapati

    (@chetan200891)

    Yes.

    I have added below functions to my child theme.

    /**
     * Custom marker image for WPSL.
     */
    function wpsl_custom_markers() {
    	$admin_marker_dir = get_stylesheet_directory() . '/wpsl-markers/';
    	return $admin_marker_dir;
    }
    add_filter( 'wpsl_admin_marker_dir', 'wpsl_custom_markers' );
    
    define( 'WPSL_MARKER_URI', dirname( get_bloginfo( 'stylesheet_url' ) ) . '/wpsl-markers/' );

    and also added images to wpsl-markers folder.

    Plugin Author Tijmen Smit

    (@tijmensmit)

    What are the file names in the wpsl-markers folder?

    Thread Starter Chetan Prajapati

    (@chetan200891)

    leaf.png & leaf@2x.png

    Plugin Author Tijmen Smit

    (@tijmensmit)

    It looks fine to me.

    No errors show up in the browser console, or in the error log on the server?

    If you access the files directly in your browser, then they do load?

    hi @chetan Prajapati,
    I have tested the above code in functions.php and its not working.But i got the solution for adding custom marker. simply create two markers named like above leaf.png & leaf@2x.png and upload it into the markers folder inside the plugin img folder and reload the settings page in dashboard. it’s automatically take the newly uploaded marker.

    Plugin Author Tijmen Smit

    (@tijmensmit)

    If I test it with a default WP theme, then my custom marker shows up with the above code.

    If it doesn’t work, then maybe also check the error log on your server. Make sure you can load the marker by loading it directly in your browser from the path you are loading the marker from ( http://domain.com/wp-content/etc/ marker-image.png ).

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Custom marker image showing in backend but not showing in front-end.’ is closed to new replies.