Writing a relative path to a theme’s stylesheet
-
Hi folks,
I’m building a new theme I’m hoping to release for download soon. The theme contains a stylsheet switcher that allows the user to change the look of the site, without having to load a whole new theme. It works great, but I need to figure out how to modify one line of code so I don’t have to specify the absolute path to the stylesheet (since it will be different for everyone). The line of code I have now is:
$ss->addStyle("default", "https://www.mysite.com/blog/wp-content/themes/Access/css/default.css", "screen");
I tried using:
$ss->addStyle("default", "<?php bloginfo('template_url'); ?>/css/default.css", "screen");
But
<?php bloginfo('template_url'); ?>
renders out as text. How can I alter that line so it will write out the path to the template?
- The topic ‘Writing a relative path to a theme’s stylesheet’ is closed to new replies.