Link to home
Start Free TrialLog in
Avatar of derrida
derrida

asked on

wordpress custom styles show on localhost but not on remote server

hi
in my function.php file i have this code:
//add custom style dropdown to the editor
add_filter( 'mce_buttons_2', 'my_mce_buttons_2' );

function my_mce_buttons_2( $buttons ) {
    array_unshift( $buttons, 'styleselect' );
    return $buttons;
}

add_filter( 'tiny_mce_before_init', 'my_mce_before_init' );

function my_mce_before_init( $settings ) {

    $style_formats = array(
      array(
        'title' => 'Button',
        'selector' => 'a',
        'classes' => 'button'
      ),
        array(
          'title' => 'Callout Box',
          'block' => 'div',
          'classes' => 'callout',
          'wrapper' => true
        ),
        array(
          'title' => 'Bold Red Text',
          'inline' => 'span',
          'styles' => array(
            'color' => '#f00',
            'fontWeight' => 'bold'
          )
        ),
        array(
          'title' => 'circle image',
          'selector' => 'img',
          'classes' => 'img-circle'
        ),
        array(
          'title' => 'center div',
          'selector' => 'div',
          'classes' => 'centerit'
        ),
        array(
          'title' => 'content-header on h3',
          'selector' => 'h3',
          'classes' => 'content-header'
          ),
        array(
          'title' => 'responsive image',
          'selector' => 'img',
          'classes' => 'img-responsive'
          ),
        array(
          'title' => 'rounded corners image',
          'selector' => 'img',
          'classes' => 'img-rounded'
          ),
        array(
          'title' => 'thumbnail image',
          'selector' => 'img',
          'classes' => 'img-thumbnail'
          ),
        array(
          'title' => 'opening paragraph',
          'selector' => 'p',
          'classes' => 'open-paragraph'
          )

    );

    $settings['style_formats'] = json_encode( $style_formats );

    return $settings;

}

add_action( 'admin_init', 'add_my_editor_style' );

function add_my_editor_style() {
  add_editor_style();
}

Open in new window


all function well on my localhost but not on the remote server, actual site. have no idea why.
Avatar of Thierry Hulsebosch
Thierry Hulsebosch
Flag of Netherlands image

First thing that comes to mind,
Did you upload all images involved and clear cache in admin panel ?
Avatar of derrida
derrida

ASKER

hey thanks for answering.
i have cleared the cache in the browser.
and what images do you refer to? it is custom styles
Derrida,
It's a common error , referring to images which are not being uploaded.

You have cleared cache in the browser, also trough the admin panel?
Any result?
Avatar of derrida

ASKER

what do you mean through the admin panel? i am no expert with wordpress
ASKER CERTIFIED SOLUTION
Avatar of Thierry Hulsebosch
Thierry Hulsebosch
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of derrida

ASKER

great