Testing your WordPress Page using different devices [ Smartphones, iPads … ] by using WLAN connections

Current Status of the WP install

  • You have installed a local WordPress Development env [ XAMPP ]  using localhost as your WP URL
  • Testing your smartphone devices connected via WLAN  fails during loading images
  • You checked the images in your HTML page and found that WordPress is using localhost in your image URL
   <img class="htmlImage" src="http://localhost/wordpress/wp-content/themes/twentyfifteen-child/images/htmlImages/abu1.jpg" ..
    • In your WordPress HTML page you reference the images by using get_stylesheet_directory_uri() like
   <img  class="htmlImage" src=[insert_php]echo get_stylesheet_directory_uri()."/images/htmlImages/abu1.jpg
  • Checking your current  WordPress  Settings  via admin dashboard > Settings > General
        WordPress-Address (URL) : http://locahost/wordpress
        Website-Address (URL)   : http://localhost/wordpress   
  • It’s obvious that this HTML Page will fail for our Remote Devices [ like Nexius 6P ] as the we are not running a local Webserver.

Fix :  Change the  WordPress Address (URL) line and Site Address (URL) lines  from localhost to  your DHCP address  [ ] and save the changes

  • Login to WordPress admin dashboard > Settings > General and change the WP URLs  by using the DHCP address

Now your testing should be fine as your image URL is now using the DHCP IP address instead of localhost.


Leave a Reply

Your email address will not be published. Required fields are marked *