The problem is the relative URL. You have to be careful with relative URLs in WordPress. Relative URLs are interpretted by the browser but the browser doesn’t know about the URL rewriting that happens behind the scenes.
Think about where your index file appears to be– http://example.com/
— vs. where it actually is– http://example.com/wp-content/themes/your-theme-name/index.php
. Similar problems occur with image locations. The apparent location– the path relative to the displayed URL– tends to be wrong.
You need to provide an absolute URL for your image src
using, probably, get_template_directory_uri()
or get_stylesheet_directory_uri()
as appropriate.
Related Posts:
- How do I put my comment form above the comments?
- Hide default “Recent Comments” Widget if there are no comments yet
- display comment form for specific post id
- Problems to disable the comments for my statics pages
- WordPress TwentyTen Theme Incompatible with Theme Unit Test
- Remove Commenting on Certain Pages
- Does Jetpack store comments in local database also? [closed]
- Comments not displaying after changing theme
- Unable to thread comments because of custom comments.php file
- How to edit the default comment title?
- Lost for direction on how to continue building a theme
- Theme comment callback results nothing
- Using OOP in themes
- Am I allowed to license my WordPress theme under the aGPL
- Best way to include Bootstrap in WordPress
- How to automatically highlight syntax of code in a post?
- register_theme_directory and broken deploys
- switch a theme different per user role
- How To Remove The “Click here to cancel reply” Link From The WordPress Comment Form
- Extra User Profile Field Upload File / Image
- How to make alert for new version on theme options?
- Migrating October CMS to WordPress
- Change logo on each page of University Hub theme [closed]
- Delete database tables on theme uninstall?
- Why are my sidebars not registering in unit tests
- How do you manage your theme versions when privately distributing?
- wordpress themes demo file importing problem? [closed]
- How to run word press theme on localhost in Ubuntu OS?
- get_template_directory has an odd functionality
- Theme editor not showing correct index.php
- Confit theme on WordPress.org
- How to set different settings for a mobile theme?
- How to set a single theme directory on a multisite blog?
- What’s the proper way to include inlined javascript-source?
- Create register form without a plugin
- Retina JS not working
- Get WordPress to use another custom “author.php” file (“custom-author-file.php”)
- wp_add_inline_style() not working?
- How can I use a logo in the header?
- JavaScript Files Registered in Parent Theme Won’t Load When Calling wp_enqueue_script() in Child Theme?
- Is it possible to create child themes using the WordPress Dashboard?
- Can I use wordpress themes without wordpress?
- Unwanted edit link on front page
- Need help with making a website where user can add products
- Determing number the query ran by core wordpress
- Preserve theme settings when migrating from local to live
- Unable to access wordpress login.php [closed]
- What is the “pub” theme? [closed]
- Can I change the WordPress default color?
- Enqueue custom css file on specific page
- How to put single-***.php in a specific folder?
- Using JQuery to check for Rel Attribute of Image before Overriding It
- for my current theme( own custom ) the default menu options are disabled in wp-admin?
- Most wp_nav_menu parameters ignored
- Is a very simple theme secure enough?
- New WordPress Theme Not Showing in Blog
- A wordpress site keeps editing wp-content files after migration
- Switching Theme and back will reset the previous Theme’s settings?
- Where did my Theme Editor go?
- Cannot update a file for my theme
- Do all themes accommodate all features?
- How to reduce Header at the top of the page
- Custom fields not displaying on front end
- remove theme’s name from dashboard .. How?
- Change “published by”
- Theme seems to be preventing me from adding a new page to my site
- WordPress margin issues
- 12 column grid layout
- Remove style id inline CSS in WordPress
- How to find file that placed a line in my header
- Where to find child themes?
- Theme check warning about text domain
- dynamic image path within a javascript file
- how to create a section inside a section with theme options customizer
- theme continuous deployment from bitbucket to windows azure
- Changing themes on locally hosted webpages
- Removing categories, Comments etc from posts?
- Changing admin Textarea to integrated WP editor
- Line break no working on theme
- What is the template file for topic layouts in bbPress?
- Style of a theme
- Orion theme (from theme forest) [closed]
- Showing wordpress theme demo at front end
- Diagnosing a connection reset problem
- Moving WordPress with Super Skeleton theme
- Customising a theme
- Blog shows up without Theme/CSS styles
- Boldy theme – Regarding the images above the boxes
- Symbolic Links for themes – linking one theme to many wordpress installs
- Fatal error: Call to undefined function get_header() and BuddyPress [closed]
- A problem with functions.php file on my WordPress site
- hardened wordpress linux install
- which theme is this? [closed]
- JQuery Error in theme for .live is not a function [closed]
- How do I remove the dash (-) between my Site Title and Tagline?
- WordPress Theme redirects to the Index page – Theme customizer problem
- Obtaining the original unchanged Theme [closed]
- How to assign posts to different themes? [closed]
- Using AJAX to Update WordPress Theme
- get_post_meta() doesn’t allow email