WordPress.org

Ready to get started?Download WordPress

Forums

Social Media Widget
[resolved] [SOLVED] Load CSS/Images from mapped domain (2 posts)

  1. John Peden
    Member
    Posted 1 year ago #

    When running multisite with mapped domains, the plugin content loads from the unmapped domain. This can cause problems with cacheing. I modified the plugin as follows to change this behaviour:

    //if ( !defined('WP_CONTENT_URL') ) {
    	define('SMW_PLUGINPATH',get_option('siteurl').'/wp-content/plugins/'.plugin_basename(dirname(__FILE__)).'/');
    	define('SMW_PLUGINDIR', ABSPATH.'/wp-content/plugins/'.plugin_basename(dirname(__FILE__)).'/');
    /*} else {
    	define('SMW_PLUGINPATH',WP_CONTENT_URL.'/plugins/'.plugin_basename(dirname(__FILE__)).'/');
    	define('SMW_PLUGINDIR',WP_CONTENT_DIR.'/plugins/'.plugin_basename(dirname(__FILE__)).'/');
    }*/

    http://wordpress.org/extend/plugins/social-media-widget/

  2. brianfreytag
    Member
    Posted 1 year ago #

    You could easily resolve this by defining your WP_CONTENT_URL for each site. Maybe in your functions.php file for the site theme, since that loads before the widget.

    You are essentially telling it to always load as if the WP_CONTENT_URL is defined when it's not, which can cause a lot of issues on many other types of setups. That if statement wasn't even in there when I first started, but a lot of people didn't have it properly defined, so the widget would break without it.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic