This function will return the theme directory URL so you can use it in other functions:
get_bloginfo('template_directory');
Alternatively, this function will echo the theme directory URL to the browser:
bloginfo('template_directory');
So an example for an image in the themes images/headers
folder would be:
<img src="https://wordpress.stackexchange.com/questions/665/<?php bloginfo("template_directory'); ?>/images/headers/image.jpg" />
Related Posts:
- Generating CSS Files Dynamically Using PHP Scripts?
- Add Caret to Menu Items with Sub-Menus in WordPress Theme
- How to effectively reset the post object after calling get_posts()
- How wp_cache is supposed to work, and does it help with performance?
- is_home() returns false on the home page! When is the home page NOT the home page?
- Custom attribute for the title tag with wp_title()
- What, specifically, should be included in theme_name_setup()?
- How to get gallery images?
- Custom theme/plugin update checks
- Display admin notice only on main dashboard page
- What does “Do not deregister the jquery script in the administration area” mean?
- How to fix the error “file_get_contents was found in the file functions.php”?
- Identifying the priority of style.css so I can make a small CSS file load last
- WordPress Customize — Move “menus” options / field to another section
- How to use the responsive images feature from WP 4.4 in your themes
- Symlink a directory to wp-content/themes
- Passing variable in hooks and filter
- Formatting ?
- Is there an error in get_the_tag_list()?
- How do I create a specific login page for a specific user?
- How do you protect a premium theme from being copied?
- Convert PHP readfile to WP_Filesystem
- How to call wp_list_comments() with callback outside the loop
- Sub folder CSS that’s read by Admin panel
- why adds ‘»’ symbol?
- Infinite Scroll not working in own theme
- How can I exclude specific authors from wp_list_authors
- how to wrap tag in tag html to wordpress menu conversion
- Understanding the WordPress template hierarchy
- How to display the content for given page ID withot the wrapper?
- Dequeue a style file which is making website load slow!
- How to customize save function event?
- Do I need normalize.css when developing my own WordPress-theme?
- How to float an image in Gutenberg
- Force a specific template based on the URL
- Manage base theme with version control?
- Using $post->post_name in body id causing error: Trying to get property of non-object
- buddypress: how do i make the group description excerpt shorter?
- Theme-wide custom post template
- Bootstrap card columns change images size
- Can´t access child theme´s scripts dependencies found in parent
- Prefix best practice, should we use framework name or theme name?
- Custom Navigation build using wp_nav_menu and walker
- Call to undefined function add_menu_page() on theme activation
- The Content is not Wraping in tag
- Using page-id-{ID} from body_class() in local dev, versus live staging
- Should all references to a text domain be to my current theme?
- WordPress Settings API not saving options
- Custom image size vs CSS sizing
- Unique design inside a specific category’s url
- Rewrite the HTML markup of wp-login.php
- Making a WordPress theme based on twentyten
- Doing context-aware previews in the WordPress Customizer
- Clearing dummy data before launch
- multiple html/css files for wordpress theme?
- Create new wordpress theme with no need update
- Multi Site Setup, Child Themes, Getting Style Sheet Directory
- Add image URL automatically to custom field?
- content filter (add_filter) for category description?
- Theming media inserts
- How do I pass the category object to a function when is_archive() is true?
- Making a horizontal flyout menu from WordPress category listing
- How to use Canonical URL meta tag to avoid duplicate content issues with WP home pages
- getBoundingClientRect() showing different values on load vs scroll
- How to update mark-up of a gallery block in a custom theme?
- Host Private Custom Theme
- Why not works the search.php file?
- How do I make my terms for each product display via foreach loop? (woocommerce)
- WordPress Insert ads after every 5th post
- Exclude categories from wp query not working
- Copying a modified theme from one wordpress site to another wordpress site [closed]
- How to get custom logo with REST API instead of get_theme_mod();
- How can I change this SVG shape that’s generated?
- Can I set rest API endpoints from within a theme?
- Theme starter content translation is not working
- (Parent) theme Is Not Showing In Theme Selection Panel and Therefore Breaks Child Theme
- How to add an image to a theme page template in code?
- Looking to create an “update theme” functionality for a custom front-end dashboard
- remove_action(‘genesis_header’,’genesis_do_header’) hook not working
- Text View (Code View) in WordPress Customizer TinyMCE Editor
- Breaking Categories Up into Individual Divs
- Different stylesheet for different pages not working fully
- Can I use WP Multi-site on a sub-domain with a different theme but use all the original site’s posts/pages?
- How to Apply Category Filter to Pagination
- Strip HTML tags on custom code from the_content
- Get all Custom Post Types
- wpdb->insert adds too many rows
- wpalchemy repeating fields dropdown issue
- Does WordPress require that your submitted theme supports multiple menu levels?
- WordPress loop not working on blog.php page
- Option to show/hide widget depending on is_home?
- Add Dynamic Sidebar to Exisiting WordPress Theme [closed]
- Why does the first loop take arguments from the second loop?
- How do I middle-align my header menu items in WordPress [closed]
- Theme layout for home page [closed]
- How to add Dummy content when active wordpress theme without xml import?
- Is there any reason that other theme elements (such as nav menus) shouldn’t be within the loop?
- Is there any way to show child theme in theme detectors?
- How to set up a development/staging site to make major changes to the theme then update on the live site?
- What is the point of using the front-page.php template? [closed]