Add theme directory default shortcode
-
Looking to add a default placeholder for the theme directory for future versions.
Example:<img src="{{template_directory_uri}}/images/{{backgroundimg}}.png">
means we can do
[shortcode backgroundimg="child.jpg"]
without hardcoding a URL, making it adapt to future themes# diff -urN includes/placeholders.{bak,php} --- includes/placeholders.bak 2017-10-02 11:37:10.632457601 -0400 +++ includes/placeholders.php 2017-10-02 11:43:31.108480218 -0400 @@ -32,6 +32,11 @@ return \add_query_arg(array(), $wp->request); } + // Returns the theme/template directory + if ($name == 'template_directory_uri') { + return \get_template_directory_uri(); + } + /** * PHP */
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Add theme directory default shortcode’ is closed to new replies.