For WP-PostRatings 1.50.
You still need to place this function in your theme functions.php:
function get_site_url(){
$domain = $_SERVER['SERVER_NAME'];
$domain = str_replace('www.', '', $domain);
$site_url = 'http://' . $domain;
return $site_url;
}
Replace (in wp-postratings.php):
'plugin_url' => plugins_url('wp-postratings'),
'ajax_url' => plugins_url('wp-postratings/wp-postratings.php'),With:
'plugin_url' => get_site_url().'/wp-content/plugins/wp-postratings',
'ajax_url' => get_site_url().'/wp-content/plugins/wp-postratings/wp-postratings.php',
Replace:
wp_enqueue_script('wp-postratings', plugins_url('wp-postratings/postratings-js.js'), array('jquery'), '1.50', true);With:
wp_enqueue_script('wp-postratings', get_site_url().'/wp-content/plugins/wp-postratings/postratings-js.js', array('jquery'), '1.50', true);
Replace:
if(@file_exists(TEMPLATEPATH.'/postratings-css.css')) {
wp_enqueue_style('wp-postratings', get_stylesheet_directory_uri().'/postratings-css.css', false, '1.50', 'all');
} else {
wp_enqueue_style('wp-postratings', plugins_url('wp-postratings/postratings-css.css'), false, '1.50', 'all');
}
if('rtl' == $text_direction) {
if(@file_exists(TEMPLATEPATH.'/postratings-css-rtl.css')) {
wp_enqueue_style('wp-postratings-rtl', get_stylesheet_directory_uri().'/postratings-css-rtl.css', false, '1.50', 'all');
} else {
wp_enqueue_style('wp-postratings-rtl', plugins_url('wp-postratings/postratings-css-rtl.css'), false, '1.50', 'all');
}
}With:
if(@file_exists(TEMPLATEPATH.'/postratings-css.css')) {
wp_enqueue_style('wp-postratings', get_stylesheet_directory_uri().'/postratings-css.css', false, '1.50', 'all');
} else {
wp_enqueue_style('wp-postratings', get_site_url().'/wp-content/plugins/wp-postratings/postratings-css.css', false, '1.50', 'all');
}
if('rtl' == $text_direction) {
if(@file_exists(TEMPLATEPATH.'/postratings-css-rtl.css')) {
wp_enqueue_style('wp-postratings-rtl', get_stylesheet_directory_uri().'/postratings-css-rtl.css', false, '1.50', 'all');
} else {
wp_enqueue_style('wp-postratings-rtl', get_site_url().'/wp-content/plugins/wp-postratings/postratings-css-rtl.css', false, '1.50', 'all');
}
}