Solved

wordpress custom styles show on localhost but not on remote server

Posted on 2014-12-23
6
118 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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 order to have all security and back ups taken care of, WordPress users can sign up for services with WP Engine.
The purpose of this video is to demonstrate how to manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be IPage.com Log into your Hosting account. IPage will be used for demonstration : Locat…
The purpose of this video is to demonstrate how to reset a WordPress password if you are locked out and cannot reset the password. A typical use would be if you cannot access the email to which WordPress would send the password recovery email to…

896 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now