Solved

wordpress custom styles show on localhost but not on remote server

Posted on 2014-12-23
6
122 Views
Last Modified: 2014-12-23
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.
0
Comment
Question by:derrida
  • 3
  • 3
6 Comments
 
LVL 4

Expert Comment

by:hulsebosch
ID: 40514691
First thing that comes to mind,
Did you upload all images involved and clear cache in admin panel ?
0
 
LVL 1

Author Comment

by:derrida
ID: 40514699
hey thanks for answering.
i have cleared the cache in the browser.
and what images do you refer to? it is custom styles
0
 
LVL 4

Expert Comment

by:hulsebosch
ID: 40514836
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?
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 1

Author Comment

by:derrida
ID: 40514889
what do you mean through the admin panel? i am no expert with wordpress
0
 
LVL 4

Accepted Solution

by:
hulsebosch earned 500 total points
ID: 40514906
Here's a tutorial on clearing the cache.
http://codex.wordpress.org/Class_Reference/WP_Object_Cache

Maybe, even better, there are plugins that will do the trick for you.
0
 
LVL 1

Author Closing Comment

by:derrida
ID: 40514955
great
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Who says nothing in life is free? WordPress.com is a freebie. WordPress.org's downloadable publishing platform is free. Heck, even WordPressMU is free. WordPress is an open source project, which means it can be used on any personal or commerc…
In Part I (http://www.experts-exchange.com/Web_Development/Blogs/WordPress/A_8410-Getting-Started-In-WordPress-Part-I.html), I introduced you to the powerful WordPress backend, the WordPress administrative Dashboard.  In Part II, I will introduce yo…
The purpose of this video is to demonstrate how to properly insert a Vimeo Video into a WordPress site or Blog. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp…
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question