0

I'm trying to create a local version on XAMPP of my company's WordPress website.

All well and good except for the theme images aren't loading. (CMS images are loading)

Looking at the image paths, I notice why they aren't loading. The root directory isn't there. It is;

http://localhost/wp-content/themes/stepladder/images/homepage-hero/header-hero-SL.png

Should be;

http://localhost/stepladder/wp-content/themes/stepladder/images/homepage-hero/header-hero-SL.png

This is the code I'm using for the theme images;

<span><?php the_title(); ?><img src="<?php echo get_template_directory_uri(); ?>/images/border-white.png" class="underline"></span>

I've also tried it with;

<?php bloginfo('template_directory'); ?>

but same outcome.

The strange thing is, this same template tag is sucessfully loading other resources like the scripts (from functions.php)

  • I think you should post code from wp-config.php excluding database details. – Robert hue Sep 30 '14 at 16:43
1

Probably your localhost siteurl option it's not set up right.
Try to add this on your wp-config.php file:

define('WP_HOME','http://localhost/stepladder');
define('WP_SITEURL','http://localhost/stepladder');

If it works, then it proves that your siteurl option (on your options table) it's not correct.

hope that it helps,
Cheers

  • I tried, but no change. I already made sure the siteurl was correct in the database. And anyway, the correct uri is loading for scripts, just not for images. Can't understand why this would happen. – bazzlebrush Sep 30 '14 at 15:40
0

What about .htaccess maybe you have to change RewriteBase / to RewriteBase /stepladder

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.