The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

[resolved] Enqueuing scripts/stylesheets, Local Area Networking users getting 404 (2 posts)

  1. elliott greaves
    Posted 3 years ago #

    I am developing buddypress using a WAMP server.

    My enqueue_Script/Style functions work fine when viewing the theme on the PC the wamp server is installed on.

    I run into issues when I am accessing the wordpress installation over the local area network from another PC, Tablet Device or Smartphone as content_url, bloginfo("template_url") and get_template_directory_uri() all return a string that includes http://localhost/ at the beginning, This works fine on the machine that's running the localhost testing environment but for other users on the network it causes a 404 as http://localhost does not exist.

    If anybody knows of a solution to this problem it would be greatly appreciated.

    Thank you for reading, and thank you your time.

  2. elliott greaves
    Posted 3 years ago #

    I solved the issue myself. It was nothing to do with the code.

    It was to do with the WordPress settings on the WordPress installation itself.

    In the general settings, I had to change the "WordPress Address (URL)" && the "Site Address (URL)".
    When I installed WordPress the "general settings" -> "wordpress address (URL)" && "General Settings" -> "Site Address (URL)" default values haVE "http://localhost/" at the beginning; So I swapped "http://localhost/" for an "IP address" that everyone on my LAN had to type into their browsers to access the localhost installation in the first place.

    On windows find that IP address by opening command prompt and typing "ipconfig".

    It will be under "Ethernet adapter Local Area Connection:"
    and it will be the IPv4 Address.

Topic Closed

This topic has been closed to new replies.

About this Topic