diff --git a/comiceasel.php b/comiceasel.php index 930afa5..42300ae 100644 --- a/comiceasel.php +++ b/comiceasel.php @@ -289,36 +289,7 @@ if (is_admin()) { // This style needs to be loaded on all the comic-easel pages inside ceo-core.php instead. -function ceo_run_css() { - if (!ceo_pluginfo('disable_style_sheet')) { - wp_register_style('comiceasel-style', ceo_pluginfo('plugin_url').'css/comiceasel.css'); - wp_enqueue_style('comiceasel-style'); - if (is_active_widget(false, false, 'ceo_comic_navigation_widget', true)) { - if (is_child_theme() && file_exists(get_stylesheet_directory() . '/images/nav/' . ceo_pluginfo('graphic_navigation_directory') . '/navstyle.css')) { - wp_register_style('comiceasel-navstyle',get_stylesheet_directory_uri() . '/images/nav/' . ceo_pluginfo('graphic_navigation_directory') . '/navstyle.css'); - } elseif (file_exists(get_template_directory() . '/images/nav/' . ceo_pluginfo('graphic_navigation_directory'). '/navstyle.css')) { - wp_register_style('comiceasel-navstyle',get_template_directory_uri() . '/images/nav/' . ceo_pluginfo('graphic_navigation_directory') . '/navstyle.css'); - } elseif (file_exists(ceo_pluginfo('plugin_path') . 'images/nav/' . ceo_pluginfo('graphic_navigation_directory') . '/navstyle.css')) { - wp_register_style('comiceasel-navstyle', ceo_pluginfo('plugin_url').'images/nav/'. ceo_pluginfo('graphic_navigation_directory'). '/navstyle.css'); - } else - wp_register_style('comiceasel-navstyle', ceo_pluginfo('plugin_url').'css/navstyle.css'); - wp_enqueue_style('comiceasel-navstyle'); - } - } -} -function ceo_run_scripts() { - global $post; - if (!empty($post)) { - $comic_content_warning = get_post_meta( $post->ID, 'comic-content-warning', true ); - if ($comic_content_warning) { - wp_enqueue_script('ceo_comic_content_warning', ceo_pluginfo('plugin_url').'js/content-warning.js', null, null, true); - } - } - if (!ceo_pluginfo('disable_keynav')) { - wp_enqueue_script('ceo_keynav', ceo_pluginfo('plugin_url').'js/keynav.js', null, null, true); - } -} function ceo_chapters_add_menu_order_column() { global $wpdb; @@ -594,3 +565,34 @@ function ceo_language_init() { add_action('plugins_loaded', 'ceo_language_init'); +function ceo_run_css() { + if (!ceo_pluginfo('disable_style_sheet')) { + wp_register_style('comiceasel-style', ceo_pluginfo('plugin_url').'css/comiceasel.css'); + wp_enqueue_style('comiceasel-style'); + if (is_active_widget(false, false, 'ceo_comic_navigation_widget', true)) { + if (is_child_theme() && file_exists(get_stylesheet_directory() . '/images/nav/' . ceo_pluginfo('graphic_navigation_directory') . '/navstyle.css')) { + wp_register_style('comiceasel-navstyle',get_stylesheet_directory_uri() . '/images/nav/' . ceo_pluginfo('graphic_navigation_directory') . '/navstyle.css'); + } elseif (file_exists(get_template_directory() . '/images/nav/' . ceo_pluginfo('graphic_navigation_directory'). '/navstyle.css')) { + wp_register_style('comiceasel-navstyle',get_template_directory_uri() . '/images/nav/' . ceo_pluginfo('graphic_navigation_directory') . '/navstyle.css'); + } elseif (file_exists(ceo_pluginfo('plugin_path') . 'images/nav/' . ceo_pluginfo('graphic_navigation_directory') . '/navstyle.css')) { + wp_register_style('comiceasel-navstyle', ceo_pluginfo('plugin_url').'images/nav/'. ceo_pluginfo('graphic_navigation_directory'). '/navstyle.css'); + } else + wp_register_style('comiceasel-navstyle', ceo_pluginfo('plugin_url').'css/navstyle.css'); + wp_enqueue_style('comiceasel-navstyle'); + } + } +} + +function ceo_run_scripts() { + global $post; + if (!empty($post)) { + $comic_content_warning = get_post_meta( $post->ID, 'comic-content-warning', true ); + if ($comic_content_warning) { + add_action('wp_head', 'ceo_content_warning_in_head'); + wp_enqueue_script('ceo_comic_content_warning', ceo_pluginfo('plugin_url').'js/content-warning.js', null, null, true); + } + } + if (!ceo_pluginfo('disable_keynav')) { + wp_enqueue_script('ceo_keynav', ceo_pluginfo('plugin_url').'js/keynav.js', null, null, true); + } +} diff --git a/functions/displaycomic.php b/functions/displaycomic.php index 3de7b6b..ced835a 100644 --- a/functions/displaycomic.php +++ b/functions/displaycomic.php @@ -34,6 +34,7 @@ function ceo_display_featured_image_comic($size = 'full') { $linkto = ''; $linkto = get_post_meta($post->ID, 'link-to', true); + if ($linkto) $next_comic = esc_url($linkto); if ($linkto && !$comic_has_map) $output .= ''; diff --git a/functions/library.php b/functions/library.php index 44468e5..67c4ff6 100644 --- a/functions/library.php +++ b/functions/library.php @@ -131,8 +131,6 @@ function ceo_content_warning() { return apply_filters('ceo-content-warning', __('Warning, Mature Content.','comiceasel')); } -add_action('wp_head', 'ceo_content_warning_in_head'); - function ceo_content_warning_in_head() { ?>