Solved

wordpress custom styles show on localhost but not on remote server

Posted on 2014-12-23
6
113 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 1

Author Comment

by:derrida
Comment Utility
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
Comment Utility
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
Comment Utility
great
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

I want to start by talking about the use of plug-ins for WordPress. I started a web-site for a company I was working for a few years ago; I had extremely basic knowledge of HTML. I am a Graphic Designer by trade so I invited the opportunity as a cha…
So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…

744 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

17 Experts available now in Live!

Get 1:1 Help Now