Information


Accessing Files in a WordPress Theme Directory

When developing or modifying themes in WordPress, you may want to reference a file in the theme, such as a graphic, or an additional style sheet.

The php function bloginfo(’template_directory’) outputs the path to the template to the template. In other words, this function has an echo statement built right into it. You can not assign a variable to the path using this method.

If you want to include an additional style sheet called extra-style-sheet. css in your template theme, you can do it like this:

<link rel=”stylesheet” href=”<?php bloginfo(’template_directory’); echo “/extra-style-sheet.css”; ?>” type=”text/css” media=”screen” />

 


Comments

No comments:

There are no comments for this post so far.

Post a comment