how can i load svg image with get_template_directory_uri() or bloginfo(‘template_url’)
remove “data-inject-svg” or use data=”data-inject-svg” …work great …hire a screenshots
remove “data-inject-svg” or use data=”data-inject-svg” …work great …hire a screenshots
If you check the Codex, the use of get_bloginfo() for certain parameters is discouraged: ‘stylesheet_url’ – Returns the primary CSS (usually style.css) file URL of the active theme. Consider using get_stylesheet_uri() instead. ‘stylesheet_directory’ – Returns the stylesheet directory URL of the active theme. (Was a local path in earlier WordPress versions.) Consider using get_stylesheet_directory_uri() instead. … Read more
if ( get_bloginfo( ‘description’ ) ) { //do something } bloginfo echoes the description, get_bloginfo returns php variable
You can filter template_directory_uri: <?php add_filter( ‘template_directory_uri’, function( $template_dir_uri ){ return str_replace( ‘http://example.com’, ‘https://cdn.example.com’, $template_dir_uri ); }); This will change URIs so they point at a CDN subdomain served via HTTPS.
Taken from the source code of get_bloginfo(), Here is a very very simple class you can utelize and extent at your will. I have decided to make use of methods, making properties public from a class is really not great coding and not recommended. I know WordPress thrive on public properties, but that is WordPress. … Read more