Solved

wordpress custom styles show on localhost but not on remote server

Posted on 2014-12-23
6
125 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
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

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

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

Suggested Solutions

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…
Like there are many different versions of Wordpress, there are also a handful of related side projects WordPress users should be familiar with.   All of these projects are open source and GPL licensed, which means there are few restrictions to us…
This video teaches users how to migrate an existing Wordpress website to a new domain.
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…

752 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