Trouble identifying root directory?
-
I am trying to have all site images linked via relative URL so that the site can be easily moved from development area to live. I’ve tried all the usual methods of dynamic linking that I’ve come across here in the WP Documentation but they don’t seem to work in this instance.
The only thing I can imagine going wrong is the dynamic linking methods show below are all calling the wrong path?
<a href="#"><img src="<?php bloginfo('template_url'); ?>/wp-content/themes/Astrum/images/logos-arcat.gif" class="float-left home-logo-pad" alt="ARCAT" width="164" height="163"></a> <a href="#"><img src="<?php echo get_stylesheet_directory_uri() ?>/images/logos-arcat.gif" class="float-left home-logo-pad" alt="ARCAT" width="164" height="163" /></a> <a href="#"><img src="<?get_template_directory_uri() ?>/images/logos-arcat.gif" class="float-left home-logo-pad" alt="ARCAT" width="164" height="163" /></a>
I’m wondering how I can determine my images path? Is there a function I can run to determine this? For instance:
echo $_SERVER['DOCUMENT_ROOT']
Being new to PHP I wouldn’t be sure where to even run something like that. I could probably just paste it into the template_home.php, couldn’t I?
The actual relative path to my images is here: /public_html/wp-content/themes/Astrum/images
I’ve noticed most people use this link which seems to be an alias to the same directory: /public_html/wp-content/uploads/2013/10
I’ve tried using both those paths in my dynamic link to no avail. The absolute URL for images would be: https://sterling-testing.com/wp-content/uploads/2013/10/
Thanks
| scott
- The topic ‘Trouble identifying root directory?’ is closed to new replies.