how to create or define bloginfo vars
-
Hi WP members, Im trying to organize my theme directory with:
mytheme/assets/css
mytheme/assets/img
mythem/assets/jsMy first attempt to do so (just using the css for this example) was by trying to re-define stylesheet_url but for the life of me could not find where this is defined. Ive checked out the codex page re: bloginfo at https://codex.www.ads-software.com/Function_Reference/bloginfo but dont see any data on editing values or creating custom bloginfo variables.
My attempted work around was to just create my own custom vars in fucntions.php like so:
/* Custom vars for assets/styles directory */ $assets_css_dir = get_bloginfo('template_directory'); $assets_css = $assets_css_dir . "/assets/css"; $assets_img_dir = get_bloginfo('template_directory'); $assets_img = $assets_img_dir . "/assets/images"; $assets_js_dir = get_bloginfo('template_directory'); $assets_js = $assets_js_dir . "/assets/js";
Weird thing is when I echo $assets_css in my index.php it outputs correctly but when trying to use it in my header.php file (in the link tag) there is no output.
Im a total newbie to WP so Im sure Im missing something and I would think this is a common issue for theme developers but as much as Ive searched I just cant seem to find a solution to this.
Just FYI, I am using the twentyten theme if that means anything.
Id like to know what the best approach is that is the most, hmm how would you say, WordPress’ish so as to stay within WP’s code structure.
Any help or even just direction to some data would be much appreciated.
Thanks!
- The topic ‘how to create or define bloginfo vars’ is closed to new replies.