1

I use wordpress in a lan with wamp. I can correctly see the lan from client pcs. It works perfectly with non wordpress websites so i don't think it's a lan setting problem. Is there any particular setting i should set in wordpress? Actually, it loads correctly, but without JS and CSS.

UPDATE, here's how CSS and JS are loaded in the plugin:

function agenda_my_scripts() {
if ( !is_admin() ) {
    // datepicker
    wp_enqueue_script( 'custom-datepicker', plugins_url( 'sys/js/datepicker.js', dirname(__FILE__) ), array('jquery') );
    wp_enqueue_script('jquery-ui-datepicker');
    // CSS
    wp_register_style( 'agenda_css', plugins_url( 'sys/css/style.css', dirname(__FILE__) ) );
    wp_enqueue_style( 'agenda_css' );
    // jQuery CSS
    wp_register_style( 'jquery_ui_css', plugins_url( 'sys/css/jquery-ui.css', dirname(__FILE__) ) );
    wp_enqueue_style( 'jquery_ui_css' );
}

} add_action('wp_enqueue_scripts','agenda_my_scripts');

Then the child theme have the classic configuration:

/*
Theme Name:   Theme name
Theme URI:    -
Description:  Description
Author:       Author
Author URI:   -
Template:     child_template
Version:      1.0
Tags:         -
Text Domain:  child_template
*/

@import url("../twentytwelve/style.css");

where 'template' and 'text domain' match folder's name.

Moreover, if i activate the child theme, it loads twentyfourteen!!

This is very weird...

5
  • It's obvious. You don't have the CSS/JS LAN - development kit - plugin for Wordpress;-) No just kidding. A guess would be that it is htacess-related or it's that simple that it points to incorrect css/js - file. Commented Mar 21, 2014 at 10:51
  • Locally it loads CSS/JS correctly, only via lan i get the problem... What about your "htacess-related" guess? Commented Mar 21, 2014 at 14:57
  • Please show use how you load the js/css files in the header (in the WP-installation) and where the the actual js/css files is. Commented Mar 22, 2014 at 7:02
  • i've updated the code with the original question... Commented Mar 22, 2014 at 8:44
  • ok i solved it, or better: i solved the css/js issue but the child theme is still looking for twentyfourteen instead of twentytwelve...i'll post the solution to the main problem below Commented Mar 22, 2014 at 9:40

2 Answers 2

3

finally i solved it...this was a very annoying problem! just enter your db and change in wp_option: - siteurl: from localhost server's lan ip - home: from localhost server's lan ip

that's it! :)

6
  • 1
    Please explain your solution better, so other readers can understand and reproduce it. Commented Mar 22, 2014 at 9:58
  • how can i explain better than this? 1) access your db (ex. with phpmyadmin); 2) in table wp_option search for value 'siteurl' and change it from 'localhost' to your machine external ip (i can't know what is the ip); 3) do the same with the value 'home'. I don't know what else to say about this... Commented Mar 22, 2014 at 10:13
  • 1
    Your comment is better already than your answer text. :) An explanation how that changes the way WordPress behaves would be useful too. Commented Mar 22, 2014 at 10:17
  • What happens when you change it to 127.0.0.1 instead of your external ip? Also you can change this in the WP settings, no need to enter the database. Commented Jun 9, 2016 at 12:30
  • Yes, you can do this change via WordPress/Settings/General, however, throughout your content or theme, if you have any links containing "localhost" (for whatever reason) then you have to go through a process to change them. That process could be manually changing them in the database or in your code files. Commented Jan 7, 2019 at 17:29
0

Just run this query in your sql console:

update wp_options
set option_value = '/'
WHERE option_name = 'home'
   OR option_name = 'siteurl'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.