-1

im using wampserver on windows 7 and have wordpress set up. I am trying to include a js file using a couple of methods but the server is adding extra locations..

e.g. using wp_enqueue_scripts outputs:

wp_enqueue_script('qtip', AD_PATH.'/js/qtip/jquery.qtip.min.js', array('jquery'), false, true);

AD_PATH outputs correctly on screen when echo'd: C:\wamp\www\market/wp-content/plugins/market

but in the chrome console, http://localhost/marketC:wampwwwmarket/wp-content/plugins/market/js/qtip/jquery.qtip.min.js?ver=3.9.2 appears.

using

<script type="text/javascript" src='localhost/market/wp-content/plugins/market/js/qtip/jquery.qtip.min.css'></script>

outputs

http://localhost/market/merchant/register/localhost/market/wp-content/plugins/market/js/qtip/jquery.qtip.min.css

this prepends the current page location to the src.

I had a problem with the wampserver index file not including localhost and changed $suppress_localhost to false and $projectContents .= '<li><a href="'.($suppress_localhost ? 'http://localhost/' : '').$file.'">'.$file.'</a></li>';

anyone any ideas?

David
  • 5,897
  • 3
  • 24
  • 43
  • WORDPRESS works much more reliably if you create a Virtual Host for it to run in. WP issues like this, was one of the main reasons that WAMPServer now actively encourages the creation of Virtual Hosts for all projects, however trivial, as questions like this one were taking up the majority of the WAMPServer forum. See this doc for [help creating Virtual Hosts](http://stackoverflow.com/questions/23665064/project-links-do-not-work-on-wamp-server/23990618#23990618) – RiggsFolly Aug 24 '14 at 11:03
  • thanks very much for this, ill have a look at this later! – David Aug 24 '14 at 20:27

1 Answers1

0

To solve your problem edit your wamp/www/index.php file. At line 30 there is:

$suppress_localhost = true;

Change it to:

$suppress_localhost = false;
honk
  • 9,137
  • 11
  • 75
  • 83