StudioPress Community Forums
  StudioPress Community Forums > Forums > General Discussion
For help and support, access to your downloads, or to manage your account please log into My StudioPress.

These forums have been set to read-only so you can browse the existing topics for any questions you may have.

For general discussion on WordPress, CSS and design (NOT for support) visit the new Community Forums.
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 07-02-2011, 01:08 PM
noxbane noxbane is offline
Registered User
Pro Plus Member
 
Join Date: Nov 2010
Posts: 139
Default Relative Path From An Included PHP File Within Theme Directory

So I'm using a custom Genesis child theme. I've created my own PHP file called showcase.php and placed it in my custom child theme directory.

This file is located at: /public_html/wp-content/themes/mycustomtheme/showcase.php

This file is included via a hook:

PHP Code:
add_action('genesis_after_header''child_make_showcase');
function 
child_make_showcase() 
{
    require_once(
STYLESHEETPATH.'/showcase.php');    


Within showcase.php, I am changing the background of an element using Javascript when the user clicks on a certain area of the page:


Code:
document.getElementById("ED-quicksearch").style.backgroundImage = 'url("/wp-content/themes/mycustomtheme/images/quicksearch-bg-tucson.png")';

That's just part of the Javascript of course. I swear the above code worked before but now it doesnt. I can't seem to figure out what path to give it. If I give it an absolute URL it works, so the image does exist in the proper place and the element ID is correct, I just can't figure out what relative path to use. And it boggles my mind that I am certain it USED to work with that relative path above. Neither Firefox Error Console or Firebug show javascript errors.
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do you find the path of a css file? mrsgooding General Discussion 1 02-15-2010 01:28 AM
Church.xml file included in theme? southatlantic General Discussion 2 12-10-2009 12:49 PM
.PSD File Is Supposed to be Included? jeffboyle General Discussion 7 10-21-2009 02:51 PM
Demo Content not included when xlm file Imported richardantondiaz General Discussion 2 10-09-2009 09:06 AM
Where in Wordpress Can I Change the Parent Directory Path cartess3 General Discussion 3 12-18-2008 04:56 PM


All times are GMT -5. The time now is 11:53 AM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.