esc_html__( 'Primary Navigation', 'raindrops' ), ) ); if ( !function_exists( 'raindrops_extend_query' ) ) { /** * Accessibility Settings * * When true * Add to hidden text for identify entry-title link text, comment link text, more link * * @since 1.116 */ function raindrops_extend_query( $vars ) { $vars[] = 'raindrops_color_type'; $vars[] = 'raindrops_pid'; return $vars; } } if ( 'yes' == raindrops_warehouse_clone( 'raindrops_accessibility_settings' ) ) { $raindrops_accessibility_link = false; } if ( !function_exists( 'raindrops_current_url' ) ) { function raindrops_current_url() { $url = 'http'; $server_https = filter_input( INPUT_SERVER, 'HTTPS' ); if ( !is_null( $server_https ) && "on" == $server_https ) { $url = "https"; } $url .= "://"; $server_port = filter_input( INPUT_ENV, "SERVER_PORT", FILTER_VALIDATE_INT ); $server_name = filter_input( INPUT_ENV, "SERVER_NAME" ); $request_uri = filter_input( INPUT_ENV, "REQUEST_URI" ); if ( !is_null( $server_port ) && 80 !== $server_port ) { $url .= $server_name . ":" . $server_port . $request_uri; } else { $url .= $server_name . $request_uri; } $url = esc_url( $url ); return apply_filters( 'raindrops_current_url', $url ); } } /** * home link * * ver 1.116 default value change * if you need home link then $raindrops_nav_menu_home_link set true. */ if ( !isset( $raindrops_nav_menu_home_link ) ) { $raindrops_link_unique_text = raindrops_link_unique_text(); if ( true == $raindrops_link_unique_text ) { $raindrops_nav_menu_home_link = false; } else { $raindrops_nav_menu_home_link = true; } } /** * HTML document type * * * * Now only 'xhtml' * ver 0.999 add type 'html5' */ if ( !isset( $raindrops_document_type ) ) { if ( 'xhtml' == raindrops_warehouse_clone( 'raindrops_doc_type_settings' ) ) { $raindrops_document_type = 'xhtml'; } else { $raindrops_document_type = 'html5'; add_theme_support( 'html5', array( 'gallery', 'caption' ) ); } } if ( !function_exists( 'raindrops_gallery_atts' ) ) { /** * * @global type $raindrops_extend_galleries * @param type $out * @param type $pairs * @param type $atts * @return gallery default attribute value * @since 1.269 */ function raindrops_gallery_atts( $out, $pairs, $atts ) { global $raindrops_extend_galleries; if ( $raindrops_extend_galleries !== true ) { return $out; } if ( empty( $atts[ "columns" ] ) || $atts[ "columns" ] < 4 ) { if ( isset( $atts[ "columns" ] ) && 1 == $atts[ "columns" ] ) { $gallary_img_size = 'large'; } else { $gallary_img_size = 'medium'; } $atts = shortcode_atts( array( 'size' => $gallary_img_size, ), $atts ); $out[ 'size' ] = $atts[ 'size' ]; } return $out; } } add_filter( 'shortcode_atts_gallery', 'raindrops_gallery_atts', 10, 3 ); /** * Force Document type for lt IE9 Old Browser * Note: This setting is SERVER_SIDE Setting, I recommend that the browser is set when the cache of less than IE9 as not performed * * Raindrops 1.204 remove from header.php * * * * ver 1.204 */ if ( $is_IE ) { $http_user_agent = filter_input( INPUT_ENV, 'HTTP_USER_AGENT' ); preg_match( "|(MSIE )([0-9]{1,2})(\.)|si", $http_user_agent, $raindrops_regs ); if ( isset( $raindrops_regs[ 2 ] ) && $raindrops_regs[ 2 ] < 9 ) { $raindrops_document_type = 'xhtml'; remove_theme_support( 'html5' ); } } /** * * * $raindrops_post_formats_args * add ver0.991 gallery,status */ if ( !isset( $raindrops_post_formats_args ) ) { $raindrops_post_formats_args = apply_filters( 'raindrops_post_formats_args', array( 'aside', 'gallery', 'chat', 'link', 'image', 'status', 'quote', 'video' ) ); add_theme_support( 'post-formats', $raindrops_post_formats_args ); } /** * * * * $raindrops_custom_background_args * */ if ( !isset( $raindrops_custom_background_args ) ) { $raindrops_custom_background_args = apply_filters( 'raindrops_custom_background_args', array( 'default-color' => '', 'default-image' => '', ) ); add_theme_support( 'custom-background', $raindrops_custom_background_args ); } /** * * * * $raindrops_post_thumbnails_args * */ /** * @1.404 removed args * $raindrops_post_thumbnails_args = array(); * , apply_filters( 'raindrops_post_thumbnails_args', $raindrops_post_thumbnails_args ) */ add_theme_support( 'post-thumbnails' ); /** * * * * * */ add_theme_support( 'automatic-feed-links' ); /** * Content width implementation by manual labor * * If you need specific $content_width. * value set 400 When not setting or empty. * */ //$content_width = ''; /** * $raindrops_fluid_minimum_width for IE * * IE browser not support responsive * * $raindrops_fluid_minimum_width * */ if ( $is_IE ) { $http_user_agent = filter_input( INPUT_ENV, 'HTTP_USER_AGENT' ); preg_match( "|(MSIE )([0-9]{1,2})(\.)|si", $http_user_agent, $regs ); if ( isset( $regs[ 2 ] ) && $regs[ 2 ] < 9 ) { $raindrops_fluid_minimum_width = apply_filters( 'raindrops_fluid_minimum_width_lt_ie9', '640' ); } } /** * fluid page main column maximum width px * * * * $raindrops_fluid_maximum_width * */ if ( !isset( $raindrops_fluid_maximum_width ) ) { $raindrops_fluid_maximum_width = raindrops_warehouse_clone( 'raindrops_fluid_max_width' ); } if ( !function_exists( 'raindrops_reset_theme_options' ) ) { /** * @since 1.401 */ function raindrops_reset_theme_options() { global $raindrops_setting_type, $raindrops_base_setting_args; if ( 'yes' == raindrops_warehouse_clone( 'raindrops_reset_options' ) ) { if ( 'option' == $raindrops_setting_type ) { delete_option( 'raindrops_theme_settings' ); raindrops_update_theme_option( 'raindrops_reset_options', 'no' ); } } if ( 'theme_mod' == $raindrops_setting_type && 'yes' == get_theme_mod( 'raindrops_reset_options' ) ) { foreach ( $raindrops_base_setting_args as $key => $name ) { if ( $key == 'raindrops_footer_link_color' || $key == 'raindrops_footer_color' || $key == 'raindrops_hyperlink_color' || $key == 'raindrops_default_fonts_color' ) { set_theme_mod( $key, raindrops_default_colors_clone( 'dark', $key ) ); } else { set_theme_mod( $key, raindrops_warehouse_clone( $key, 'option_value' ) ); } } set_theme_mod( 'raindrops_reset_options', 'no' ); } } } add_action( 'customize_save_after', 'raindrops_reset_theme_options' ); if ( !function_exists( 'raindrops_reset_custom_color' ) ) { /** * * @global type $raindrops_base_setting_args * @since 1.401 */ function raindrops_reset_custom_color() { global $raindrops_base_setting_args; if ( 'automatic' == raindrops_warehouse_clone( 'raindrops_color_select' ) ) { $change_settings = array( 'raindrops_default_fonts_color', 'raindrops_complementary_color_for_title_link', 'raindrops_footer_color', 'raindrops_hyperlink_color', 'raindrops_footer_link_color' ); foreach ( $raindrops_base_setting_args as $key => $val ) { if ( in_array( $key, $change_settings ) ) { $validate_function = $key . '_validate'; if ( isset( $val[ 'option_value' ] ) ) { $raindrops_color_default_val = $validate_function( $val[ 'option_value' ] ); raindrops_update_theme_option( $key, $raindrops_color_default_val ); } } } } } } add_action( 'customize_save_after', 'raindrops_reset_custom_color' ); /** * * * * @since 1.127 */ if ( !function_exists( 'raindrops_detect_display_none_condition' ) ) { function raindrops_detect_display_none_condition() { global $raindrops_where_display_none; if ( !isset( $raindrops_where_display_none ) ) { $raindrops_display_none_pages = array(); if ( raindrops_warehouse_clone( 'raindrops_entry_content_is_home' ) == 'none' ) { $raindrops_display_none_pages[] = 'is_home'; } if ( raindrops_warehouse_clone( 'raindrops_entry_content_is_category' ) == 'none' ) { $raindrops_display_none_pages[] = 'is_category'; } if ( raindrops_warehouse_clone( 'raindrops_entry_content_is_search' ) == 'none' ) { $raindrops_display_none_pages[] = 'is_search'; } $raindrops_where_display_none = $raindrops_display_none_pages; } if ( !empty( $raindrops_where_display_none ) && is_array( $raindrops_where_display_none ) ) { foreach ( $raindrops_where_display_none as $excerpt ) { if ( true == $excerpt() ) { return true; } } } return false; } } /** * Custom image header * $raindrops_custom_header_args */ add_filter( 'raindrops_header_image_width', 'raindrops_responsive_width_ajust' ); add_filter( 'raindrops_header_image_height', 'raindrops_responsive_height_ajust' ); if ( !isset( $raindrops_custom_header_args ) ) { $raindrops_custom_header_width = apply_filters( 'raindrops_header_image_width', absint( raindrops_detect_header_image_size_clone( 'width' ) ) ); $raindrops_custom_header_height = apply_filters( 'raindrops_header_image_height', absint( raindrops_detect_header_image_size_clone( 'height' ) ) ); $raindrops_current_style_type = raindrops_warehouse_clone( 'raindrops_style_type' ); $raindrops_custom_header_args = array( 'default-text-color' => raindrops_default_colors_clone( $raindrops_current_style_type, "header_textcolor", true ), 'width' => $raindrops_custom_header_width, 'flex-width' => true, 'height' => $raindrops_custom_header_height, 'flex-height' => true, 'header-text' => true, 'default-image' => '%1$s/images/headers/wp3.jpg', 'wp-head-callback' => apply_filters( 'raindrops_wp-head-callback', 'raindrops_embed_meta' ), ); add_theme_support( 'custom-header', apply_filters( 'raindrops_custom_header_args', $raindrops_custom_header_args ) ); /** * Add for WordPress 4.1 * @since 1.260 */ register_default_headers( array( 'raindrops' => array( 'url' => '%s/images/headers/wp3.jpg', 'thumbnail_url' => '%s/images/headers/wp3-thumbnail.jpg', ), ) ); } if ( !function_exists( 'raindrops_detect_excerpt_condition' ) ) { function raindrops_detect_excerpt_condition() { global $raindrops_where_excerpts, $post; if ( !isset( $raindrops_where_excerpts ) ) { $raindrops_excerpt_pages = array(); if ( raindrops_warehouse_clone( 'raindrops_entry_content_is_home' ) == 'excerpt' ) { $raindrops_excerpt_pages[] = 'is_home'; } if ( raindrops_warehouse_clone( 'raindrops_entry_content_is_category' ) == 'excerpt' ) { $raindrops_excerpt_pages[] = 'is_category'; } if ( raindrops_warehouse_clone( 'raindrops_entry_content_is_search' ) == 'excerpt' ) { $raindrops_excerpt_pages[] = 'is_search'; } $raindrops_where_excerpts = $raindrops_excerpt_pages; } if ( RAINDROPS_USE_LIST_EXCERPT !== true ) { return false; } if ( !empty( $raindrops_where_excerpts ) ) { foreach ( $raindrops_where_excerpts as $excerpt ) { if ( true == $excerpt() ) { return true; } } } return false; } } if ( !defined( 'RAINDROPS_TABLE_TITLE' ) ) { define( "RAINDROPS_TABLE_TITLE", 'options' ); } if ( !defined( 'RAINDROPS_PLUGIN_TABLE' ) ) { define( 'RAINDROPS_PLUGIN_TABLE', $wpdb->prefix . RAINDROPS_TABLE_TITLE ); } if ( !isset( $raindrops_theme_settings ) ) { $raindrops_theme_settings = get_option( 'raindrops_theme_settings', 'no' ); } /** * widget settings * * Registered Default Sidebar, Extra Sidebar, Sticky Widget, Footer Widget, Category Blog Widget * * @since 1.119 Widget label change from Category Blog Widget to Status Sidebar * */ if ( !function_exists( 'raindrops_widgets_init' ) ) { function raindrops_widgets_init() { register_sidebar( array( 'name' => esc_html__( 'Default Sidebar', 'raindrops' ), 'id' => 'sidebar-1', 'before_widget' => '
  • ', 'after_widget' => '
  • ', 'before_title' => '

    ', 'after_title' => '

    ', 'widget_id' => 'default', 'widget_name' => 'default', 'text' => "1" ) ); register_sidebar( array( 'name' => esc_html__( 'Extra Sidebar', 'raindrops' ), 'id' => 'sidebar-2', 'before_widget' => '
  • ', 'after_widget' => '
  • ', 'before_title' => '

    ', 'after_title' => '

    ', 'widget_id' => 'extra', 'widget_name' => 'extra', 'text' => "2" ) ); register_sidebar( array( 'name' => esc_html__( 'Sticky Widget', 'raindrops' ), 'id' => 'sidebar-3', 'before_widget' => '
  • ', 'after_widget' => '
  • ', 'before_title' => '

    ', 'after_title' => '

    ', 'widget_id' => 'toppage2', 'widget_name' => 'toppage2', 'text' => "3" ) ); register_sidebar( array( 'name' => esc_html__( 'Footer Widget', 'raindrops' ), 'id' => 'sidebar-4', 'before_widget' => '', 'before_title' => '', 'widget_id' => 'footer', 'widget_name' => 'footer', 'text' => "4" ) ); register_sidebar( array( 'name' => esc_html__( 'Post Format Status Sidebar', 'raindrops' ), 'id' => 'sidebar-5', 'before_widget' => '
  • ', 'after_widget' => '
  • ', 'before_title' => '

    ', 'after_title' => '

    ', 'widget_id' => 'categoryblog', 'widget_name' => 'categoryblog', 'text' => "5" ) ); } } /** * * * * * @since 1.238 */ if ( isset( $raindrops_base_font_size ) ) { raindrops_update_theme_option( 'raindrops_basefont_settings', $raindrops_base_font_size ); } /** * @since 1.278 */ if ( raindrops_warehouse_clone( 'raindrops_show_right_sidebar' ) == 'hide' ) { $rsidebar_show = false; } else { $rsidebar_show = true; } if ( !isset( $raindrops_current_style_type ) ) { $raindrops_current_style_type = raindrops_warehouse_clone( "raindrops_style_type" ); } /** * Content width setup * * * * * */ if ( !isset( $content_width ) || empty( $content_width ) ) { $content_width = apply_filters( 'raindrops_content_width', raindrops_content_width_clone() ); } add_action( 'widgets_init', 'raindrops_widgets_init' ); /** * Add option helper * * * * * */ foreach ( $raindrops_base_setting as $setting ) { $function_name = $setting[ 'option_name' ] . '_validate'; if ( !function_exists( $function_name ) ) { $message = sprintf( esc_html__( 'If you add %s when you must create function %s for data validation', 'raindrops' ), $setting[ 'option_name' ], $function_name ); printf( '', $message ); return; } } /** * Extend body_class( ) * * * add browser class, languages class, * * */ if ( !function_exists( 'raindrops_add_body_class' ) ) { function raindrops_add_body_class( $classes ) { global $post, $current_blog, $raindrops_link_unique_text, $is_lynx, $is_gecko, $is_IE, $is_opera, $is_NS4, $is_safari, $is_chrome, $is_iphone, $raindrops_browser_detection, $raindrops_status_bar, $raindrops_current_column, $raindrops_setting_type; $raindrops_link_unique_text = raindrops_link_unique_text(); $classes[] = get_locale(); $keyboard_support = raindrops_enable_keyboard(); if ( 'enable' == $keyboard_support && true !== $raindrops_link_unique_text ) { $classes[] = 'enable-keyboard'; } /** * @since 1.415 */ if ( 'yes' == raindrops_warehouse_clone( 'raindrops_color_coded_category' ) ) { $classes[] = 'rd-cat-em'; } if ( 'yes' == raindrops_warehouse_clone( 'raindrops_color_coded_post_tag' ) ) { $classes[] = 'rd-tag-em'; } /** * @since 1.307 */ if ( is_home() ) { $raindrops_use_featured_image_emphasis = raindrops_warehouse_clone( 'raindrops_use_featured_image_emphasis' ); // yes no $raindrops_featured_image_position = raindrops_warehouse_clone( 'raindrops_featured_image_position' ); //left front $classes[] = 'rd-featured-' . $raindrops_use_featured_image_emphasis . '-' . $raindrops_featured_image_position; } /** * @since 1.289 */ $classes[] = sanitize_html_class( "rd-pw-" . raindrops_warehouse( 'raindrops_page_width' ) ); if ( is_child_theme() ) { raindrops_filter_page_column_control(); } if ( isset( $raindrops_current_column ) && !empty( $raindrops_current_column ) ) { $classes[] = sanitize_html_class( 'rd-col-' . $raindrops_current_column ); } /** * @1.401 */ if ( 'option' == $raindrops_setting_type ) { $customized = get_option( 'raindrops_theme_settings' ); if ( false == $customized ) { $raindrops_is_customized = 'default'; $classes[] = sanitize_html_class( 'rd-option-' . $raindrops_is_customized ); } } if ( is_single() || is_page() ) { $raindrops_style_type = raindrops_warehouse_clone( "raindrops_style_type" ); if ( isset( $raindrops_style_type ) && !empty( $raindrops_style_type ) ) { $color_type = sanitize_html_class( "rd-type-" . $raindrops_style_type ); } if ( false !== ($type = raindrops_has_indivisual_notation() ) ) { if ( isset( $type[ 'color_type' ] ) && 'dark' == $type[ 'color_type' ] ) { $color_type = sanitize_html_class( "rd-type-" . $type[ 'color_type' ] ); } } if ( !isset( $color_type ) ) { // When not using database $color_type = sanitize_html_class( "rd-type-" . raindrops_warehouse( 'raindrops_style_type' ) ); } $classes[] = $color_type; } else { $raindrops_style_type = raindrops_warehouse_clone( "raindrops_style_type" ); if ( isset( $raindrops_style_type ) && !empty( $raindrops_style_type ) ) { $classes[] = sanitize_html_class( "rd-type-" . $raindrops_style_type ); } } if ( true == $raindrops_browser_detection ) { $blowser_lang = raindrops_get_accept_language(); if ( !empty( $blowser_lang ) ) { $browser_lang = 'accept-lang-' . $blowser_lang; $classes[] = sanitize_html_class( $browser_lang ); } switch ( true ) { case ( $is_lynx ): $classes[] = 'lynx'; break; case ( $is_gecko ): $classes[] = 'gecko'; break; case ( $is_IE ): $http_user_agent = filter_input( INPUT_ENV, 'HTTP_USER_AGENT' ); if ( preg_match( '!Trident/.*rv:([0-9]{1,}\.[\.0-9]{0,})!', $http_user_agent, $regs ) ) { $classes[] = sanitize_html_class( 'ie' . (int) $regs[ 1 ] ); } preg_match( "|(MSIE )([0-9]{1,2})(\.)|si", $http_user_agent, $regs ); if ( isset( $regs[ 2 ] ) ) { $classes[] = sanitize_html_class( 'ie' . $regs[ 2 ] ); } break; case ( $is_opera ): $classes[] = 'opera'; break; case ( $is_NS4 ): $classes[] = 'ns4'; break; case ( $is_safari ): $classes[] = 'safari'; break; case ( $is_chrome ): $classes[] = 'chrome'; break; case ( $is_iphone ): $classes[] = 'iphone'; break; default: $classes[] = 'unknown2'; break; } } if ( isset( $current_blog ) ) { $classes[] = "b" . absint( $current_blog->blog_id ); } if ( true == $raindrops_link_unique_text ) { $classes[] = 'raindrops-accessible-mode'; } if ( !isset( $raindrops_status_bar ) ) { $raindrops_status_bar = raindrops_warehouse_clone( 'raindrops_status_bar' ); if ( 'show' == $raindrops_status_bar ) { $raindrops_status_bar = true; } else { $raindrops_status_bar = false; } } if ( isset( $raindrops_status_bar ) && $raindrops_status_bar == true ) { $classes[] = 'raindrops-status-bar-active'; } return apply_filters( "raindrops_add_body_class", $classes ); } } /** * wp_list_comments callback function * * * * comments.php * */ if ( !function_exists( 'raindrops_comment' ) ) { function raindrops_comment( $comment, $args, $depth ) { $GLOBALS[ 'comment' ] = $comment; if ( '' == $comment->comment_type ) { ?>
  • id="li-comment-">
    %1$s
    ', get_avatar( $comment, 160, '', esc_attr__( 'Avatar', 'raindrops' ) . ' ' . esc_attr( strip_tags( get_comment_author_link() ) ) ) ); } ?>
    %2$s', sprintf( '%s ', get_comment_author_link() ), esc_html__( 'says:', 'raindrops' ) ); ?>
    comment_approved ) { ?>

    comment_ID ); comment_reply_link( array_merge( $args, array( 'reply_text' => $raindrops_comment_reply_text, 'depth' => $depth, 'max_depth' => $args[ 'max_depth' ] ) ) ); ?>
  • comment_ID ), ' ' ); ?>

    ID ) && is_singular() && true == $raindrops_allow_share_link && !$is_IE ) { $id = absint( $post->ID ); $title = urlencode( get_the_title( $id ) ); $url = urlencode( esc_url( get_permalink( $id ) ) ); $array_options = array( ' - - - ' => array( 'type' => '', 'url' => '', 'icon' => '' ), 'tweet' => array( 'type' => 'link', 'url' => 'https://twitter.com/intent/tweet?text=%title%&url=%url%', 'icon' => '' ), 'html' => array( 'type' => 'data', 'url' => 'data:text', 'icon' => '' ) ); $array_options = apply_filters( 'raindrops_add_share_link_args', $array_options ); $select = '
    '; $option = '' . "\n"; $i = 0; $options = ''; foreach ( $array_options as $key => $val ) { $replaced_url = str_replace( array( '%title%', '%url%' ), array( $title, $url ), $val[ 'url' ] ); if ( 'link' == $val[ 'type' ] ) { $replaced_url = esc_url( $replaced_url ); } elseif ( 'data' == $val[ 'type' ] ) { $replaced_url = esc_html( $val[ 'url' ] ); } else { $replaced_url = ''; } $icon = esc_html( $val[ 'icon' ] ); $post_class = 'share-link ' . sanitize_html_class( $key, 'share-' . $i ); $options .= sprintf( $option, $replaced_url, $key, $post_class, $icon ); $i++; } $result = sprintf( $select, $options ); return $posted_in . apply_filters( 'raindrops_add_share_link', $result ); } return $posted_in; } } /** * Template function posted in * * * * loop.php * */ if ( !function_exists( 'raindrops_posted_in' ) ) { function raindrops_posted_in() { $exclude_category_conditionals = apply_filters( 'raindrops_posted_in_category', array( 'is_category' => 'raindrops_post_category_relation' ) ); $exclude_tag_conditional = apply_filters( 'raindrops_posted_in_tag', array( 'is_tag' => '' ) ); global $post, $raindrops_tag_emoji, $raindrops_category_emoji; if ( is_sticky() ) { return; } $format = get_post_format( $post->ID ); $tag_list = raindrops_get_the_posted_in_tag( '', ' ' ); $categories_list = raindrops_get_the_posted_in_category( ' ' ); if ( !empty( $exclude_category_conditionals ) && is_array( $exclude_category_conditionals ) ) { foreach ( $exclude_category_conditionals as $key => $conditional ) { if ( function_exists( $key ) && true == $key() ) { if ( empty( $conditional ) ) { $categories_list = ''; } elseif ( function_exists( $conditional ) ) { $categories_list = $conditional(); } } } } if ( !empty( $exclude_tag_conditionals ) && is_array( $exclude_tag_conditionals ) ) { foreach ( $exclude_tag_conditionals as $key => $conditional ) { if ( function_exists( $key ) && true == $key() ) { if ( empty( $conditional ) ) { $tag_list = ''; } elseif ( function_exists( $conditional ) ) { $tag_list = $conditional(); } } } } if ( 'emoji' == raindrops_warehouse_clone( 'raindrops_posted_in_label' ) ) { $category_label = $raindrops_category_emoji . '' . esc_html__( 'This entry was posted in', 'raindrops' ) . ''; $tag_label = $raindrops_tag_emoji . '' . esc_html__( 'and tagged', 'raindrops' ) . ''; $categories = wp_get_post_categories( $post->ID ); $categories_count = count( $categories ); $default_category_id = absint( get_option( 'default_category' ) ); $raindrops_display_default_category = raindrops_warehouse_clone( 'raindrops_display_default_category' ); if ( $categories_count == 1 && absint( $categories[ 0 ] ) == absint( $default_category_id ) && 'show' !== $raindrops_display_default_category ) { $category_label = ''; } if ( is_category() ) { $category_label = ''; } } else { $category_label = esc_html__( 'This entry was posted in', 'raindrops' ); $tag_label = esc_html__( 'and tagged', 'raindrops' ); } if ( false === $format ) { if ( $tag_list ) { $posted_in = '' . $category_label . ' %1$s ' . $tag_label . ' %2$s '; } elseif ( is_object_in_taxonomy( get_post_type(), 'category' ) ) { $posted_in = '' . $category_label . ' %1$s '; } else { $posted_in = ''; } $result = $format . sprintf( $posted_in, $categories_list, $tag_list ); echo apply_filters( "raindrops_posted_in", $result ); } else { if ( $tag_list ) { $posted_in = '' . $category_label . ' %1$s ' . $tag_label . ' %2$s ' . ' %4$s %5$s'; } elseif ( is_object_in_taxonomy( get_post_type(), 'category' ) ) { $posted_in = '' . $category_label . ' %1$s %2$s' . ' %4$s %5$s'; } else { $posted_in = ' %4$s %5$s'; } $result = sprintf( $posted_in, $categories_list, $tag_list, esc_url( get_post_format_link( $format ) ), esc_html( 'Format', 'raindrops' ), get_post_format_string( $format ) ); echo apply_filters( "raindrops_posted_in", $result ); } edit_post_link( esc_html__( 'Edit', 'raindrops' ) . raindrops_link_unique( 'Post', $post->ID ), '', '' ); raindrops_delete_post_link( esc_html__( 'Trash', 'raindrops' ) . raindrops_link_unique( 'Post', $post->ID ), '', '' ); } } /** * Template function raindrops_comments_link * * * * loop.php * @since 1.163 */ if ( !function_exists( 'raindrops_comments_link' ) ) { function raindrops_comments_link() { if ( comments_open() ) { $raindrops_comment_html = '%2$s %3$s'; if ( get_comments_number() > 0 ) { $raindrops_comment_string = _n( 'Comment', 'Comments', get_comments_number(), 'raindrops' ) . raindrops_link_unique( 'Post', get_the_ID() ); $raindrops_comment_number = get_comments_number(); } else { $raindrops_comment_string = __( 'Comment ', 'raindrops' ) . raindrops_link_unique( 'Post', get_the_ID() ); $raindrops_comment_number = ''; } } else { $raindrops_comment_html = ''; $raindrops_comment_string = ''; $raindrops_comment_number = ''; } $result = sprintf( $raindrops_comment_html, get_comments_link(), $raindrops_comment_number, $raindrops_comment_string ); return apply_filters( 'raindrops_comments_link', $result, get_comments_link(), $raindrops_comment_number, $raindrops_comment_string ); } } if ( !function_exists( 'raindrops_post_author' ) ) { /** * loop * @global type $post * @return type * @since 1.272 */ function raindrops_post_author() { global $post; $author = raindrops_blank_fallback( get_the_author(), 'Somebody' ); $author_attr_title_string = sprintf( esc_attr__( 'View all posts by %s', 'raindrops' ), wp_kses( $author, array() ) ); $author_html = '%3$s '; if ( "avatar" == raindrops_warehouse_clone( 'raindrops_display_article_author' ) ) { $author = get_avatar( get_the_author_meta( 'ID' ), 24 ) . '' . $author . ''; } $author_html = sprintf( $author_html, get_author_posts_url( get_the_author_meta( 'ID' ) ), $author_attr_title_string, $author ); $author_html = apply_filters( 'raindrops_post_author', $author_html ); return $author_html; } } if ( !function_exists( 'raindrops_post_date' ) ) { /** * loop * @global type $post * @return type * @since1.272 */ function raindrops_post_date() { global $post, $raindrops_posted_on_date_emoji; $entry_date_html = '<%4$s class="entry-date updated" %5$s>%3$s'; $archive_year = get_the_time( 'Y' ); $archive_month = get_the_time( 'm' ); $archive_day = get_the_time( 'd' ); $day_link = esc_url( get_day_link( $archive_year, $archive_month, $archive_day ) . '#post-' . $post->ID ); $raindrops_date_format = get_option( 'date_format' ) . ' ' . get_option( 'time_format' ); $date_text = get_the_date( $raindrops_date_format ); if ( 'emoji' == raindrops_warehouse_clone( 'raindrops_display_article_publish_date' ) ) { $date_text = '' . $raindrops_posted_on_date_emoji . '' . $date_text . ''; } $entry_date_html = sprintf( $entry_date_html, $day_link, esc_attr( 'archives daily ' . get_the_date( $raindrops_date_format ) ), $date_text, raindrops_doctype_elements( 'span', 'time', false ), raindrops_doctype_elements( '', 'datetime="' . esc_attr( get_the_date( 'c' ) ) . '"', false ) ); $entry_date_html = apply_filters( 'raindrops_post_date', $entry_date_html, $date_text, absint( $post->ID ) ); return $entry_date_html; } } /** * Template function posted_on * * * * loop.php * */ if ( !function_exists( 'raindrops_posted_on' ) ) { function raindrops_posted_on() { global $post; $called_function = __FUNCTION__; $author_html = apply_filters( 'raindrops_post_author', raindrops_post_author(), $called_function ); $entry_date_html = apply_filters( 'raindrops_post_date', raindrops_post_date(), $called_function ); $posted_on_comment_link = ''; if ( !is_attachment() ) { /** * @1.404 * Customize / Advanced / Show Attach to Post Date and Author in Attachment * No needs comments link when attachment page */ $posted_on_comment_link = apply_filters( 'raindrops_comments_link', raindrops_comments_link(), $called_function ); } $result = ' %1$s %2$s %3$s %4$s %5$s'; $result = apply_filters( 'raindrops_posted_on_result', $result ); $posted_on_string = ''; if ( !empty( $entry_date_html ) ) { /** * @1.404 */ if ( is_attachment() ) { $posted_on_string = esc_html__( 'Attached to Post on', 'raindrops' ); } elseif ( is_page() ) { $posted_on_string = esc_html__( 'Created on', 'raindrops' ); } else { $posted_on_string = esc_html__( 'Posted on', 'raindrops' ); } } $posted_by_string = ''; if ( !empty( $entry_date_html ) ) { $posted_by_string = esc_html__( 'by', 'raindrops' ); } $result = sprintf( $result, $posted_on_string, $entry_date_html, $posted_by_string, $author_html, $posted_on_comment_link ); $result = raindrops_remove_empty_span( $result ); $format = get_post_format(); $content_empty_check = ''; if ( isset( $post ) ) { $content_empty_check = trim( get_the_content() ); } if ( false === $format ) { echo apply_filters( "raindrops_posted_on", $result ); } elseif ( empty( $content_empty_check ) ) { echo $posted_on_comment_link; } else { echo apply_filters( "raindrops_posted_on", $result ); } } } /** * Special custom fields key css, javascript, metatags * * * css,javascrip,meta is separated anothor Custom Field. * * */ if ( !function_exists( 'raindrops_filter_explode_meta_keys' ) ) { function raindrops_filter_explode_meta_keys( $content, $key ) { $explode_keys = array( 'css', 'javascript', 'meta' ); if ( in_array( $key, $explode_keys ) ) { return; } else { return $content; } } } /** * Like a get_option( ) * * * Raindrops conditional response. * * for templates */ if ( !function_exists( 'raindrops_warehouse' ) ) { function raindrops_warehouse( $name, $property = false, $fallback = false ) { return apply_filters( "raindrops_warehouse", raindrops_warehouse_clone( $name, $property, $fallback ) ); } } /** * Return $raindrops_base_setting value. * * * * * */ if ( !function_exists( 'raindrops_admin_meta' ) ) { function raindrops_admin_meta( $name, $meta_name ) { global $raindrops_base_setting, $raindrops_page_width; $raindrops_current_data = wp_get_theme(); $raindrops_current_data_version = $raindrops_current_data->get( 'Version' ); $raindrops_current_theme_name = $raindrops_current_data->get( 'Name' ); /** * Theme version trainsitional setting * Note: Maybe remove new version live */ if ( version_compare( $raindrops_current_data_version, '1.356.1', '<=' ) && 'boots' == $raindrops_current_theme_name ) { return apply_filters( 'raindrops_admin_meta', raindrops_admin_meta_transitional( $name, $meta_name ) ); } if ( version_compare( $raindrops_current_data_version, '1.216', '<=' ) && 'puddle' == $raindrops_current_theme_name ) { return apply_filters( 'raindrops_admin_meta', raindrops_admin_meta_transitional( $name, $meta_name ) ); } return apply_filters( 'raindrops_admin_meta', $raindrops_base_setting[ $name ][ $meta_name ] ); } } if ( !function_exists( 'raindrops_admin_meta_transitional' ) ) { function raindrops_admin_meta_transitional( $name, $meta_name ) { global $raindrops_base_setting, $raindrops_page_width; $vertical = array(); foreach ( $raindrops_base_setting as $key => $val ) { if ( !is_null( $raindrops_base_setting ) ) { $vertical[] = $val[ 'option_name' ]; } } $row = array_search( $name, $vertical ); return $raindrops_base_setting[ $row ][ $meta_name ]; } } /** * Admin Panel help * * * * * */ if ( !function_exists( 'raindrops_settings_page_contextual_help' ) ) { function raindrops_settings_page_contextual_help() { global $raindrops_current_data; $html = '
    %1$s
    %2$s
    '; $link = '%2$s'; $content = ''; /* theme URI */ $content .= sprintf( $html, esc_html__( 'Theme URI', 'raindrops' ), sprintf( $link, $raindrops_current_data->get( 'ThemeURI' ), $raindrops_current_data->get( 'ThemeURI' ), 'target="_self"' ) ); /* AuthorURI */ $content .= sprintf( $html, esc_html__( 'Author', 'raindrops' ), sprintf( $link, $raindrops_current_data->get( 'AuthorURI' ), $raindrops_current_data->get( 'Author' ), 'target="_self"' ) ); /* Support */ $content .= sprintf( $html, esc_html__( 'Support', 'raindrops' ), sprintf( $link, 'http://wordpress.org/support/theme/raindrops', esc_html__( 'http://wordpress.org/support/theme/raindrops', 'raindrops' ), 'target="_blank"' ) . '
    ' . sprintf( $link, 'http://ja.forums.wordpress.org/', esc_html__( 'http://ja.forums.wordpress.org/ lang:Japanese', 'raindrops' ), 'target="_blank"' ) ); /* Version */ $content .= sprintf( $html, esc_html__( 'Version', 'raindrops' ), $raindrops_current_data->get( 'Version' ) ); /* Changelog.txt */ $content .= sprintf( $html, esc_html__( 'Change log text', 'raindrops' ), sprintf( $link, get_template_directory_uri() . '/changelog.txt', esc_html__( 'Changelog , display new window', 'raindrops' ), 'target="_blank"' ), 'target = "_blank"' ); /* readme.txt */ $content .= sprintf( $html, esc_html__( 'Readme text', 'raindrops' ), sprintf( $link, get_template_directory_uri() . '/README.txt', esc_html__( 'Readme , display new window', 'raindrops' ), 'target="_blank"' ) ); $content = '
    ' . $content . '
    '; return $content; } } if ( !function_exists( 'raindrops_editor_page_contextual_help' ) ) { function raindrops_editor_page_contextual_help() { global $raindrops_current_data; $html = '
    %1$s
    %2$s
    '; $link = '%2$s'; $content = ''; $content .= sprintf( $html, esc_html__( 'Support', 'raindrops' ), sprintf( $link, 'http://wordpress.org/support/theme/raindrops', esc_html__( 'English', 'raindrops' ), 'target="_blank"' ) . '
    ' . sprintf( $link, 'http://ja.forums.wordpress.org/', esc_html__( 'Japanese', 'raindrops' ), 'target="_blank"' ) ); $help = '

    ' . esc_html__( 'How to remove Site Title Block', 'raindrops' ) . '

    #hd{display:none;}
    '; $help .= '

    ' . esc_html__( 'How to remove Post Author Name', 'raindrops' ) . '

    .posted-by-string,.author{display:none;}
    '; $help .= '

    ' . esc_html__( 'How to remove Entry Date', 'raindrops' ) . '

    .posted-on-string,.entry-date{display:none;}
    '; $help .= '

    ' . esc_html__( 'How to remove Entry Meta', 'raindrops' ) . '

    .entry-meta{display:none;}
    '; $help .= '

    ' . esc_html__( 'How to remove Archive Title Label[ like Category Archives ]', 'raindrops' ) . '

    #archives-title .label{display:none;}
    '; $help .= '

    ' . esc_html__( 'How to remove Home list above next prev navigation link', 'raindrops' ) . '

     #nav-above{ display:none;}
    '; $help .= '

    ' . esc_html__( 'above codes paste style.css last. If not change when Version value change ( line:9 )', 'raindrops' ) . '

    '; $help = wpautop( $help ); $content = '
    ' . $content . $help . '
    '; return $content; } } /** * Raindrops edit help * * * Check the real color of the Cradation Class and the Color Class. * * */ if ( !function_exists( 'raindrops_edit_help' ) ) { function raindrops_edit_help( $text, $force = false ) { global $post_type_object; global $title; if ( RAINDROPS_USE_AUTO_COLOR !== true && $force !== true ) { return $text; } if ( ( isset( $post_type_object ) && ( $title == $post_type_object->labels->add_new_item || $title == $post_type_object->labels->edit_item ) || true == $force ) ) { $result = "

    " . esc_html__( 'Tips', 'raindrops' ) . '

    '; $result .= '

    ' . esc_html__( 'If Raindrops Options panel is opened, and the reference color is set, this arrangement of color is changed at once.', 'raindrops' ) . "

    "; $result .= "

    " . esc_html__( 'Dinamic Color Class', 'raindrops' ) . '

    '; $result .= '
    class color5 class color4 class color3 class color2 class color1
    class color-1 class color-2 class color-3 class color-4 class color-5
    ' . esc_html__( 'code example:please HTML editor mode', 'raindrops' ) . '
    <div class="color-1"> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum</div>
    '; $result .= "

    " . esc_html__( 'Dinamic Gradient Class', 'raindrops' ) . '

    '; $result .= '
    class gradient1 class gradient2 class gradient3 class gradient4
    class gradient-1 class gradient-2 class gradient-3 class gradient-4
    ' . esc_html__( 'code example:please HTML editor mode', 'raindrops' ) . '
    <div class="gradient-1">

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

    </div>
    '; $result .= "

    " . esc_html__( 'Font Size CSS Class', 'raindrops' ) . '

    '; $result .= "

    " . esc_html__( 'Classes', 'raindrops' ) . '

    '; $result .= "

    " . esc_html__( 'f10 , f11 , f12 , f13 , f14 , f15 , f16 , f17 , f18 , f19 , f20 , f21 , f22 , f23 , f24 , f25 , f26', 'raindrops' ) . "

    <p class=\"f16\">Font Size 16px</p>
    "; $result .= "
    "; $result .= "

    " . esc_html__( 'Google Fonts Family CSS Class', 'raindrops' ) . '

    '; $result .= "

    " . esc_html__( 'Classes', 'raindrops' ) . '

    '; $result .= "

    " . esc_html__( 'Note, More than 90 percent of the Google font can be used, but there are some limitations.', 'raindrops' ) . "

    "; $result .= "

    " . esc_html__( 'Examples of the no corresponding font', 'raindrops' ) . "

    Fredericka the Great ( The first character is lowercase word ) 
    "; $result .= "

    " . esc_html__( 'Examples of the corresponding font', 'raindrops' ) . "

    Open Sans Condensed ( font name has 0 - 2 spaces ) 
    "; $result .= "

    " . esc_html__( 'How to specify the font', 'raindrops' ) . "

    Open Sans: <p class=\"google-font-open-sans\">Open Sans</p>
    "; $result .= "

    " . esc_html__( 'Add prefix google-font- + Font name lowercase and change to - the space', 'raindrops' ) . "

    "; $result .= "

    " . esc_html__( 'How to specify the font weight', 'raindrops' ) . "

    Open Sans EXTRA-BOLD800: <p class=\"google-font-open-sans800\">Open Sans</p>
    "; $result .= "

    " . esc_html__( 'How to specify the font style', 'raindrops' ) . "

    Open Sans EXTRA-BOLD800 Italic: <p class=\"google-font-open-sans800i\">Open Sans</p>
    "; $result .= "
    "; $result .= "

    " . esc_html__( 'Example of Custom CSS Meta Box Style Rules', 'raindrops' ) . '

    '; $result .= "

    " . esc_html__( 'Styling Entry Title', 'raindrops' ) . '

    '; $result .= "

    " . esc_html__( 'Change entry title color', 'raindrops' ) . "

    .entry-title span{ color:red; }
    "; $result .= "

    " . esc_html__( 'Styling Posted on', 'raindrops' ) . '

    '; $result .= "

    " . esc_html__( 'hide posted on from all post', 'raindrops' ) . "

     .posted-on, .entry-meta-default{ display:none;}
    "; $result .= "

    " . esc_html__( 'Styling Posted in', 'raindrops' ) . '

    '; $result .= "

    " . esc_html__( 'hide posted in', 'raindrops' ) . "

     .entry-meta{ display:none;}
    "; $result .= "

    " . esc_html__( 'Styling Article', 'raindrops' ) . '

    '; $result .= "

    " . esc_html__( 'add border and padding', 'raindrops' ) . "

    article {border:1px solid red;padding:1em;}
    " . "

    " . esc_html__( 'note:article elements and post_class () You can use all of the elements to be output.', 'raindrops' ) . "

    "; $result .= "
    "; $result .= $text; return $result; } else { return $text; } } } /** * Create admin panel form and define input value. * * * * */ if ( !function_exists( 'raindrops_options_init' ) ) { function raindrops_options_init() { global $raindrops_base_setting; if ( isset( $raindrops_base_setting ) ) { foreach ( $raindrops_base_setting as $setting ) { register_setting( 'raindrop_options', $setting[ 'option_name' ], $setting[ 'validate' ] ); } } } } /** * internal function File upload * * * @param $embed string inline or external or embed * @param $id #hd or #ft */ if ( !function_exists( 'raindrops_upload_image_parser' ) ) { function raindrops_upload_image_parser( $uri, $embed = "inline", $id = "#hd" ) { /* upload image from raindrops admin panel saved filename * e.g. raindrops-item-header-style-no-repeat-top-0-left-0-aomoriken.jpg * filename parse and create style */ $upload_info = wp_upload_dir(); $filename = basename( $uri ); if ( file_exists( get_stylesheet_directory() . '/images/' . $filename ) ) { if ( '#hd' == $id ) { if ( !file_exists( $upload_info[ 'path' ] . '/' . $filename ) ) { return apply_filters( 'raindrops_upload_image_parser_hd', 'background:url( ' . get_stylesheet_directory_uri() . '/images/' . $filename . ' );background-repeat:repeat-x;' ); } } elseif ( '#ft' == $id ) { if ( !file_exists( $upload_info[ 'path' ] . '/' . $filename ) ) { return apply_filters( 'raindrops_upload_image_parser_ft', 'background:url( ' . get_stylesheet_directory_uri() . '/images/' . $filename . ' );background-repeat:repeat-x;' ); } } } elseif ( file_exists( get_template_directory() . '/images/' . $filename ) ) { if ( '#hd' == $id ) { if ( !file_exists( $upload_info[ 'path' ] . '/' . $filename ) ) { return apply_filters( 'raindrops_upload_image_parser_hd', 'background:url( ' . get_template_directory_uri() . '/images/' . $filename . ' );background-repeat:repeat-x;' ); } } elseif ( '#ft' == $id ) { if ( !file_exists( $upload_info[ 'path' ] . '/' . $filename ) ) { return apply_filters( 'raindrops_upload_image_parser_ft', 'background:url( ' . get_template_directory_uri() . '/images/' . $filename . ' );background-repeat:repeat-x;' ); } } } if ( file_exists( $upload_info[ 'path' ] . '/' . $filename ) ) { $top = ''; $left = ''; $height = ''; $style = ''; preg_match( "|raindrops-item-([^-]+)|", $filename, $regs ); if ( isset( $regs[ 1 ] ) ) { $purpose = $regs[ 1 ]; $purpose = str_replace( array( "header", "footer" ), array( "#hd", "#ft" ), $purpose ); } preg_match( "|-style-([^-]+)|", $filename, $regs ); if ( isset( $regs[ 1 ] ) ) { $style = $regs[ 1 ]; $style = str_replace( array( 'no', 'x' ), array( 'no-', '-x' ), $style ); } preg_match( "|-top-(-?[^-]+)|", $filename, $regs ); if ( isset( $regs[ 1 ] ) ) { $top = $regs[ 1 ]; } preg_match( "|-left-(-?[^-]+)|", $filename, $regs ); if ( isset( $regs[ 1 ] ) ) { $left = $regs[ 1 ]; } preg_match( "|-height-([^-]+)|", $filename, $regs ); if ( isset( $regs[ 1 ] ) ) { $height = $regs[ 1 ]; } if ( 'inline' == $embed ) { return apply_filters( 'raindrops_upload_image_parser_prop', 'background:url( ' . $uri . ' );background-repeat:' . $style . ';background-position:' . $left . 'px ' . $top . 'px;min-height:' . $height . 'px;' ); } elseif ( 'external' == $embed || 'embed' == $embed ) { return apply_filters( 'raindrops_upload_image_parser_prop', $purpose . '{background:url( ' . $uri . ' );background-repeat:' . $style . ';background-position:' . $left . 'px ' . $top . 'px;min-height:' . $height . 'px;}' ); } else { return; } } return false; } } /** * Alias function Show real gradient where admin panel help * * * * * return string inline style rule what gradient */ if ( !function_exists( 'raindrops_gradient_single' ) ) { function raindrops_gradient_single( $i, $order = "asc" ) { return apply_filters( "raindrops_gradient_single", raindrops_gradient_single_clone( $i, $order ) ); } } /** * Alias function Create gradient style rule * * * * return string embed header current style rule set what gradient */ if ( !function_exists( 'raindrops_gradient' ) ) { function raindrops_gradient( $selector ) { return apply_filters( "raindrops_gradient", raindrops_gradient_clone( $selector ) ); } } if ( !function_exists( "raindrops_add_stylesheet" ) ) { function raindrops_add_stylesheet() { global $raindrops_current_theme_name, $raindrops_current_data_version, $raindrops_css_auto_include, $raindrops_fallback_human_interface_show, $raindrops_tooltip, $wp_scripts, $raindrops_minified_suffix, $raindrops_load_minified_css_js; /* @1.333 */ if ( true == $raindrops_fallback_human_interface_show ) { $fallback_style = get_template_directory_uri() . '/fallback.css'; wp_register_style( 'fallback_style', $fallback_style, array(), $raindrops_current_data_version, 'all' ); wp_enqueue_style( 'fallback_style' ); return; } if ( false !== ( $url = raindrops_locate_url( 'reset-fonts-grids.css' ) ) ) { wp_register_style( 'raindrops_reset_fonts_grids', $url, array(), $raindrops_current_data_version, 'all' ); wp_enqueue_style( 'raindrops_reset_fonts_grids' ); } if ( false !== ( $url = raindrops_locate_url( 'grids.css' ) ) ) { wp_register_style( 'raindrops_grids', $url, array( 'raindrops_reset_fonts_grids' ), $raindrops_current_data_version, 'all' ); wp_enqueue_style( 'raindrops_grids' ); } if ( false !== ( $url = raindrops_locate_url( 'fonts.css' ) ) ) { wp_register_style( 'raindrops_fonts', $url, array( 'raindrops_grids' ), $raindrops_current_data_version, 'all' ); wp_enqueue_style( 'raindrops_fonts' ); } $style_filename = 'languages/css/' . get_locale() . '.css'; if ( false !== ( $url = raindrops_locate_url( $style_filename ) ) ) { wp_register_style( 'lang_style', $url, array( 'raindrops_fonts' ), $raindrops_current_data_version, 'all' ); wp_enqueue_style( 'lang_style' ); } if ( raindrops_warehouse_clone( "raindrops_style_type" ) !== 'w3standard' ) { if ( false !== ( $url = raindrops_locate_url( 'css3.css' ) ) ) { wp_register_style( 'raindrops_css3', $url, array( 'raindrops_fonts' ), $raindrops_current_data_version, 'all' ); wp_enqueue_style( 'raindrops_css3' ); } } if ( $raindrops_css_auto_include == true ) { $style_filename = get_template_directory_uri() . '/style.css'; if ( file_exists( get_template_directory() . '/style' . $raindrops_minified_suffix . '.css' ) && true == $raindrops_load_minified_css_js ) { $style_filename = get_template_directory_uri() . '/style' . $raindrops_minified_suffix . '.css'; } wp_register_style( 'style', $style_filename, array( 'raindrops_fonts' ), $raindrops_current_data_version, 'all' ); wp_enqueue_style( 'style' ); } if ( is_child_theme() ) { $style_filename = get_stylesheet_directory_uri() . '/style.css'; if ( file_exists( get_stylesheet_directory() . '/style' . $raindrops_minified_suffix . '.css' ) && true == $raindrops_load_minified_css_js ) { $style_filename = get_stylesheet_directory_uri() . '/style' . $raindrops_minified_suffix . '.css'; } if ( $raindrops_css_auto_include == true ) { wp_register_style( 'child', $style_filename, array( 'style' ), $raindrops_current_data_version, 'all' ); wp_enqueue_style( 'child' ); } else { if ( raindrops_warehouse_clone( "raindrops_style_type" ) !== 'w3standard' ) { wp_register_style( 'child', $style_filename, array( 'raindrops_css3' ), $raindrops_current_data_version, 'all' ); wp_enqueue_style( 'child' ); } else { wp_register_style( 'child', $style_filename, array( 'lang_style' ), $raindrops_current_data_version, 'all' ); wp_enqueue_style( 'child' ); } } /** * When Using Child Theme, Parent rtl.css is not load, only load child themes load rtl.css * When not exists rtl.css at Child Theme, It should be automate include parent rtl.css * */ if ( is_rtl() ) { $rtl_css = raindrops_locate_url( 'rtl.css' ); wp_register_style( 'child-rtl', $rtl_css, array( 'style' ), $raindrops_current_data_version, 'all' ); wp_enqueue_style( 'child-rtl' ); } $depending_on_style = 'child'; } else { $depending_on_style = 'style'; } if ( raindrops_warehouse_clone( "raindrops_page_width" ) == 'doc3' || raindrops_warehouse_clone( "raindrops_page_width" ) == 'doc5' ) { if ( false !== ( $url = raindrops_locate_url( 'responsiveness.css' ) ) ) { wp_register_style( 'raindrops_responsiveness', $url, array( $depending_on_style ), $raindrops_current_data_version, 'all' ); wp_enqueue_style( 'raindrops_responsiveness' ); } } if ( false !== ( $url = raindrops_locate_url( 'raindrops.js' ) ) ) { wp_register_script( 'raindrops', $url, array( 'jquery', 'jquery-migrate', 'raindrops_helper_script' ), $raindrops_current_data_version, true ); wp_enqueue_script( 'raindrops' ); } raindrops_add_tooltip_script(); } } if ( !function_exists( "raindrops_add_tooltip_script" ) ) { /** * * @global type $raindrops_tooltip * @global type $wp_scripts * @since 1.417 */ function raindrops_add_tooltip_script() { global $raindrops_tooltip, $wp_scripts; if ( $raindrops_tooltip == true && 'yes' == raindrops_warehouse_clone( 'raindrops_tooltip' ) ) { wp_enqueue_script( 'jquery-ui-tooltip' ); $js = "jQuery(function() { jQuery( document ).tooltip({position: { my: 'center', at: 'top-30', collision: 'none' }}); });"; $wp_scripts->add_data( 'jquery-ui-tooltip', 'data', $js ); } } } if ( !function_exists( "raindrops_comment_form" ) ) { /** * filter function comment form * @global type $commenter * @param array $form * @return type */ function raindrops_comment_form( $form ) { global $commenter; $form[ 'url' ] = '

    ' . esc_html__( '( optional )', 'raindrops' ) . '

    '; return apply_filters( "raindrops_comment_form", $form ); } } /** * filter function remove area required * * * * */ if ( !function_exists( "raindrops_custom_remove_aria_required" ) ) { function raindrops_custom_remove_aria_required( $arg ) { global $raindrops_document_type; if ( $raindrops_document_type == 'xhtml' ) { $change = array( "aria-required=\"true\"", "aria-required='true'" ); $arg = str_replace( $change, '', $arg ); return $arg; } else { return $arg; } } } /** * Option value set when install. * * * * */ if ( !function_exists( "setup_raindrops" ) ) { function setup_raindrops() { global $wpdb, $raindrops_base_setting; if ( false == RAINDROPS_USE_AUTO_COLOR ) { return; } $raindrops_theme_settings = get_option( 'raindrops_theme_settings' ); foreach ( $raindrops_base_setting as $add ) { $option_name = $add[ 'option_name' ]; if ( !isset( $raindrops_theme_settings[ $option_name ] ) ) { $raindrops_theme_settings[ $option_name ] = $add[ 'option_value' ]; } } $style_type = raindrops_warehouse_clone( "raindrops_style_type" ); $raindrops_indv_css = raindrops_design_output_clone( $style_type ) . raindrops_color_base_clone(); $raindrops_theme_settings[ '_raindrops_indv_css' ] = $raindrops_indv_css; update_option( 'raindrops_theme_settings', $raindrops_theme_settings, "", $add[ 'autoload' ] ); if ( file_exists( get_stylesheet_directory() . '/images/headers/wp3.jpg' ) ) { $raindrops_site_image = get_stylesheet_directory_uri() . '/images/headers/wp3.jpg'; $raindrops_site_thumbnail_image = get_stylesheet_directory_uri() . '/images/headers/wp3-thumbnail.jpg'; } else { $raindrops_site_image = get_template_directory_uri() . '/images/headers/wp3.jpg'; $raindrops_site_thumbnail_image = get_template_directory_uri() . '/images/headers/wp3-thumbnail.jpg'; } set_theme_mod( 'default-image', $raindrops_site_image ); } } /** * image element has attribute 'width','height' and image size > column width * style max-width value 100% set when expand height height attribute value. * * IE filter * */ if ( !function_exists( "raindrops_ie_height_expand_issue" ) ) { function raindrops_ie_height_expand_issue( $content ) { global $is_IE, $content_width; if ( $is_IE ) { preg_match_all( '#(]+)(height|width)(=")([0-9]+)"([^>]+)(height|width)(=")([0-9]+)"([^>]*)>#', $content, $images, PREG_SET_ORDER ); foreach ( $images as $image ) { if ( ( "width" == $image[ 3 ] && $image[ 5 ] > $content_width ) || ( "width" == $image[ 7 ] && $image[ 9 ] > $content_width ) ) { $content = str_replace( $image[ 0 ], $image[ 1 ] . $image[ 2 ] . $image[ 6 ] . $image[ 10 ] . '>', $content ); } } return $content; } else { return $content; } } } /** * Raindrops once message when install. * * @1.425 This function will remove next version * * * */ /** if ( !function_exists( "raindrops_first_only_msg" ) ) { function raindrops_first_only_msg( $type = 0 ) { global $raindrops_current_theme_name; if ( 1 == $type ) { $query = 'raindrops_settings'; $link = get_site_url( '', 'wp-admin/themes.php', 'admin' ) . '?page=' . $query; } return '

    ' . $msg . '

    ' . "\n"; } } */ /** * Management of uninstall and install. * * * * ver 1.114 Theme data automatic change is supported at the time of site change. */ if ( !function_exists( "raindrops_install_navigation" ) ) { function raindrops_install_navigation() { global $raindrops_setting_type, $raindrops_current_theme_slug, $raindrops_current_theme_name; $install = get_option( 'raindrops_theme_settings' ); $upload_dir = wp_upload_dir(); if ( false == $install ) { } else { if ( isset( $install[ 'current_stylesheet_dir_url' ] ) && get_stylesheet_directory_uri() !== $install[ 'current_stylesheet_dir_url' ] ) { if ( isset( $install[ '_raindrops_indv_css' ] ) ) { $install[ '_raindrops_indv_css' ] = str_replace( $install[ 'current_stylesheet_dir_url' ], get_stylesheet_directory_uri(), $install[ '_raindrops_indv_css' ] ); } else { $install[ '_raindrops_indv_css' ] = ''; } $install[ 'old_stylesheet_dir_url' ] = $install[ 'current_stylesheet_dir_url' ]; $install[ 'current_stylesheet_dir_url' ] = get_stylesheet_directory_uri(); if ( 'option' == $raindrops_setting_type ) { update_option( 'raindrops_theme_settings', $install ); } if ( 'theme_mod' == $raindrops_setting_type ) { set_theme_mod( '_raindrops_indv_css', $install[ '_raindrops_indv_css' ] ); set_theme_mod( 'old_stylesheet_dir_url', esc_url( $install[ 'old_stylesheet_dir_url' ] ) ); set_theme_mod( 'current_stylesheet_dir_url', esc_url( $install[ 'current_stylesheet_dir_url' ] ) ); } } elseif ( !isset( $install[ 'current_stylesheet_dir_url' ] ) ) { $install[ 'current_stylesheet_dir_url' ] = get_stylesheet_directory_uri(); if ( 'option' == $raindrops_setting_type ) { update_option( 'raindrops_theme_settings', $install ); } if ( 'theme_mod' == $raindrops_setting_type ) { set_theme_mod( 'current_stylesheet_dir_url', esc_url( $install[ 'current_stylesheet_dir_url' ] ) ); } } if ( isset( $install[ 'current_upload_base_url' ] ) && $upload_dir !== $install[ 'current_upload_base_url' ] ) { if ( isset( $install[ '_raindrops_indv_css' ] ) ) { $install[ '_raindrops_indv_css' ] = str_replace( $install[ 'current_upload_base_url' ], $upload_dir[ 'baseurl' ], $install[ '_raindrops_indv_css' ] ); } $install[ 'old_upload_base_url' ] = $install[ 'current_upload_base_url' ]; $install[ 'current_upload_base_url' ] = $upload_dir[ 'baseurl' ]; if ( 'option' == $raindrops_setting_type ) { update_option( 'raindrops_theme_settings', $install ); } if ( 'theme_mod' == $raindrops_setting_type ) { if ( isset( $install[ '_raindrops_indv_css' ] ) ) { set_theme_mod( '_raindrops_indv_css', $install[ '_raindrops_indv_css' ] ); } set_theme_mod( 'old_upload_base_url', esc_url( $install[ 'old_upload_base_url' ] ) ); set_theme_mod( 'current_upload_base_url', esc_url( $install[ 'current_upload_base_url' ] ) ); } } elseif ( !isset( $install[ 'current_upload_base_url' ] ) ) { $install[ 'current_upload_base_url' ] = $upload_dir[ 'baseurl' ]; if ( 'option' == $raindrops_setting_type ) { update_option( 'raindrops_theme_settings', $install ); } if ( 'theme_mod' == $raindrops_setting_type ) { set_theme_mod( 'current_upload_base_url', esc_url( $install[ 'current_upload_base_url' ] ) ); } } if ( 'delete' == raindrops_warehouse_clone( "raindrops_uninstall_option" ) ) { //add_action( 'switch_theme', 'raindrops_delete_all_options' ); } } } } if ( !function_exists( "raindrops_delete_all_options" ) ) { function raindrops_delete_all_options() { if ( current_user_can( 'delete_themes' ) ) { delete_option( 'raindrops_theme_settings' ); remove_theme_mods(); delete_option( 'widget_raindrops_pinup_entry_widget' ); delete_option( 'widget_raindrops_entrywidget' ); $allposts = get_posts( 'numberposts=0&post_type=post&post_status=' ); foreach ( $allposts as $postinfo ) { delete_post_meta( $postinfo->ID, '_web_fonts_styles' ); delete_post_meta( $postinfo->ID, '_web_fonts_link_element' ); delete_post_meta( $postinfo->ID, '_css' ); delete_post_meta( $postinfo->ID, 'css' ); delete_post_meta( $postinfo->ID, '_add-to-front' ); delete_post_meta( $postinfo->ID, '_raindrops_this_header_image' ); delete_post_meta( $postinfo->ID, 'meta' ); if ( RAINDROPS_CUSTOM_FIELD_SCRIPT == true ) { delete_post_meta( $postinfo->ID, 'javascript' ); } } $allposts = get_posts( 'numberposts=0&post_type=page&post_status=' ); foreach ( $allposts as $postinfo ) { delete_post_meta( $postinfo->ID, '_web_fonts_styles' ); delete_post_meta( $postinfo->ID, '_web_fonts_link_element' ); delete_post_meta( $postinfo->ID, '_css' ); delete_post_meta( $postinfo->ID, 'css' ); delete_post_meta( $postinfo->ID, '_add-to-front' ); delete_post_meta( $postinfo->ID, '_raindrops_this_header_image' ); delete_post_meta( $postinfo->ID, 'meta' ); if ( RAINDROPS_CUSTOM_FIELD_SCRIPT == true ) { delete_post_meta( $postinfo->ID, 'javascript' ); } } } } } /** * insert into embed style ,javascript script and embed tags from custom field * * * * @1.312 */ if ( !function_exists( "raindrops_emoji_collection" ) ) { function raindrops_emoji_collection( $condition = '' ) { global $raindrops_tag_emoji, $raindrops_category_emoji; $raindrops_tag_emoji_for_archive = '\\' . str_replace( array( '&#x', ';' ), '', $raindrops_tag_emoji ); $raindrops_category_emoji_for_archive = '\\' . str_replace( array( '&#x', ';' ), '', $raindrops_category_emoji ); $emoji_code = ''; $condition = get_the_archive_title(); if ( is_tag() ) { $condition = 'tag'; $emoji_code = $raindrops_tag_emoji_for_archive; } if ( is_category() ) { $condition = 'category'; $emoji_code = $raindrops_category_emoji_for_archive; } return apply_filters( 'raindrops_emoji_collection', $emoji_code, $condition ); } } if ( !function_exists( "raindrops_embed_css" ) ) { function raindrops_embed_css() { global $post, $raindrops_fluid_or_fixed, $raindrops_fluid_minimum_width, $raindrops_wp_version, $raindrops_current_theme_name, $raindrops_page_width, $raindrops_base_font_size, $raindrops_custom_header_width, $raindrops_custom_header_height, $raindrops_current_column, $raindrops_setting_type, $raindrops_use_transient, $raindrops_automatic_color; if ( empty( $raindrops_automatic_color ) ) { if( 'automatic' == raindrops_warehouse_clone('raindrops_color_select') ) { $raindrops_automatic_color = true; } else { $raindrops_automatic_color = false; } if( false !== raindrops_has_indivisual_notation() ) { $raindrops_automatic_color = true; } } $css = apply_filters( 'raindrops_embed_css_pre', '' ); $css .= '/* raindrops_embed_css */'; //preload $css_rule_set = 'body:after{display:none; content: url(%1$s);}'; $css .= "\n" . sprintf( $css_rule_set, get_header_image() ); //#header-image $css .= "\n" . raindrops_header_image( 'css' ) . "\n"; //#header-image bounse issue fixed $css_rule_set = '#header-imge{ width:%1$spx;height:%2$spx;}'; $css .= "\n" . sprintf( $css_rule_set, $raindrops_custom_header_width, apply_filters( 'raindrops_header_image_height', $raindrops_custom_header_height ) ); //site-title $raindrops_text_color = get_theme_mod( 'header_textcolor' ); if ( $raindrops_text_color !== 'blank' && display_header_text() == true && false == raindrops_has_indivisual_notation() && false == $raindrops_automatic_color ) { $css .= "\n#site-title a{color:#" . $raindrops_text_color . ';}'; } // @1.353 if ( 'hide' == raindrops_warehouse_clone( "raindrops_display_site_title" ) ) { $css .= "\n#site-title a:not(.custom-logo-link){display:none;}"; } //page type if ( isset( $raindrops_fluid_or_fixed ) && !empty( $raindrops_fluid_or_fixed ) && ( 'doc' == raindrops_warehouse_clone( "raindrops_page_width" ) || 'doc2' == raindrops_warehouse_clone( "raindrops_page_width" ) || 'custom-doc' == raindrops_warehouse_clone( "raindrops_page_width" ) || 'doc4' == raindrops_warehouse_clone( "raindrops_page_width" ) ) ) { $css .= raindrops_is_fixed(); } elseif ( isset( $raindrops_fluid_minimum_width ) && !empty( $raindrops_fluid_minimum_width ) || 'doc5' == raindrops_warehouse_clone( "raindrops_page_width" ) ) { $css .= raindrops_is_fluid(); } //#hd $uploads = wp_upload_dir(); $header_image_uri = $uploads[ 'url' ] . '/' . raindrops_warehouse( 'raindrops_header_image' ); if ( 'raindrops' !== $raindrops_current_theme_name && 'header.png' == raindrops_warehouse( 'raindrops_header_image' ) ) { $header_image_uri = str_replace( $raindrops_current_theme_name, 'raindrops', $header_image_uri ); } $css .= "\n#hd{" . raindrops_upload_image_parser( $header_image_uri, 'inline', '#hd' ) . '}'; //#ft $footer_image_uri = $uploads[ 'url' ] . '/' . sanitize_file_name( raindrops_warehouse( 'raindrops_footer_image' ) ); if ( 'raindrops' !== $raindrops_current_theme_name && 'footer.png' == raindrops_warehouse( 'raindrops_footer_image' ) ) { $footer_image_uri = str_replace( $raindrops_current_theme_name, 'raindrops', $footer_image_uri ); } if ( 'none' !== raindrops_warehouse( 'raindrops_footer_image' ) ) { $css .= "\n#ft{" . raindrops_upload_image_parser( $footer_image_uri, 'inline', '#ft' ) . '}'; } /* 1.306 add conditional */ if ( false == raindrops_has_indivisual_notation() ) { if ( false == $raindrops_automatic_color ) { $css .= "\n#ft{color:" . raindrops_warehouse( 'raindrops_footer_color' ) . ';}'; } } // 2col 3col change style helper $css .= '/*' . raindrops_warehouse_clone( 'raindrops_show_right_sidebar' ) . '*/'; if ( "show" == raindrops_warehouse_clone( 'raindrops_show_right_sidebar' ) ) { $css .= ' .rsidebar{display:block;} '; } else { $css .= ' .rsidebar{display:none;} '; $css .= '.yui-t6 .index.archives,.yui-t5 .index.archives,.yui-t4 .index.archives{ margin-right:1em; }'; } if ( "hide" == raindrops_warehouse_clone( 'raindrops_display_article_author' ) ) { $css .= ' .posted-by-string{display:none;} .raindrops-comment-link{margin:0;} '; $css .= ' .posted-on-after .author{display:none;}, '; } if ( "avatar" == raindrops_warehouse_clone( 'raindrops_display_article_author' ) ) { $css .= 'body:not(.ja) .posted-by-string{visibility:hidden;margin:-.5em;} '; } if ( "hide" == raindrops_warehouse_clone( 'raindrops_posted_in_label' ) ) { $css .= ' .entry-meta .tagged, .this-posted-in{display:none;} '; $css .= ' .posted-on + .this-posted-in{display:none;} '; $css .= ' .entry-title + .this-posted-in{display:none;} '; } if ( "show" !== raindrops_warehouse_clone( 'raindrops_comments_are_closed' ) ) { $css .= ' .nocomments{display:none;} '; } $raindrops_archive_title_label = raindrops_warehouse_clone( 'raindrops_archive_title_label' ); if ( "hide" == $raindrops_archive_title_label ) { $css .= ' #archives-title .label{display:none;} '; } elseif ( "emoji" == $raindrops_archive_title_label ) { $css .= ' #archives-title .label{display:none;} '; $css .= ' #archives-title .title:before{ content: \'' . raindrops_emoji_collection() . '\';display:inline-block;margin-right:13px; }'; } if ( "show" !== raindrops_warehouse_clone( 'raindrops_archive_nav_above' ) ) { $css .= ' #nav-above{display:none;} '; } /* ver 1.304 add */ $raindrops_fonts_color = raindrops_warehouse_clone( 'raindrops_default_fonts_color' ); if ( !empty( $raindrops_fonts_color ) && false == raindrops_has_indivisual_notation() ) { /* 1.306 add false == raindrops_has_indivisual_notation() */ if ( false == $raindrops_automatic_color ) { $css .= ' article {color:' . $raindrops_fonts_color . ';}'; } } /** * ver 1.410 add */ $use_settings = raindrops_warehouse_clone( 'raindrops_extra_sidebar_responsive' ); if ( 1 < raindrops_get_column_count() && 'yes' == $use_settings ) { $sidebar_breakpoint = absint( raindrops_warehouse_clone( 'raindrops_extra_sidebar_responsive_breakpoint' ) ); $css .= '@media screen and ( min-width: 641px) and (max-width: ' . $sidebar_breakpoint . 'px) { #doc5 .rsidebar-shrink, #doc3 .rsidebar-shrink{ display:inline-block; } #doc5 .rsidebar-shrink button, #doc3 .rsidebar-shrink button{ display:block; width:1.4em; height:1.4em; padding:0; margin:0; } #doc5 .rsidebar-shrink button:focus, #doc3 .rsidebar-shrink button:focus{ outline:none; } .rd-primary-menu-responsive-active #doc5 .rsidebar-shrink button, .rd-primary-menu-responsive-active #doc3 .rsidebar-shrink button{ margin:2em 0 0 2em; } #doc5 #container:not(.rd-expand-sidebar) > div.first, #doc3 #container:not(.rd-expand-sidebar) > div.first{ width:100%; padding-right:1em; box-sizing:border-box; } #doc5 #container:not(.rd-expand-sidebar) .first+.yui-u, #doc3 #container:not(.rd-expand-sidebar) .first+.yui-u{ display:none; border:1px solid red; } #doc5 .button-wrapper, #doc3 .button-wrapper{ position:relative; display:inline-block; } }'; } $use_settings = raindrops_warehouse_clone( 'raindrops_default_sidebar_responsive' ); /* @1.150 2 to 1 */ if ( 1 < raindrops_get_column_count() && 'yes' == $use_settings ) { $sidebar_breakpoint = absint( raindrops_warehouse_clone( 'raindrops_default_sidebar_responsive_breakpoint' ) ); $css .= '@media screen and ( min-width: 641px) and ( max-width: ' . $sidebar_breakpoint . 'px ) { #doc5 .lsidebar-shrink, #doc3 .lsidebar-shrink{ display:inline-block; } #doc5 .lsidebar-shrink button, #doc3 .lsidebar-shrink button{ display:block; width:1.4em; height:1.4em; z-index:1; padding:0; margin:0; } #doc5 .lsidebar-shrink button:focus, #doc3 .lsidebar-shrink button:focus{ outline:none; } .rd-primary-menu-responsive-active #doc5 .lsidebar-shrink button, .rd-primary-menu-responsive-active #doc3 .rsidebar-shrink button{ margin:2em 0 0 2em; } #doc5 #bd:not(.rd-expand-sidebar-default) > .yui-b, #doc3 #bd:not(.rd-expand-sidebar-default) > .yui-b{ display:none; } #doc5 #bd:not(.rd-expand-sidebar-default) > .yui-main > .yui-b, #doc3 #bd:not(.rd-expand-sidebar-default) > .yui-main > .yui-b{ width:100%; box-sizing:border-box; margin-left:0; } #doc5.yui-t6 #bd:not(.rd-expand-sidebar-default) > .yui-main > .yui-b, #doc5.yui-t5 #bd:not(.rd-expand-sidebar-default) > .yui-main > .yui-b, #doc5.yui-t4 #bd:not(.rd-expand-sidebar-default) > .yui-main > .yui-b, #doc3.yui-t6 #bd:not(.rd-expand-sidebar-default) > .yui-main > .yui-b, #doc3.yui-t5 #bd:not(.rd-expand-sidebar-default) > .yui-main > .yui-b, #doc3.yui-t4 #bd:not(.rd-expand-sidebar-default) > .yui-main > .yui-b{ padding-right:1em; } .home #doc5 #bd:not(.rd-expand-sidebar-default) > .yui-main > .yui-b, .home #doc3 #bd:not(.rd-expand-sidebar-default) > .yui-main > .yui-b{ padding-left:1em; } .archive #doc3 #bd:not(.rd-expand-sidebar-default) > .yui-main > .yui-b .archive #doc5 #bd:not(.rd-expand-sidebar-default) > .yui-main > .yui-b, .archive #doc3 #bd:not(.rd-expand-sidebar-default) > .yui-main > .yui-b{ margin-left:1em; } .single #doc5 #bd:not(.rd-expand-sidebar-default) > .yui-main > .yui-b, .single #doc3 #bd:not(.rd-expand-sidebar-default) > .yui-main > .yui-b{ margin-left:0; padding-left:1em; } .single.rd-primary-menu-responsive-active #doc5 #bd.rd-expand-sidebar .yui-main > .yui-b, .single.rd-primary-menu-responsive-active #doc3 #bd.rd-expand-sidebar .yui-main > .yui-b{ margin-right:1em; background:red!important; } #doc5 .button-wrapper-default, #doc3 .button-wrapper-default{ position:relative; display:inline-block; } #doc5 #bd:not(.rd-expand-sidebar) > div.first, #doc3 #bd:not(.rd-expand-sidebar) > div.first{ padding-right:0; } }'; } /** * Add @version 1.304 */ $raindrops_sticky_conditional = raindrops_warehouse_clone( 'raindrops_display_sticky_post' ); if ( 'only_home' == $raindrops_sticky_conditional ) { $css .= ' .single .raindrops-sticky .entry-title, .single .raindrops-sticky .entry-content{ display:none; }'; } /** * Add @since 1.309 * */ // $raindrops_display_default_category = raindrops_warehouse_clone( 'raindrops_display_default_category' ); if ( 'show' !== $raindrops_display_default_category ) { //$css .= ' .this-posted-in{ display:none; }'; } //when manual style rule mode if ( raindrops_warehouse_clone( "raindrops_style_type" ) == $raindrops_current_theme_name ) { return $css . raindrops_warehouse_clone( '_raindrops_indv_css' ); } /* 0611 1.301 * $raindrops_options = get_option( 'raindrops_theme_settings' ); */ $raindrops_base_color = raindrops_warehouse_clone( 'raindrops_base_color' ); $raindrops_hyperlink_color = raindrops_warehouse_clone( 'raindrops_hyperlink_color' ); $raindrops_style_type = raindrops_warehouse_clone( 'raindrops_style_type' ); $color_check = raindrops_has_indivisual_notation(); if ( false == $color_check ) { $raindrops_style_type = raindrops_warehouse_clone( 'raindrops_style_type' ); } else { if ( isset( $color_check[ 'color_type' ] ) ) { $raindrops_style_type = $color_check[ 'color_type' ]; } //$columns = $color_check['col']; } $raindrops_indv_css = raindrops_design_output( $raindrops_style_type ) . raindrops_color_base( $raindrops_base_color ); //when this code exists [raindrops color_type="minimal" col="1"] in the post $raindrops_indv_css = raindrops_color_type_custom( $raindrops_indv_css ); $css .= apply_filters( "raindrops_indv_css", $raindrops_indv_css ); if ( $raindrops_hyperlink_color !== '' ) { if ( false !== ($type = raindrops_has_indivisual_notation() ) ) { if ( isset( $type[ 'color_type' ] ) ) { $default_color = raindrops_default_color_clone( 'raindrops_hyperlink_color', $type[ 'color_type' ] ); $css .= raindrops_custom_link_color( $default_color ); } } else { /* 1.306 add conditional */ if ( false == raindrops_has_indivisual_notation() ) { if ( false == $raindrops_automatic_color ) { $css .= raindrops_custom_link_color( $raindrops_hyperlink_color ); } } } } $background = get_background_image(); $color = get_background_color(); if ( !empty( $background ) || !empty( $color ) ) { $css = preg_replace( "|body[^{]*{[^}]+}|", "", $css ); } if ( raindrops_warehouse_clone( 'raindrops_basefont_settings' ) > 13 ) { $css .= 'body{font-size:' . raindrops_warehouse_clone( 'raindrops_basefont_settings' ) . 'px;}'; } elseif ( isset( $raindrops_base_font_size ) ) { $css .= 'body{font-size:' . $raindrops_base_font_size . 'px;}'; } //body background $body_background = get_theme_mod( "background_color" ); $body_background_image = get_theme_mod( "background_image" ); $body_background_repeat = get_theme_mod( "background_repeat" ); $body_background_position_x = get_theme_mod( "background_position_x" ); $body_background_attachment = get_theme_mod( "background_attachment" ); if ( $body_background !== false && !empty( $body_background ) && !empty( $body_background_image ) ) { $css .= "\nbody{background:#" . $body_background . ' url( ' . $body_background_image . ' );}'; } elseif ( $body_background !== false && !empty( $body_background ) ) { $css .= "\nbody{background-color:#" . $body_background . ';}'; } elseif ( !empty( $body_background_image ) ) { $css .= "\nbody{background-image: url( " . $body_background_image . ' );}'; } if ( isset( $body_background_repeat ) && !empty( $body_background_repeat ) ) { $css .= "\nbody{background-repeat: " . $body_background_repeat . ';}'; } if ( isset( $body_background_position_x ) && !empty( $body_background_position_x ) ) { $css .= "\nbody{background-position:top " . $body_background_position_x . ';}'; } if ( isset( $body_background_attachment ) && !empty( $body_background_attachment ) ) { $css .= "\nbody{background-attachment: " . $body_background_attachment . ';}'; } /* Primary Menu Font Size */ $primary_menu_font_size = raindrops_warehouse_clone( 'raindrops_menu_primary_font_size' ); if ( isset( $primary_menu_font_size ) && !empty( $primary_menu_font_size ) ) { /* Add check value why some web site font-size:0% using child theme */ if ( $primary_menu_font_size > 76 && $primary_menu_font_size < 183 ) { $css .= '#access .children li{width:100%;}'; $css .= '#access .sub-menu li{width:100%;}'; $css .= '#access a{font-size:' . floatval( $primary_menu_font_size ) . '%;}'; } else { $css .= '#access a{font-size:100%;}'; } } else { $css .= '#access a{font-size:100%;}'; } $primary_menu_min_width = raindrops_warehouse_clone( 'raindrops_menu_primary_min_width' ); if ( isset( $primary_menu_min_width ) && !empty( $primary_menu_min_width ) ) { if ( $primary_menu_min_width < 10 ) { $child_width = 10; } else { $child_width = floatval( $primary_menu_min_width ); } $adding_style = "\n" . '#access ul ul li,#access ul ul,#access a{ min-width:%1$dem;} .ie8 #access .page_item_has_children > a:after, .ie8 #access .menu-item-has-children > a:after{ content :"";} #access .children li,#access .sub-menu li,#access .children ul,#access .sub-menu ul,#access .children a,#access .sub-menu a{ min-width:%2$dem; }'; $css .= sprintf( $adding_style, $primary_menu_min_width, $child_width ); } /* @1.346 image width class */ $thumbnail_size_w = get_option( 'thumbnail_size_w' ); if ( !empty( $thumbnail_size_w ) ) { if ( $thumbnail_size_w < 160 ) { $thumbnail_size_w = 160; } $css .= ' .rd-thumbnail{width:' . absint( $thumbnail_size_w ) . 'px; max-width:100%;}'; } $medium_size_w = get_option( 'medium_size_w' ); if ( !empty( $medium_size_w ) ) { $css .= ' .rd-medium{width:' . absint( $medium_size_w ) . 'px; max-width:100%;}'; } $large_size_w = get_option( 'large_size_w' ); if ( !empty( $large_size_w ) ) { $css .= ' .rd-large{width:' . absint( $large_size_w ) . 'px; max-width:100%;}'; } $css .= ' .rd-w320{width:320px; max-width:100%;}'; $css .= ' .rd-w480{width:480px; max-width:100%;}'; $css .= ' .rd-w640{width:640px; max-width:100%;}'; $raindrops_sitewide_css = raindrops_warehouse_clone( 'raindrops_sitewide_css' ); if ( isset( $raindrops_sitewide_css ) && !empty( $raindrops_sitewide_css ) ) { $css .= ' ' . wp_strip_all_tags( $raindrops_sitewide_css ); } if ( empty( $css ) ) { $css = "cannot get style value check me"; } $css = raindrops_remove_spaces_from_css( $css ); return apply_filters( "raindrops_embed_meta_css", $css ); } } /** * * * * * */ if ( !function_exists( "raindrops_custom_link_color" ) ) { function raindrops_custom_link_color( $color ) { $color = apply_filters( 'raindrops_custom_link_color_val', $color ); $css = <<< LINK_COLOR_CSS .entry-content a:link, .entry-content a:active, .entry-content a:visited, .entry-content a:hover{ color:{$color}; } .entry-title a:link, .entry-title a:active, .entry-title a:visited, .entry-title a:hover{ color:{$color}; } .posted-on a:link, .posted-on a:active, .posted-on a:visited, .posted-on a:hover{ color:{$color}; } .entry-meta-default a{ color:{$color}; }/*single.php*/ .entry-meta-default a{ color:{$color}; }/*single.php*/ .post .entry-meta, .entry-meta a:link, .entry-meta a:active, .entry-meta a:visited, .entry-meta a:hover{ color:{$color}; } .rsidebar a:link, .rsidebar a:active, .rsidebar a:visited, .rsidebar a:hover{ color:{$color}; } .lsidebar a:link, .lsidebar a:active, .lsidebar a:visited, .lsidebar a:hover{ color:{$color}; } #wp-calendar{ color:{$color}; } .raindrops-comment-link em, .raindrops-comment-link a:link em, .raindrops-comment-link a:active em, .raindrops-comment-link a:visited em, .raindrops-comment-link a:hover em{ /* @1.329 color:{$color}! important;*/ } .nav-previous a, .nav-next a, .nav-previous a, .nav-next a{ color:{$color}; } .logged-in-as a:link, .logged-in-as a:active, .logged-in-as a:visited, .logged-in-as a:hover{ color:{$color}; } LINK_COLOR_CSS; if ( preg_match( "!#([0-9a-f]{6}|[0-9a-f]{3})!si", $color ) ) { return apply_filters( "raindrops_custom_link_color", $css ); } } } /** * * * * * */ if ( !function_exists( "raindrops_embed_meta" ) ) { function raindrops_embed_meta( $content ) { global $post, $wp_customize, $content_width, $raindrops_use_transient, $raindrops_stylesheet_type, $raindrops_fallback_human_interface_show; /* @1.333 */ if ( true == $raindrops_fallback_human_interface_show ) { return; } if ( !isset( $raindrops_stylesheet_type ) ) { $raindrops_stylesheet_type = raindrops_warehouse_clone( 'raindrops_stylesheet_in_html' ); } $zen = get_option( 'comet_cache_options' ); do_action('raindrops_embed_meta_transient_before'); if ( true == $raindrops_use_transient && !is_user_logged_in() && false !== ( $raindrops_embed_meta_transient = get_transient( 'raindrops_embed_meta_transient' ) ) && ( isset( $zen ) && false == $zen[ 'enable' ] || !class_exists( 'WebSharks\\CometCache\\Classes\\Plugin' ) ) && false == is_random_header_image() ) { echo $raindrops_embed_meta_transient; return $content; } $raindrops_use_featured_image_emphasis = raindrops_warehouse_clone( 'raindrops_use_featured_image_emphasis' ); if ( $raindrops_use_featured_image_emphasis == 'yes' ) { $raindrops_post_image_position = raindrops_warehouse_clone( 'raindrops_featured_image_position' ); add_filter( 'raindrops_post_thumbnail_size_main_query', 'raindrops_post_thumbnail_size_in_the_loop', 10, 3 ); switch ( $raindrops_post_image_position ) { case( 'front' ): add_filter( 'raindrops_embed_meta_css', 'raindrops_post_thumbnail_size_block_style' ); break; case( 'left' ): add_filter( 'raindrops_embed_meta_css', 'raindrops_post_thumbnail_size_lefty_style' ); break; default: remove_filter( 'raindrops_embed_meta_css', 'raindrops_post_thumbnail_size_block_style' ); remove_filter( 'raindrops_embed_meta_css', 'raindrops_post_thumbnail_size_lefty_style' ); } } $result = ""; $css = apply_filters( 'raindrops_embed_meta_pre', '' ); $css .='#doc5 .raindrops-keep-content-width{width:' . $content_width . 'px;max-width:100%;margin:auto;float:none;}' . "\n"; $css .='#doc5 .raindrops-keep-content-width .raindrops-expand-width{margin:0;}' . "\n"; $css .='#doc3 .raindrops-keep-content-width{width:' . $content_width . 'px;max-width:100%;margin:auto;float:none;}' . "\n"; $css .='#doc3 .raindrops-keep-content-width .raindrops-expand-width{margin:0;}' . "\n"; if ( isset( $wp_customize ) || $raindrops_stylesheet_type !== 'external' ) { $css .= raindrops_embed_css(); } $result_indv = ''; $pinup_style = ''; if ( RAINDROPS_USE_AUTO_COLOR !== true ) { // $css = ''; } if ( is_single() || is_page() ) { $pinup_widget_ids = raindrops_get_pinup_widget_ids(); $pinup_widget_post_ids = raindrops_pinup_widget_ids_to_post_ids( $pinup_widget_ids ); foreach ( $pinup_widget_post_ids as $pinup_id ) { $web_fonts = get_post_meta( $pinup_id, '_web_fonts_link_element', true ); if ( isset( $web_fonts ) && !empty( $web_fonts ) ) { $web_fonts_each_array = explode( "\n", $web_fonts ); foreach ( $web_fonts_each_array as $web_fonts_each ) { $result = str_replace( array( $web_fonts_each, "\n\n" ), array( '', "\n" ), $result ); $result .= $web_fonts_each . "\n"; } } $web_fonts_style = get_post_meta( $pinup_id, '_web_fonts_styles', true ); if ( isset( $web_fonts_style ) && !empty( $web_fonts_style ) ) { $web_fonts_style_each_array = explode( "\n", $web_fonts_style ); foreach ( $web_fonts_style_each_array as $web_fonts_style_each ) { $pinup_style = str_replace( array( $web_fonts_style_each, "\n\n" ), array( '', "\n" ), $pinup_style ); $pinup_style .= $web_fonts_style_each . "\n"; } } } $web_fonts = get_post_meta( get_the_ID(), '_web_fonts_link_element', true ); if ( isset( $web_fonts ) && !empty( $web_fonts ) ) { $result .= $web_fonts; } $web_fonts_styles = get_post_meta( $post->ID, '_web_fonts_styles', true ); if ( ( isset( $web_fonts_styles ) && !empty( $web_fonts_styles ) ) || !empty( $pinup_style ) ) { $web_fonts_styles_wrapper = "' . "\n"; $result .= sprintf( $web_fonts_styles_wrapper, $web_fonts_styles . $pinup_style ); } $css_single = get_post_meta( $post->ID, 'css', true ); /* 1.234 metabox support */ $css_single .= get_post_meta( $post->ID, '_css', true ); if ( true == RAINDROPS_OVERRIDE_POST_STYLE_ALL_CONTENTS ) { $css .= preg_replace_callback( '![^}]+{[^}]+}!siu', 'raindrops_css_add_id', $css_single ); } else { $css_single = $css_single; } if ( !empty( $css ) && RAINDROPS_CUSTOM_FIELD_CSS == true ) { $result .= '"; } $meta = get_post_meta( $post->ID, 'meta', true ); if ( !empty( $meta ) && RAINDROPS_CUSTOM_FIELD_META == true ) { $result .= raindrops_esc_custom_field_meta( $meta ); } $javascript = get_post_meta( $post->ID, 'javascript', true ); if ( !empty( $javascript ) && RAINDROPS_CUSTOM_FIELD_SCRIPT == true ) { $result .= '"; } } else { $pinup_widget_ids = raindrops_get_pinup_widget_ids(); $pinup_widget_post_ids = raindrops_pinup_widget_ids_to_post_ids( $pinup_widget_ids ); if ( isset( $pinup_widget_post_ids ) && is_array( $pinup_widget_post_ids ) ) { foreach ( $pinup_widget_post_ids as $pinup_id ) { $web_fonts = get_post_meta( $pinup_id, '_web_fonts_link_element', true ); if ( isset( $web_fonts ) && !empty( $web_fonts ) ) { $web_fonts_each_array = explode( "\n", $web_fonts ); foreach ( $web_fonts_each_array as $web_fonts_each ) { $result = str_replace( array( $web_fonts_each, "\n\n" ), array( '', "\n" ), $result ); $result .= $web_fonts_each . "\n"; } } $web_fonts_style = get_post_meta( $pinup_id, '_web_fonts_styles', true ); if ( isset( $web_fonts_style ) && !empty( $web_fonts_style ) ) { $web_fonts_style_each_array = explode( "\n", $web_fonts_style ); foreach ( $web_fonts_style_each_array as $web_fonts_style_each ) { $result_indv = str_replace( array( $web_fonts_style_each, "\n\n" ), array( '', "\n" ), $result_indv ); $result_indv .= $web_fonts_style_each . "\n"; } } } } if ( true == RAINDROPS_OVERRIDE_POST_STYLE_ALL_CONTENTS ) { if ( have_posts() && !is_date() ) { if ( false == RAINDROPS_USE_AUTO_COLOR ) { } while ( have_posts() ) { the_post(); $web_fonts = get_post_meta( $post->ID, '_web_fonts_link_element', true ); if ( isset( $web_fonts ) && !empty( $web_fonts ) ) { $web_fonts_each_array = explode( "\n", $web_fonts ); foreach ( $web_fonts_each_array as $web_fonts_each ) { $result = str_replace( array( $web_fonts_each, "\n\n" ), array( '', "\n" ), $result ); $result .= $web_fonts_each . "\n"; } } $web_fonts_style = get_post_meta( $post->ID, '_web_fonts_styles', true ); if ( isset( $web_fonts_style ) && !empty( $web_fonts_style ) ) { $web_fonts_style_each_array = explode( "\n", $web_fonts_style ); foreach ( $web_fonts_style_each_array as $web_fonts_style_each ) { $result_indv = str_replace( array( $web_fonts_style_each, "\n\n" ), array( '', "\n" ), $result_indv ); $result_indv .= $web_fonts_style_each . "\n"; } } $collections = get_post_meta( $post->ID, 'css', true ); $collections .= get_post_meta( $post->ID, '_css', true ); if ( !empty( $collections ) ) { $result_indv .= preg_replace_callback( '![^}]+{[^}]+}!siu', 'raindrops_css_add_id', $collections ); } } rewind_posts(); } } $result .= '\n"; } if ( true == $raindrops_use_transient ) { set_transient( 'raindrops_embed_css_transient', $css ); } if ( false == $raindrops_use_transient || is_user_logged_in() ) { set_transient( 'raindrops_embed_meta_transient', $result ); } echo apply_filters( 'raindrops_embed_meta_echo', $result ); return $content; } } if ( !function_exists( 'raindrops_esc_custom_field_meta' ) ) { function raindrops_esc_custom_field_meta( $meta_input ) { if ( RAINDROPS_CUSTOM_FIELD_META !== true ) { return; } $meta = preg_replace( '!>[^<]+\n<", $meta_input ); $meta = "\n{$meta}\n"; $meta = preg_replace( '!style\s*=\s*("|\')[^"\']+("|\')!', '', $meta ); $meta = preg_replace( '!onmouseover\s*=\s*("|\')[^"\']+("|\')!', '', $meta ); $meta = strip_tags( $meta, '' ); if ( is_singular() && !empty( $meta_input ) ) { return apply_filters( 'raindrops_esc_custom_field_meta', $meta, $meta_input ); } return; } } /** * When custom field element add single post display properly. * But loop page not adding element,result display improperly. * this filter detect custom field and add base URL to relative links and image source. */ add_filter( 'the_content', 'raindrops_custom_field_meta_helper' ); if ( !function_exists( 'raindrops_custom_field_meta_helper' ) ) { function raindrops_custom_field_meta_helper( $content ) { global $post; $meta_values = ''; if ( isset( $post ) ) { $meta_values = get_post_meta( $post->ID, 'meta', true ); } if ( !empty( $meta_values ) && strstr( $meta_values, ' $match ) { if ( preg_match( '!([^{]+){([^{]+{)(.+)!', $match, $regs ) ) { $result .= $regs[ 1 ] . '{' . "\n"; $match = $regs[ 2 ] . $regs[ 3 ]; } if ( preg_match( '!(' . $exclude_lists . ')!', $result . $match ) || preg_match( '!^[0-9]{1,3}%!', trim( $match ) ) ) { if ( preg_match( '!@raindrops!', $match ) ) { // @raindrops is force keyword, Not adding ID // Although not recommended, please use only if absolutely necessary // Please include the CSS body class that specifies a particular page(.postid-xxxx). This is not the case when the layout is likely to collapse. $match = str_replace( '@raindrops', '', $match ); } $result .= ' ' . trim( $match ) . "\n"; return $result; } if ( preg_match( '|^([^@]+){(.+)|siu', $match, $regs ) ) { $match_1 = str_replace( ',', ', #post-' . $post->ID . ' ', $regs[ 1 ] ); $match = $match_1 . '{' . $regs[ 2 ]; $result .= '#post-' . $post->ID . ' ' . trim( $match ) . "\n"; } else { $result .= ' ' . trim( $match ) . "\n"; } } return $result; } } /** * Alternative character when value is blank * * * * */ if ( !function_exists( "raindrops_blank_fallback" ) ) { function raindrops_blank_fallback( $string, $fallback ) { if ( !empty( $string ) ) { return $string; } else { return $fallback; } } } /** * Article navigation * * * * */ if ( !function_exists( "raindrops_prev_next_post" ) ) { function raindrops_prev_next_post( $position = "nav-above" ) { if ( is_category() ) { $filter = true; //display same category. } else { $filter = false; } //exclude separate 'and' $exclude_category = apply_filters( 'raindrops_next_prev_excluded_categories', '' ); printf( '
    ', $position, "clearfix" ); $prev_post = get_previous_post( $filter, $exclude_category ); if ( !empty( $prev_post ) ) { printf( '', "nav-previous" ); previous_post_link( '%link', '« %title', $filter, $exclude_category ); printf( '' ); } $next_post = get_next_post( $filter, $exclude_category ); if ( !empty( $next_post ) ) { printf( '', "nav-next" ); next_post_link( '%link', ' %title »', $filter, $exclude_category ); printf( '' ); } printf( '
    ' ); echo apply_filters( "raindrops_prev_next_post", '' ); } } /** * date.php * * * * */ if ( !function_exists( "raindrops_days_in_month" ) ) { function raindrops_days_in_month( $month, $year ) { $daysInMonth = array( 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ); if ( $month != 2 ) { return $daysInMonth[ $month - 1 ]; } return ( checkdate( $month, 29, $year ) ) ? 29 : 28; } } /** * for date.php * * * * */ if ( !function_exists( "raindrops_get_year" ) ) { function raindrops_get_year( $posts = '', $year = '', $pad = 0 ) { global $calendar_page_number, $post_per_page, $calendar_page_last, $calendar_page_start; $months = array(); $y = ""; $m = ""; $d = ""; // first let's parse through our posts, organizing them by month foreach ( $posts as $post ) { $y = substr( $post->post_date, 0, 4 ); $m = substr( $post->post_date, 5, 2 ); $d = substr( $post->post_date, 8, 2 ); $months[ $m ][] = $post; } $year_label = apply_filters( 'raindrops_archive_year_label', $year ); // @1.334 $output = "

    $year_label

    "; $output = raindrops_archive_year_navigation( false ); $table_year = array( '', '', '', '', '', '', '', '', '', '', '', '', '', '
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    ' ); foreach ( $months as $num => $val ) { $num = (int) $num; $table_year[ $num ] = '" . $num . '" . sprintf( esc_html__( "%s Articles archived", 'raindrops' ), count( $val ) ) . ''; } return $output . implode( "\n", $table_year ); } } /* end raindrops_get_year( ) */ /** * for date.php * * * * */ if ( !function_exists( "raindrops_get_day" ) ) { function raindrops_get_day( $posts = '', $year = '', $mon = '', $day = '', $pad = 1 ) { global $month; $here = home_url(); $year_label = apply_filters( 'raindrops_archive_year_label', $year ); $month_label = apply_filters( 'raindrops_archive_month_label', $mon ); $day_label = apply_filters( 'raindrops_archive_day_label', $day ); if ( 'ja' == get_locale() ) { $output = "

    $year_label " . $month_label . " " . $day_label . "

    "; } else { $output = "

    " . $day_label . " " . $month_label . " $year_label

    "; } $output .= ''; foreach ( $posts as $mytime ) { $h = substr( $mytime->post_date, 11, 2 ); if ( 10 > $h ) { $h = substr( $h, 1, 1 ); } $today[ $h ][] = $mytime; } for ( $i = 0; $i <= 24; $i++ ) { $output .= ''; } $output .= '
    '; if ( 10 > $i ) { $output .= "0$i:00"; } else { $output .= "$i:00"; } $output .= ''; if ( isset( $today[ $i ] ) ) { foreach ( $today[ $i ] as $mytime ) { //@ 1.317 add context 2 $mytime->post_title = raindrops_fallback_title( $mytime->post_title, $mytime->ID ); $mytime->post_title = preg_replace( '|>.+[Article ' . $mytime->ID . ']post_title ); $output .= "ID ) ) . "\" id=\"post-" . absint( $mytime->ID ) . "\">" . strip_tags( $mytime->post_title, '' ) . "
    "; } } else { $output .= '.'; } $output .= '
    '; return $output; } } /* end raindrops_get_day( ) */ /** * for date.php * * * * */ if ( !function_exists( "raindrops_year_list" ) ) { function raindrops_year_list( $one_month, $ye, $mo ) { global $calendar_page_number, $post_per_page, $calendar_page_last, $calendar_page_start; $d = ""; $links = ""; $result = ""; foreach ( $one_month as $key => $month ) { list( $y, $m, $d ) = sscanf( $month->post_date, "%d-%d-%d $d:$d:$d" ); $month->post_title = raindrops_fallback_title( $month->post_title ); $month->post_title = preg_replace( '|>.+[link to ' . $month->ID . ']post_title ); if ( $m == $mo && $ye == $y ) { $links .= "
  • ID ) ) . "\" title=\"" . esc_attr( strip_tags( $month->post_title ) ) . "\">" . $month->post_title . "
  • "; } } if ( !empty( $links ) ) { $result .= "
      "; $result .= $links; $result .= "
    "; } return $result; } } /** * sort month_list * * * * */ if ( !function_exists( "raindrops_cmp_ids" ) ) { function raindrops_cmp_ids( $a, $b ) { $cmp = strcmp( $a->post_date, $b->post_date ); return $cmp; } } /** * for date.php * * * * * */ if ( !function_exists( "raindrops_month_list" ) ) { function raindrops_month_list( $one_month, $ye, $mo ) { global $calendar_page_number, $post_per_page, $calendar_page_last, $calendar_page_start, $wp_locale; $result = ""; $here = home_url(); $z = - 1; $c = 0; for ( $i = 1; $i <= raindrops_days_in_month( $mo, $ye ); $i++ ) { $links = ""; usort( $one_month, "raindrops_cmp_ids" ); $page_break = false; $first_data = false; foreach ( $one_month as $key => $month ) { $m = 0; list( $y, $m, $d, $h, $min, $s ) = sscanf( $month->post_date, "%d-%d-%d %d:%d:%d" ); if ( $key < $calendar_page_last && $key >= $calendar_page_start ) { if ( $d == $i && $m == $mo && $y == $ye ) { $first_data = true; $month->post_title = raindrops_fallback_title( $month->post_title ); $month->post_title = preg_replace( '|>.+[link to ' . $month->ID . ']post_title ); $html = '
  • %4$s <%7$s class="entry-date updated" %8$s>%9$s %12$s
  • '; $display_name = get_the_author_meta( 'display_name', $month->post_author ); $links .= sprintf( $html, 'h2 entry-title', esc_url( get_permalink( $month->ID ) ), 'link to content: ' . esc_attr( strip_tags( $month->post_title ) ), $month->post_title, $month->ID, ' ' . raindrops_post_class( array( 'clearfix' ), $month->ID, false ), raindrops_doctype_elements( 'span', 'time', false ), raindrops_doctype_elements( '', 'datetime="' . esc_attr( get_the_date( 'c' ) ) . '"', false ), $month->post_date, get_author_posts_url( get_the_author_meta( 'ID' ) ), sprintf( esc_attr__( 'View all posts by %s', 'raindrops' ), $display_name ), $display_name ); $c++; } } } $post_per_page = get_option( 'posts_per_page' ); $post_per_page = apply_filters( 'raindrops_month_list_post_count', $post_per_page ); if ( $z == $c && $c == $post_per_page ) { break; } if ( !empty( $links ) ) { $result .= ""; $result .= ""; $result .= $i; $result .= "
      "; $result .= $links; $result .= "
    "; } else { $result .= ""; $result .= $i; $result .= "  "; } $z = $c; } $month_name = $wp_locale->get_month( $m ); $year_name = apply_filters( 'raindrops_month_list_year_name', $y ); if ( get_locale() == 'ja' ) { $output = "

    " . esc_html( $year_name ) . " " . esc_html( $month_name ) . "

    "; } else { $output = "

    " . esc_html( $month_name ) . " " . esc_html( $year_name ) . "

    "; } return $output . '' . $result . "
    "; } } /** * index ,archive,loops page title * * echo Archives title * * */ if ( !function_exists( "raindrops_loop_title" ) ) { function raindrops_loop_title() { global $template; $Raindrops_class_name = ""; $page_title = ""; $page_title_c = ""; if ( is_search() ) { $Raindrops_class_name = 'serch-result'; $page_title = esc_html__( "Search Results", 'raindrops' ); $page_title_c = get_search_query(); } elseif ( is_tag() ) { $tag_id = absint( get_queried_object_id() ); $Raindrops_class_name = 'tag-archives tag-' . $tag_id; $page_title = esc_html__( "Tag Archives", 'raindrops' ); $page_title_c = single_term_title( "", false ); } elseif ( is_category() ) { $page_title_c = single_cat_title( '', false ); $category_id = get_cat_ID( $page_title_c ); $Raindrops_class_name = 'category-archives cat-item-' . $category_id; $page_title = esc_html__( "Category Archives", 'raindrops' ); } elseif ( is_archive() ) { $raindrops_date_format = get_option( 'date_format' ); if ( is_day() ) { $Raindrops_class_name = 'dayly-archives'; $page_title = esc_html__( 'Daily Archives', 'raindrops' ); $page_title_c = get_the_date( $raindrops_date_format ); } elseif ( is_month() ) { $Raindrops_class_name = 'monthly-archives'; $page_title = esc_html__( 'Monthly Archives', 'raindrops' ); if ( 'ja' == get_locale() ) { $page_title_c = get_the_date( 'Y / F' ); } else { $page_title_c = get_the_date( 'F Y' ); } } elseif ( is_year() ) { $Raindrops_class_name = 'yearly-archives'; $page_title = esc_html__( 'Yearly Archives', 'raindrops' ); $page_title_c = get_the_date( 'Y' ); } elseif ( is_author() ) { $Raindrops_class_name = 'author-archives'; $page_title = esc_html__( "Author Archives", 'raindrops' ); while ( have_posts() ) { the_post(); $page_title_c = get_avatar( get_the_author_meta( 'user_email' ), 32 ) . ' ' . get_the_author(); break; } rewind_posts(); } elseif ( has_post_format( 'aside' ) ) { $slug = 'aside'; $Raindrops_class_name = 'post-format-' . $slug; $page_title = esc_html__( 'Post Format', 'raindrops' ); $page_title_c = get_post_format_string( $slug ); } elseif ( has_post_format( 'chat' ) ) { $slug = 'chat'; $Raindrops_class_name = 'post-format-' . $slug; $page_title = esc_html__( 'Post Format', 'raindrops' ); $page_title_c = get_post_format_string( $slug ); } elseif ( has_post_format( 'gallery' ) ) { $slug = 'gallery'; $Raindrops_class_name = 'post-format-' . $slug; $page_title = esc_html__( 'Post Format', 'raindrops' ); $page_title_c = get_post_format_string( $slug ); } elseif ( has_post_format( 'link' ) ) { $slug = 'link'; $Raindrops_class_name = 'post-format-' . $slug; $page_title = esc_html__( 'Post Format', 'raindrops' ); $page_title_c = get_post_format_string( $slug ); } elseif ( has_post_format( 'image' ) ) { $slug = 'image'; $Raindrops_class_name = 'post-format-' . $slug; $page_title = esc_html__( 'Post Format', 'raindrops' ); $page_title_c = get_post_format_string( $slug ); } elseif ( has_post_format( 'quote' ) ) { $slug = 'quote'; $Raindrops_class_name = 'post-format-' . $slug; $page_title = esc_html__( 'Post Format', 'raindrops' ); $page_title_c = get_post_format_string( $slug ); } elseif ( has_post_format( 'status' ) ) { $slug = 'status'; $Raindrops_class_name = 'post-format-' . $slug; $page_title = esc_html__( 'Post Format', 'raindrops' ); $page_title_c = get_post_format_string( $slug ); } elseif ( has_post_format( 'video' ) ) { $slug = 'video'; $Raindrops_class_name = 'post-format-' . $slug; $page_title = esc_html__( 'Post Format', 'raindrops' ); $page_title_c = get_post_format_string( $slug ); } elseif ( has_post_format( 'audio' ) ) { $slug = 'audio'; $Raindrops_class_name = 'post-format-' . $slug; $page_title = esc_html__( 'Post Format', 'raindrops' ); $page_title_c = get_post_format_string( $slug ); } else { $Raindrops_class_name = 'blog-archives'; $page_title = esc_html__( "Blog Archives", 'raindrops' ); } } $page_title = apply_filters( 'raindrops_loop_title_page_title', $page_title ); if ( empty( $Raindrops_class_name ) ) { if ( is_front_page() ) { $Raindrops_class_name = 'front-page '; } $Raindrops_class_name .= basename( $template, '.php' ); $Raindrops_class_name = str_replace( array( '_', ), array( '-', ), $Raindrops_class_name ); } if ( !empty( $Raindrops_class_name ) ) { echo "\n" . str_repeat( "\t", 7 ) . '
      '; } else { echo "\n" . str_repeat( "\t", 7 ) . '
        '; } if ( !empty( $page_title ) ) { do_action( 'raindrops_loop_title_before' ); printf( '
      • %1$s %2$s
      • ', apply_filters( 'raindrops_archive_name', $page_title ), apply_filters( 'raindrops_archive_value', $page_title_c ), $Raindrops_class_name ); do_action( 'raindrops_loop_title_after' ); if ( is_category() ) { printf( '
      • %1$s
      • ', raindrops_category_navigation() ); } } } } /** * yui helper function * * * * * */ if ( !function_exists( "raindrops_yui_class_modify" ) ) { function raindrops_yui_class_modify( $raindrops_inner_class = 'yui-ge' ) { // global $yui_inner_layout; $value = raindrops_warehouse_clone( 'raindrops_right_sidebar_width_percent' ); if ( '25' == $value ) { $yui_inner_layout = 'yui-ge'; } elseif ( '75' == $value ) { $yui_inner_layout = 'yui-gf'; } elseif ( '33' == $value ) { $yui_inner_layout = 'yui-gc'; } elseif ( '66' == $value ) { $yui_inner_layout = 'yui-gd'; } elseif ( '50' == $value ) { $yui_inner_layout = 'yui-g'; } else { $yui_inner_layout = 'yui-ge'; } return apply_filters( 'raindrops_yui_class_modify', $yui_inner_layout ); } } /** * Template conditional function Raindrops display 2column or not * * * @param string css rule or text * @param bool if value is true echo or false return * @return string input strings text */ if ( !function_exists( "raindrops_is_2col" ) ) { function raindrops_is_2col( $action = true, $echo = true ) { global $template; $template_name = basename( $template, '.php' ); $raindrops_col_setting_type = raindrops_warehouse_clone( 'raindrops_col_setting_type' ); if ( 'simple' == $raindrops_col_setting_type ) { if ( 'hide' == raindrops_warehouse_clone( 'raindrops_show_right_sidebar' ) ) { if ( true == $echo ) { echo $action; } else { return $action; } } else { return false; } } if ( 'details' == $raindrops_col_setting_type ) { if ( is_home() && 2 == raindrops_warehouse_clone( 'raindrops_sidebar_index' ) ) { if ( true == $echo ) { echo $action; } else { return $action; } } if ( is_date() && 2 == raindrops_warehouse_clone( 'raindrops_sidebar_date' ) ) { if ( true == $echo ) { echo $action; } else { return $action; } } if ( is_page() && 2 == raindrops_warehouse_clone( 'raindrops_sidebar_page' ) ) { if ( true == $echo ) { echo $action; } else { return $action; } } if ( is_search() && 2 == raindrops_warehouse_clone( 'raindrops_sidebar_search' ) ) { if ( true == $echo ) { echo $action; } else { return $action; } } if ( is_single() && 2 == raindrops_warehouse_clone( 'raindrops_sidebar_single' ) ) { if ( true == $echo ) { echo $action; } else { return $action; } } if ( is_archive() && 'image' == $template_name && 2 == raindrops_warehouse_clone( 'raindrops_sidebar_image_archive' ) ) { if ( true == $echo ) { echo $action; } else { return $action; } } if ( is_404() && 2 == raindrops_warehouse_clone( 'raindrops_sidebar_404' ) ) { if ( true == $echo ) { echo $action; } else { return $action; } } if ( is_page() && 'list-of-post' == $template_name && 2 == raindrops_warehouse_clone( 'raindrops_sidebar_list_of_post' ) ) { if ( true == $echo ) { echo $action; } else { return $action; } } if ( is_category() && 2 == raindrops_warehouse_clone( 'raindrops_sidebar_category' ) ) { if ( true == $echo ) { echo $action; } else { return $action; } } if ( is_tag() && 2 == raindrops_warehouse_clone( 'raindrops_sidebar_tag' ) ) { if ( true == $echo ) { echo $action; } else { return $action; } } if ( is_author() && 2 == raindrops_warehouse_clone( 'raindrops_sidebar_author' ) ) { if ( true == $echo ) { echo $action; } else { return $action; } } return false; } } } /** * yui layout calc * * * * @return content width */ if ( !function_exists( "raindrops_main_width" ) ) { function raindrops_main_width() { return absint( raindrops_content_width_clone() ); } } /** * content width calc * * * * * @return main column width */ if ( !function_exists( "raindrops_content_width" ) ) { function raindrops_content_width() { return absint( apply_filters( 'raindrops_content_width', raindrops_content_width_clone() ) ); } } /** * plugin API * * * * * */ if ( !function_exists( "raindrops_plugin_is_active" ) ) { function raindrops_plugin_is_active( $plugin_path ) { $return_var = in_array( $plugin_path, get_option( 'active_plugins' ) ); return $return_var; } if ( raindrops_plugin_is_active( 'tmn-quickpost/tmn-quickpost.php' ) ) { global $base_info; foreach ( $base_info[ 'root' ] as $key => $val ) { $wp_cockneyreplace[ '%' . $key . '%' ] = $val; } function raindrops_import_post_meta() { global $post, $base_info; $r = get_post_meta( $post->ID, 'template', true ); foreach ( $base_info[ 'root' ] as $key => $val ) { $r = str_replace( '%' . $key . '%', $val, $r ); } if ( class_exists( 'trans' ) ) { $n = new trans( $r ); return $n->text2html(); } else { return $r; } } } } /** * Empty title fallback * * */ if ( !function_exists( 'raindrops_fallback_title' ) ) { function raindrops_fallback_title( $title, $id = 0 ) { global $post, $raindrops_link_unique_text; $format_label = ''; if ( 0 == $id && is_object( $post ) ) { $id = $post->ID; } //@ 1.317 $id = absint( $id ); if ( !is_admin() ) { $format = get_post_format( $id ); if ( false === $format ) { $image_uri = get_template_directory_uri() . '/images/link.png'; $class = 'icon-link-no-title'; $format_label = esc_html__( 'Article', 'raindrops' ); } else { $image_uri = get_template_directory_uri() . '/images/post-format-' . $format . '.png'; $class = 'icon-post-format-notitle icon-post-format-' . $format; if ( 'link' == $format ) { $add_label = esc_html__( ' to entry', 'raindrops' ); } else { $add_label = ''; } $format_labels = array( 'standard' => __( 'Standard', 'raindrops' ), 'aside' => __( 'Aside', 'raindrops' ), 'chat' => __( 'Chat', 'raindrops' ), 'gallery' => __( 'Gallery', 'raindrops' ), 'link' => __( 'Link', 'raindrops' ), 'image' => __( 'Image', 'raindrops' ), 'quote' => __( 'Quote', 'raindrops' ), 'status' => __( 'Status', 'raindrops' ), 'video' => __( 'Video', 'raindrops' ), 'audio' => __( 'Audio', 'raindrops' ), ); if ( isset( $format_labels[ $format ] ) ) { $format_label = esc_attr( $format_labels[ $format ] ); } else { $format_label = esc_attr( $format ); } $format_label = esc_html__( 'Post Format ', 'raindrops' ) . $format_label . $add_label; } $raindrops_post_thumbnail_size = array( 48, 48 ); if ( in_the_loop() ) { //@ 1.317 $raindrops_post_thumbnail_size = apply_filters( 'raindrops_post_thumbnail_size_main_query', array( 48, 48 ), $post->ID, get_post_class( '', $post->ID ) ); $raindrops_post_thumbnail_size = apply_filters( 'raindrops_post_thumbnail_size_main_query', array( 48, 48 ), $id, get_post_class( '', $id ) ); } $thumbnail = ''; //@ 1.317 if ( in_the_loop() && has_post_thumbnail( $post->ID ) && !post_password_required() && !is_singular() ) { if ( in_the_loop() && has_post_thumbnail( $id ) && !post_password_required() && !is_singular() ) { $thumbnail .= ''; $thumbnail .= get_the_post_thumbnail( $post->ID, $raindrops_post_thumbnail_size, array( "style" => "vertical-align:middle;", "alt" => null ) ); $thumbnail .= ''; } //@ 1.317 if (isset( $post->ID ) && ! is_404() && !has_post_thumbnail( $post->ID ) && !is_singular() && !post_password_required() ) { if ( isset( $id ) && !is_404() && !has_post_thumbnail( $id ) && !is_singular() && !post_password_required() ) { $thumbnail = apply_filters( 'raindrops_title_thumbnail', $thumbnail, '', '' ); } if ( !is_singular() && in_the_loop() ) { $raindrops_entry_title_text_allow = apply_filters( 'raindrops_entry_title_text_elements_allow', true ); if ( true == $raindrops_entry_title_text_allow ) { $title = $thumbnail . '' . $title . ''; } else { $title = $thumbnail . $title; } } else { $title = $thumbnail . $title; } $striped_title = wp_kses( $title, array() ); if ( empty( $title ) || empty( $striped_title ) ) { $html = $thumbnail . ''; return $html; } } $raindrops_link_unique_text = raindrops_link_unique_text(); //@ 1.317 if ( isset( $post->ID ) && $raindrops_link_unique_text == true ) { if ( isset( $id ) && $raindrops_link_unique_text == true ) { $title = $title . raindrops_unique_entry_title( $id ); } return apply_filters( 'raindrops_fallback_title', $title ); } } /** * for remove title html escaped from plug-ins * @param type $title * @return type * @since 1.276 */ if ( !function_exists( 'raindrops_strip_escaped_title' ) ) { function raindrops_strip_escaped_title( $title ) { /** * @1.423 add filter */ $title = apply_filters( 'raindrops_strip_escaped_title', $title ); return preg_replace( '!<.*?>!', '', $title ); } } /** * * * * @since 1.139 */ if ( !function_exists( 'raindrops_detect_header_image_size' ) ) { function raindrops_detect_header_image_size( $xy = 'width' ) { global $raindrops_custom_header_args; return raindrops_detect_header_image_size_clone( $xy ); } } if ( !function_exists( 'raindrops_the_header_image' ) ) { function raindrops_the_header_image( $type = 'default', $args = array() ) { global $raindrops_link_unique_text; /** * Custom Header */ $raindrops_title_in_the_header_check = raindrops_warehouse_clone( 'raindrops_place_of_site_title' ); if ( true == $raindrops_link_unique_text || $raindrops_title_in_the_header_check == 'header_image' ) { $type = 'elements'; } else { $type = 'home_url'; } echo raindrops_header_image( $type, $args ); } } /** * Template function print header image * * This function has filter hook name raindrops_header_image * @param array( 'img'=> 'image uri' , 'height' => 'image height' , 'color' => 'text color', 'style' => '( default ) background-size:cover;' , 'description' => 'replace text from bloginfo( description ) to your text','description_style' => 'Your description style rule' ) * @return string htmlblock

        [WordPress site description]

        */ if ( !function_exists( 'raindrops_header_image' ) ) { function raindrops_header_image( $type = 'default', $args = array() ) { global $raindrops_page_width, $post, $raindrops_custom_header_height; $raindrops_document_width = $raindrops_page_width; $raindrops_header_image = get_custom_header(); $raindrops_header_image_uri = $raindrops_header_image->url; $raindrops_header_image_width = apply_filters( 'raindrops_header_image_width', raindrops_detect_header_image_size( 'width' ) ); $raindrops_header_image_height = apply_filters( 'raindrops_header_image_height', raindrops_detect_header_image_size( 'height' ) ); $raindrops_restore_check = get_theme_mod( 'header_image', get_theme_support( 'custom-header', 'default-image' ) ); $raindrops_field_exists_check = get_post_custom_values( '_raindrops_this_header_image' ); if ( $raindrops_field_exists_check !== null ) { $display_header_image_file = get_post_meta( $post->ID, '_raindrops_this_header_image', true ); if ( $display_header_image_file == 'hide' && is_singular() ) { return; } if ( !empty( $display_header_image_file ) && $display_header_image_file !== 'default' && is_singular() ) { $display_header_image_attr = wp_get_attachment_image_src( $display_header_image_file, 'full' ); if ( !empty( $display_header_image_attr ) ) { $raindrops_header_image_uri = $display_header_image_attr[ 0 ]; $raindrops_header_image_width = $display_header_image_attr[ 1 ]; $raindrops_header_image_height = $display_header_image_attr[ 2 ]; } } } if ( 'remove-header' == $raindrops_restore_check ) { return; } if ( empty( $raindrops_header_image_uri ) ) { $raindrops_header_image_uri = $raindrops_restore_check; } if ( $raindrops_header_image_width > 0 && $raindrops_header_image_height > 0 ) { $ratio = $raindrops_header_image_height / $raindrops_header_image_width; } else { $ratio = 0; } $raindrops_width = raindrops_warehouse_clone( 'raindrops_page_width' ); switch ( true ) { case 'doc' == $raindrops_width: $raindrops_document_width = 750; break; case 'doc2' == $raindrops_width: $raindrops_document_width = 950; break; case 'doc4' == $raindrops_width: $raindrops_document_width = 974; break; case is_numeric( $raindrops_width ): $raindrops_document_width = $raindrops_page_width; break; case 'doc3' == $raindrops_width: $raindrops_document_width = 950; //this value is fake following javascript break; } if ( $raindrops_header_image_width >= $raindrops_document_width ) { $height_current = round( $raindrops_document_width * $ratio ) . 'px'; $block_style = 'background-size:cover;'; } else { $height_current = round( $raindrops_header_image_height ) . 'px'; $block_style = 'background-repeat:no-repeat;background-position:center;background-color:#000;background-size:auto; background-origin:content-box;'; } if ( 'doc3' == $raindrops_width ) { $block_style = str_replace( 'background-size:auto', 'background-size:cover', $block_style ); } //w3standard can not use CSS3 if ( 'w3standard' == raindrops_warehouse( 'raindrops_style_type' ) ) { $block_style = 'background-repeat:no-repeat;background-position:center;background-color:#000;'; } if ( '' == get_header_image() ) { $height = 0; $description_style = ' style="display:none;"'; } $defaults = array( 'img' => $raindrops_header_image_uri, 'height' => $height_current, 'color' => get_theme_mod( 'header_textcolor' ), 'style' => $block_style, 'text' => get_bloginfo( 'description' ), 'text_attr' => '' ); $args = wp_parse_args( $args, $defaults ); extract( $args, EXTR_SKIP ); if ( 'blank' == get_theme_mod( 'header_textcolor' ) ) { $text_attr = ' style="display:none;"'; } elseif ( preg_match( "!([0-9a-f]{6}|[0-9a-f]{3})!si", get_theme_mod( 'header_textcolor' ) ) ) { $add_class = ''; $add_style = ''; if ( preg_match( '!style!', $text_attr ) ) { $add_style = str_replace( array( 'style', "'", '"', '=' ), '', $text_attr ); } else { $add_class = $text_attr; } /* @1.326 remove inline style ' style="color:#' . esc_attr( get_theme_mod( 'header_textcolor' ) ) . ';' . */ $text_attr = esc_attr( $add_style ) . ' ' . esc_html( $add_class ); $text_attr = apply_filters( 'raindrops_header_image_description_attr', $text_attr ); } $responsive_page_width_check = Raindrops_warehouse_clone( "raindrops_page_width" ); if ( 'doc3' == $responsive_page_width_check || 'doc5' == $responsive_page_width_check ) { $width = 'width:100%'; $height = apply_filters( 'raindrops_header_image_height', $raindrops_custom_header_height ) . 'px'; } else { $width = 'width:' . $raindrops_document_width . 'px'; } if ( $type == 'default' || !isset( $type ) ) { $html = '

        %7$s

        '; $html = sprintf( $html, 'header-image', esc_url( $img ), esc_html( $height ), esc_html( $color ), esc_html( $style ), htmlspecialchars( $text_attr, ENT_NOQUOTES ), esc_html( $text ), $width ); if ( $color == 'blank' ) { $html = str_replace( 'color:#blank;', '', $html ); } return apply_filters( "raindrops_header_image", $html ); } elseif ( 'css' == $type ) { $old_ie = ''; $http_user_agent = filter_input( INPUT_ENV, 'HTTP_USER_AGENT' ); preg_match( "|(MSIE )([0-9]{1,2})(\.)|si", $http_user_agent, $regs ); if ( isset( $regs[ 2 ] ) ) { $old_ie = 'ie' . $regs[ 2 ]; } $raindrops_header_imge_filter_color = raindrops_warehouse_clone( 'raindrops_header_image_filter_color' ); $raindrops_header_image_color_rgb_array = raindrops_hex2rgb_array_clone( $raindrops_header_imge_filter_color ); $raindrops_header_image_filter_apply_top = raindrops_warehouse_clone( 'raindrops_header_image_filter_apply_top' ); $raindrops_header_image_filter_apply_bottom = raindrops_warehouse_clone( 'raindrops_header_image_filter_apply_bottom' ); $raindrops_enable_header_image_filter = raindrops_warehouse_clone( 'raindrops_enable_header_image_filter' ); if ( false !== $raindrops_header_image_color_rgb_array && 'enable' == $raindrops_enable_header_image_filter && $old_ie !== 'ie8' && $old_ie !== 'ie9' ) { // client side yet 1.298 $style_rule_template = ' background: linear-gradient( rgba(%1$s, %2$s, %3$s, %4$s),rgba(%1$s, %2$s, %3$s, %5$s) ), url(%6$s); background: -moz-linear-gradient( rgba(%1$s, %2$s, %3$s, %4$s),rgba(%1$s, %2$s, %3$s, %5$s) ), url(%6$s); background-size:cover;'; $background_property = sprintf( $style_rule_template, $raindrops_header_image_color_rgb_array[ 0 ], $raindrops_header_image_color_rgb_array[ 1 ], $raindrops_header_image_color_rgb_array[ 2 ], $raindrops_header_image_filter_apply_top, $raindrops_header_image_filter_apply_bottom, esc_url( $img ) ); } else { $background_property = 'background-image:url( ' . esc_url( $img ) . ' );'; } $css = '#%1$s{%2$s%8$s;height:%3$s;color:#%4$s;%5$s}' . "\n" . '#%1$s p {%6$s}'; $text_attr = str_replace( array( 'style', '=', '"', "'" ), '', $text_attr ); $css = sprintf( $css, 'header-image', apply_filters( 'raindrops_header_image_background_image', $background_property ), esc_html( $height ), esc_html( $color ), apply_filters( 'raindrops_header_image_background_style', esc_html( $style ) ), // css needs > but this style is inline htmlspecialchars( $text_attr, ENT_NOQUOTES ), // css needs > but this style is inline esc_html( $text ), $width ); if ( $color == 'blank' ) { $css = str_replace( 'color:#blank;', '', $css ); } return apply_filters( "raindrops_header_image_css", $css ); } elseif ( 'elements' == $type ) { $elements = '
        ' . apply_filters( 'raindrops_header_image_contents', '' ) . '

        %2$s

        '; $elements = sprintf( $elements, 'header-image', esc_html( $text ), $text_attr ); return apply_filters( "raindrops_header_image_elements", $elements ); } elseif ( 'home_url' == $type ) { $elements = '
        ' . apply_filters( 'raindrops_header_image_contents', '' ) . '

        %2$s

        '; $elements = sprintf( $elements, 'header-image', esc_html( $text ), esc_url( home_url() ), $text_attr ); return apply_filters( "raindrops_header_image_home_url", $elements ); } } } /** * Print site description html * * This function has filter hook name raindrops_site_description * * @param array( "text" => 'Some text' , "switch" => ' style="display:none;"' ) * @return string htmlblock
        [input text]
        * */ if ( !function_exists( 'raindrops_site_description' ) ) { function raindrops_site_description( $args = array() ) { // if ( 'blank' == get_theme_mod( 'header_textcolor' ) ) { if ( 'above' == raindrops_warehouse_clone( 'raindrops_tagline_in_the_header_image' ) ) { $raindrops_show_hide = ''; } elseif ( preg_match( "!([0-9a-f]{6}|[0-9a-f]{3})!si", get_header_textcolor() ) ) { $raindrops_show_hide = ' style="display:none;"'; } else { $raindrops_show_hide = ' style="display:none;"'; } $defaults = array( 'text' => get_bloginfo( 'description' ), 'switch' => $raindrops_show_hide ); $args = wp_parse_args( $args, $defaults ); extract( $args, EXTR_SKIP ); $html = '
        %2$s
        '; $html = sprintf( $html, $switch, $text ); return apply_filters( "raindrops_site_description", $html ); } } /** * Print the site title * * This function has filter hook name raindrops_site_title( #site-title ) * * * @param $text string append to title strings * @return htmlblock <[h1|div] class="h1" id="site-title">[bloginfo( name )] */ if ( function_exists( 'the_custom_logo' ) ) { /* for WordPress 4.5 */ /** * * @see https://developers.google.com/search/docs/data-types/articles#amp-logo-guidelines */ add_image_size( 'raindrops-logo', 1200, 120 ); add_theme_support( 'custom-logo', array( 'size' => 'raindrops-logo' ) ); } if ( !function_exists( 'raindrops_site_title' ) ) { function raindrops_site_title( $text = "" ) { global $raindrops_document_type; if ( 'xhtml' == $raindrops_document_type ) { if ( is_home() || is_front_page() ) { $heading_elememt = 'h1'; } else { $heading_elememt = 'div'; } } else { $heading_elememt = 'h1'; } $header_text_color = get_theme_mod( 'header_textcolor' ); // check hex value if ( 'blank' == $header_text_color || '' == $header_text_color ) if ( preg_match( '|^([A-Fa-f0-9]{3}){1,2}$|', $header_text_color ) ) { $hd_style = ' style="color:#' . $header_text_color . ';"'; } else { $hd_style = ''; } if ( function_exists( 'the_custom_logo' ) ) { if ( 'hide' == raindrops_warehouse_clone( "raindrops_display_site_title" ) ) { $logo = get_custom_logo(); } else { $logo = '' . strip_tags( get_custom_logo(), '' ) . ''; } } else { $logo = ''; } $title_format = '<%1$s class="%6$s" id="site-title">%7$s%5$s'; $html = sprintf( $title_format, $heading_elememt, esc_url( home_url() ), esc_attr( 'site title ' . get_bloginfo( 'name', 'display' ) ), "home", get_bloginfo( 'name', 'display' ) . esc_html( $text ), apply_filters( 'raindrops_site_title_class', 'h1' ), $logo ); return apply_filters( "raindrops_site_title", $html ); } } /** * * * * * */ if ( !function_exists( "raindrops_column_controller" ) ) { function raindrops_column_controller( $col = false ) { global $post; if ( $col !== false && !is_singular() ) { return absint( $col ); } if ( isset( $post ) ) { $filter_column = apply_filters( 'raindrops_column_controller', '', $post->ID ); } else { $filter_column = apply_filters( 'raindrops_column_controller', '', 0 ); } if ( !empty( $filter_column ) && !is_int( $filter_column ) ) { $filter_column = false; } if ( isset( $post ) ) { if ( false !== ($type = raindrops_has_indivisual_notation() ) ) { if ( isset( $type[ 'col' ] ) ) { return absint( $type[ 'col' ] ); } } if ( !empty( $filter_column ) ) { return absint( $filter_column ); } if ( 'hide' == Raindrops_warehouse_clone( 'raindrops_show_right_sidebar' ) ) { return 2; } elseif ( 'show' == Raindrops_warehouse_clone( 'raindrops_show_right_sidebar' ) ) { return 3; } } return false; } } /** * * * * * */ if ( !function_exists( "raindrops_color_type_custom" ) ) { function raindrops_color_type_custom( $css ) { global $post; if ( isset( $post ) ) { $filter_custom_color = apply_filters( 'raindrops_color_type_custom', '', $post->ID ); } else { $filter_custom_color = apply_filters( 'raindrops_color_type_custom', '', 0 ); } if ( !empty( $filter_custom_color ) ) { /* validate value */ $raindrops_style_type_choices = raindrops_register_styles( "w3standard" ); if ( !array_key_exists( $filter_custom_color, $raindrops_style_type_choices ) ) { $filter_custom_color = ''; } } if ( false !== ($type = raindrops_has_indivisual_notation() ) ) { if ( isset( $type[ 'color_type' ] ) ) { return raindrops_design_output( $type[ 'color_type' ] ) . raindrops_color_base(); } if ( !empty( $filter_custom_color ) ) { return raindrops_design_output( $filter_custom_color ) . raindrops_color_base( $filter_custom_color ); } else { return $css; } } elseif ( intval( get_query_var( 'raindrops_color_type' ) ) == 1 && $post_id = get_query_var( 'raindrops_pid' ) ) { $type = raindrops_has_indivisual_notation( $post_id ); if ( isset( $type[ 'color_type' ] ) ) { return raindrops_design_output( $type[ 'color_type' ] ) . raindrops_color_base(); } else { if ( !empty( $filter_custom_color ) ) { $color_type = $filter_custom_color; return raindrops_design_output( $color_type ) . raindrops_color_base(); } else { return $css; } } } else { return $css; } } } /** * * * * * */ if ( !function_exists( "raindrops_delete_post_link" ) ) { function raindrops_delete_post_link( $link_text = null, $before = '', $after = '', $id = 0, $echo = true ) { global $post; if ( RAINDROPS_SHOW_DELETE_POST_LINK !== true ) { return; } if ( empty( $link_text ) ) { $link_text = esc_html__( 'Trash', 'raindrops' ); } if ( current_user_can( 'edit_post', $post->ID ) && $url = get_delete_post_link() ) { $html = $before . '%2$s' . $after; $html = sprintf( $html, esc_url( $url ), $link_text ); if ( $echo !== true ) { return $html; } else { echo $html; } } } } /** * comment reply * * * * @since 0.956 */ if ( !function_exists( "raindrops_enqueue_comment_reply" ) ) { function raindrops_enqueue_comment_reply() { if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } } if ( !function_exists( 'raindrops_load_small_device_helper' ) ) { /** * * @global type $raindrops_current_data_version * @global type $is_IE * @global type $raindrops_fluid_maximum_width * @global type $raindrops_browser_detection * @global type $post * @global type $template * @global type $raindrops_link_unique_text * @since 1.254 */ function raindrops_load_small_device_helper() { global $raindrops_current_data_version, $is_IE, $raindrops_fluid_maximum_width, $raindrops_browser_detection, $post, $template, $raindrops_link_unique_text, $raindrops_fallback_image_for_entry_content_enable, $raindrops_fallback_human_interface_show, $raindrops_add_inline_style_for_sidebars; if ( true == $raindrops_fallback_human_interface_show ) { return; } $raindrops_header_image = get_custom_header(); $raindrops_header_image_uri = $raindrops_header_image->url; $ratio = 0; if ( empty( $raindrops_header_image_uri ) ) { $raindrops_header_image_uri = get_header_image(); } $raindrops_header_image_width = apply_filters( 'raindrops_header_image_width', raindrops_detect_header_image_size( 'width' ) ); $raindrops_header_image_height = apply_filters( 'raindrops_header_image_height', raindrops_detect_header_image_size( 'height' ) ); $raindrops_field_exists_check = get_post_custom_values( '_raindrops_this_header_image' ); if ( $raindrops_field_exists_check !== null ) { $display_header_image_file = get_post_meta( $post->ID, '_raindrops_this_header_image', true ); if ( !empty( $display_header_image_file ) && $display_header_image_file !== 'default' && is_singular() ) { $display_header_image_attr = wp_get_attachment_image_src( $display_header_image_file, 'full' ); if ( !empty( $display_header_image_attr ) ) { $raindrops_header_image_uri = esc_url( $display_header_image_attr[ 0 ] ); $raindrops_header_image_width = absint( $display_header_image_attr[ 1 ] ); $function = absint( $display_header_image_attr[ 2 ] ); } } } $raindrops_restore_check = get_theme_mod( 'header_image', get_theme_support( 'custom-header', 'default-image' ) ); if ( $raindrops_restore_check !== 'remove-header' ) { if ( $raindrops_header_image_width > 0 && $raindrops_header_image_height > 0 ) { $ratio = $raindrops_header_image_height / $raindrops_header_image_width; } else { $ratio = 0; } } $raindrops_current_template = basename( $template, '.php' ); if ( $raindrops_current_template == 'list_of_post' ) { $raindrops_ignore_template = true; } else { $raindrops_ignore_template = false; } $color_type = ''; if ( false !== ($type = raindrops_has_indivisual_notation() ) ) { if ( isset( $type[ 'color_type' ] ) ) { $color_type .= sanitize_html_class( "rd-type-" . $type[ 'color_type' ] ); } if ( isset( $type[ 'col' ] ) ) { $color_type .= ' '; $color_type .= sanitize_html_class( "rd-col-" . $type[ 'col' ] ); } } else { $raindrops_style_type = raindrops_warehouse_clone( 'raindrops_style_type' ); if ( !empty( $raindrops_style_type ) ) { $color_type = esc_attr( "rd-type-" . $raindrops_style_type ); } } $raindrops_page_width = raindrops_warehouse_clone( 'raindrops_page_width' ); if ( false !== ( $url = raindrops_locate_url( 'raindrops-helper.js' ) ) ) { wp_enqueue_script( 'raindrops_helper_script', $url, array( 'jquery' ), $raindrops_current_data_version, true ); } if ( $raindrops_browser_detection == true ) { $raindrops_browser_detection = 1; } else { $raindrops_browser_detection = 0; } if ( is_singular() == true ) { $raindrops_is_singular = 1; } else { $raindrops_is_singular = 0; } if ( is_single() == true ) { $raindrops_is_single = 1; } else { $raindrops_is_single = 0; } if ( is_page() == true ) { $raindrops_is_page = 1; } else { $raindrops_is_page = 0; } $raindrops_link_unique_text = raindrops_link_unique_text(); /* @1.328 */ if ( true == $raindrops_fallback_image_for_entry_content_enable ) { $raindrops_fallback_image_for_entry_content = esc_url( raindrops_warehouse_clone( 'raindrops_fallback_image_for_entry_content' ) ); } else { $raindrops_fallback_image_for_entry_content = false; } if ( wp_is_mobile() ) { $kind_of_browser = 'rd-mobile'; } else { $kind_of_browser = 'rd-pc'; } /* comments */ if ( 1 == get_option( 'require_name_email' ) ) { $raindrops_required_name_email = 1; } else { $raindrops_required_name_email = 0; } /* menu percent font size */ $raindrops_menu_primary_font_size = absint( raindrops_warehouse_clone( 'raindrops_menu_primary_font_size' ) ); $raindrops_menu_primary_font_size = $raindrops_menu_primary_font_size / 100; /* base font size of pixel */ $raindrops_basefont_size = raindrops_warehouse_clone( 'raindrops_basefont_settings' ); $raindrops_current_menu_font_size = (float) $raindrops_basefont_size * $raindrops_menu_primary_font_size; $raindrops_current_menu_button_height = $raindrops_current_menu_font_size * 3.4; //3.4 is line-height $raindrops_menu_height_check_value = apply_filters( 'raindrops_menu_height_check_value', absint( $raindrops_current_menu_button_height * 1.8 ), $raindrops_basefont_size, $raindrops_menu_primary_font_size ); //near 2 line wp_localize_script( 'raindrops_helper_script', 'raindrops_script_vars', array( 'is_ie' => $is_IE, 'fluid_maximum_width' => $raindrops_fluid_maximum_width, 'browser_detection' => $raindrops_browser_detection, 'template' => $template, 'link_unique_text' => $raindrops_link_unique_text, 'header_image_uri' => $raindrops_header_image_uri, 'header_image_width' => $raindrops_header_image_width, 'header_image_height' => $raindrops_header_image_height, 'field_exists_check' => $raindrops_field_exists_check, 'restore_check' => $raindrops_restore_check, 'ratio' => apply_filters( 'raindrops_header_image_ratio', $ratio ), 'has_ratio_filter' => has_filter( 'raindrops_header_image_ratio' ), 'current_template' => $raindrops_current_template, 'ignore_template' => $raindrops_ignore_template, 'is_single' => $raindrops_is_single, 'is_page' => $raindrops_is_page, 'is_singular' => $raindrops_is_singular, 'browser_detection' => $raindrops_browser_detection, 'color_type' => $color_type, 'page_width' => $raindrops_page_width, 'accessibility_settings' => raindrops_warehouse_clone( 'raindrops_accessibility_settings' ), 'fallback_image_for_entry_content' => $raindrops_fallback_image_for_entry_content, 'blockquote_cite_i18n' => esc_html__( 'cite:', 'raindrops' ), 'kind_of_browser' => $kind_of_browser, 'require_name_email' => $raindrops_required_name_email, 'placeholder_text_message' => esc_html__( "Message", 'raindrops' ), 'placeholder_text_required_message' => esc_html__( "Required Your Message", 'raindrops' ), 'placeholder_text_comment_name' => esc_html__( "Name", 'raindrops' ), 'placeholder_text_required_comment_name' => esc_html__( "Required Your Name", 'raindrops' ), 'placeholder_text_email' => esc_html__( "Email Address", 'raindrops' ), 'placeholder_text_required_email' => esc_html__( "Required Your Email", 'raindrops' ), 'placeholder_text_url' => esc_html__( "Website", 'raindrops' ), 'home_url' => home_url(), 'content_shareing' => raindrops_content_shareing(), 'raindrops_primary_menu_responsive' => raindrops_warehouse_clone( 'raindrops_primary_menu_responsive' ), 'raindrops_primary_menu_responsive_height' => $raindrops_menu_height_check_value, 'raindrops_raindrops_sticky_menu' => raindrops_warehouse_clone( 'raindrops_sticky_menu' ), 'raindrops_default_sidebar_responsive' => raindrops_warehouse_clone( 'raindrops_default_sidebar_responsive' ), 'raindrops_extra_sidebar_responsive' => raindrops_warehouse_clone( 'raindrops_extra_sidebar_responsive' ), 'raindrops_sidebar_responsive_text_op' => esc_html__( 'Open', 'raindrops' ), 'raindrops_sidebar_responsive_text_cl' => esc_html__( 'Close', 'raindrops' ), 'raindrops_archive_has_count' => raindrops_archive_has_count(), 'raindrops_add_inline_style_for_sidebars' => $raindrops_add_inline_style_for_sidebars, ) ); wp_reset_postdata(); } } /** * * * * * */ if ( !function_exists( 'raindrops_custom_width' ) ) { function raindrops_custom_width() { global $raindrops_page_width; $c_width = (int) $raindrops_page_width; $width = $c_width / 13; $ie_width = $width * 0.9759; $custom_content_width = '/* set custom content width start */' . '#custom-doc {margin:auto;text-align:left;' . "\n" . 'width:' . round( $width, 0 ) . 'em;' . "\n" . '*width:' . round( $ie_width, 0 ) . 'em;' . "\n" . 'min-width:' . round( $width * 0.7, 0 ) . 'em;}/* set custom content width end */'; return apply_filters( "raindrops_custom_width", $custom_content_width ); } } /** * * * * * */ if ( !function_exists( 'raindrops_is_fluid' ) ) { function raindrops_is_fluid() { global $post, $is_IE, $raindrops_fluid_minimum_width, $raindrops_fluid_maximum_width, $raindrops_current_column, $raindrops_stylesheet_type, $raindrops_header_image_default_ratio; if ( !isset( $raindrops_stylesheet_type ) ) { $raindrops_stylesheet_type = raindrops_warehouse_clone( 'raindrops_stylesheet_in_html' ); } $content_width = raindrops_content_width_clone(); $width = intval( $raindrops_fluid_minimum_width ); $extra_sidebar_width = raindrops_warehouse_clone( 'raindrops_right_sidebar_width_percent' ); $fluid_width = ''; $page_width = raindrops_warehouse_clone( 'raindrops_page_width' ); if ( '25' == $extra_sidebar_width ) { $main_column_width_fluid = 74.2; } elseif ( '75' == $extra_sidebar_width ) { $main_column_width_fluid = 24; } elseif ( '33' == $extra_sidebar_width ) { $main_column_width_fluid = 64; } elseif ( '66' == $extra_sidebar_width ) { $main_column_width_fluid = 32; } elseif ( '50' == $extra_sidebar_width ) { $main_column_width_fluid = 49; } else { $main_column_width_fluid = 100; } if ( 'show' !== raindrops_warehouse_clone( 'raindrops_show_right_sidebar' ) ) { $main_column_width_fluid = 100; } $padding_height = $raindrops_header_image_default_ratio * 100; $raindrops_header_image_width = absint( raindrops_detect_header_image_size_clone( 'width' ) ); $raindrops_header_image_height = absint( raindrops_detect_header_image_size_clone( 'height' ) ); $raindrops_field_exists_check = get_post_custom_values( '_raindrops_this_header_image' ); if ( is_singular() && $raindrops_field_exists_check !== null ) { $display_header_image_file = get_post_meta( $post->ID, '_raindrops_this_header_image', true ); $display_header_image_attr = wp_get_attachment_image_src( $display_header_image_file, 'full' ); if ( !empty( $display_header_image_attr ) ) { $raindrops_header_image_uri = $display_header_image_attr[ 0 ]; $raindrops_header_image_width = $display_header_image_attr[ 1 ]; $raindrops_header_image_height = $display_header_image_attr[ 2 ]; } } if ( $raindrops_header_image_height !== 0 && $raindrops_header_image_width !== 0 ) { $padding_height = $raindrops_header_image_height / $raindrops_header_image_width * 100; } if ( 'doc3' == $page_width ) { $fluid_width = "\n" . '/* raindrops is fluid start */' . "\n#doc3,.raindrops-auto-fit-width{min-width:" . $raindrops_fluid_minimum_width . 'px;max-width:' . $raindrops_fluid_maximum_width . 'px;}' . "\n#access{min-width:" . $raindrops_fluid_minimum_width . 'px;}' . "\n" . ".rd-pw-doc3.rd-col-1 .breadcrumbs{width:" . $content_width . 'px;margin:auto;}' . "\n"; if ( false == has_filter( 'raindrops_header_image_ratio' ) ) { $fluid_width .= "#doc3 #header-image{ display:block; position: relative; padding-bottom: {$padding_height}%; height: 0!important; max-width:100%; }"; } $fluid_width .= '/* raindrops is fluid end */'; } elseif ( 'doc5' == $page_width ) { $raindrops_full_width_limit_window_width = raindrops_warehouse_clone( 'raindrops_full_width_limit_window_width' ); $raindrops_full_width_max_width = raindrops_warehouse_clone( 'raindrops_full_width_max_width' ); $raindrops_document_type = raindrops_warehouse_clone( 'raindrops_doc_type_settings' ); $post_per_page = get_option( 'posts_per_page' ); /* loop-12 replace loop-0 */ $post_per_page_relate_style = ''; if ( 'html5' == $raindrops_document_type ) { $post_per_page_relate_style = '.rd-pw-doc5.rd-col-1 .loop-0 article,'; } if ( 'xhtml' == $raindrops_document_type ) { $post_per_page_relate_style = '.rd-pw-doc5.rd-col-1 .loop-0 > div > div,'; } for ( $i = 0; $i < $post_per_page; $i++ ) { $num = absint( $i + 1 ); if ( 'html5' == $raindrops_document_type ) { $post_per_page_relate_style .= '.rd-pw-doc5.rd-col-1 .loop-' . $num . ' article,'; } if ( 'xhtml' == $raindrops_document_type ) { $post_per_page_relate_style .= '.rd-pw-doc5.rd-col-1 .loop-' . $num . ' > div > div,'; } } $fluid_width = "\n" . '/* raindrops is fluid start */' . '#header-image,' . "\n#doc5{min-width:" . $raindrops_fluid_minimum_width . 'px;max-width:' . $raindrops_full_width_limit_window_width . 'px;}' . "\n#access{min-width:" . $raindrops_fluid_minimum_width . 'px;}' . '.raindrops-auto-fit-width, ' . "\n#doc5 .static-front-content, #doc5 .front-page-top-container, #hd, .social, #portfolio, #raindrops-recent-posts, .commentlist, #nav-above-comments, #nav-below-comments, #doc5 #nav-below, .no-header-image #header-inner, #access .menu-header, #access > .menu, #top ol.breadcrumbs, #bd, #ft .widget-wrapper{ max-width:{$raindrops_full_width_max_width}px; margin:auto; } #ft address{ max-width:{$raindrops_full_width_max_width}px; } #top > a{ display:block; }"; if ( false == has_filter( 'raindrops_header_image_ratio' ) ) { $fluid_width .= "#doc5 #header-image{ display:block; position: relative; padding-bottom: {$padding_height}%; height: 0!important; max-width:100%; }"; } $fluid_width .= "\n" . '/* raindrops is fluid end */'; $fluid_width .= "\n" . '/* raindrops is fluid 1 column start */' . "\n#doc5{ min-width:{$raindrops_fluid_minimum_width}px; max-width: {$raindrops_full_width_limit_window_width}px; } .rd-pw-doc5.rd-col-1 #doc5 #header-image{ display:block; position: relative; padding-bottom: {$padding_height}%; height: 0!important; max-width:100%; } .rd-pw-doc5.rd-col-1 .raindrops-expand-width{ padding-right:0; } .rd-pw-doc5.rd-col-1 #bd{ max-width:none; } .rd-pw-doc5.rd-col-1 .yui-t6 #container > .first, .rd-pw-doc5.rd-col-1 .yui-t5 #container > .first, .rd-pw-doc5.rd-col-1 .yui-t4 #container > .first { margin:0; } .rd-pw-doc5.rd-col-1 .topsidebar .metaslider, .rd-pw-doc5.rd-col-1 .topsidebar > ul > .widget_calendar #calendar_wrap, .rd-pw-doc5.rd-col-1 .topsidebar > ul > .raindrops-pinup-entries .page, .rd-pw-doc5.rd-col-1 .topsidebar > ul > .raindrops-pinup-entries .post, .rd-pw-doc5.rd-col-1 .topsidebar > ul > .raindrops-extend-archive .eco-archive, .rd-pw-doc5.rd-col-1 .topsidebar > ul > .widget_categories ul, .rd-pw-doc5.rd-col-1 .topsidebar > ul > .widget_nav_menu > div, .rd-pw-doc5.rd-col-1 .topsidebar > ul > .widget_tag_cloud .tagcloud, .rd-pw-doc5.rd-col-1 .topsidebar > ul > .widget_text .textwidget, .rd-pw-doc5.rd-col-1 .topsidebar > ul > .widget_search #searchform, .rd-pw-doc5.rd-col-1 .topsidebar > ul > li > .widgettitle, .rd-pw-doc5.rd-col-1 .topsidebar > ul > li > ul, .rd-pw-doc5.rd-col-1 .rd-tpl-image, .rd-pw-doc5.rd-col-1 .breadcrumbs, .rd-pw-doc5.rd-col-1 .wp-pagenavi, .rd-pw-doc5.rd-col-1 #home-tab, .rd-pw-doc5.rd-col-1 .bottom-sidebar-1 li, .rd-pw-doc5.rd-col-1 .page-template-list_of_post-php #container, .rd-pw-doc5.rd-col-1 .error404 .entry-content, .rd-pw-doc5.rd-col-1 .error404 .entry-title, .rd-pw-doc5.rd-col-1 .bottom-sidebar-3 ul, .rd-pw-doc5.rd-col-1 .bottom-sidebar-2 ul, .rd-pw-doc5.rd-col-1 .raindrops-toc-front, .rd-pw-doc5.rd-col-1 .nav-links, .rd-pw-doc5.rd-col-1 #access .menu, .rd-pw-doc5.rd-col-1 #doc3 .front-page-top-container, .rd-pw-doc5.rd-col-1 #hd, .rd-pw-doc5.rd-col-1 #access .menu-header, .rd-pw-doc5.rd-col-1 #archives-title, .rd-pw-doc5.rd-col-1 .page-title, .rd-pw-doc5.rd-col-1.page-template-date-php #doc3 .raindrops-monthly-archive-prev-next-avigation, .rd-pw-doc5.rd-col-1 #nav-above, .rd-pw-doc5.rd-col-1 #ft .widget-wrapper, .rd-pw-doc5.rd-col-1 #ft address{ max-width:{$raindrops_full_width_max_width}px; margin:auto; } .rd-pw-doc5.rd-col-1 #ft address{ margin:1em auto; } /* div > div for xhtml */ .rd-pw-doc5.rd-col-1.search .search-results > div > div, .rd-pw-doc5.rd-col-1.tag > div > div, .rd-pw-doc5.rd-col-1.single .post, .rd-pw-doc5.rd-col-1.page .page .page," . $post_per_page_relate_style . " .rd-pw-doc5.rd-col-1 .loop-item-show-allways > div > div, .rd-pw-doc5.rd-col-1.error404 .entry-title, .rd-pw-doc5.rd-col-1.archive.author main, .rd-pw-doc5.rd-col-1.archive .raindrops-monthly-archive-prev-next-avigation, .rd-pw-doc5.rd-col-1.archive .datetable, .rd-pw-doc5.rd-col-1 #list-of-post, .rd-pw-doc5.rd-col-1 .raindrops-tile-wrapper .portfolio, .rd-pw-doc5.rd-col-1.search .pagetitle, .rd-pw-doc5.rd-col-1.search .search-results article, .rd-pw-doc5.rd-col-1 .fail-search, .rd-pw-doc5.rd-col-1.tag article, .rd-pw-doc5.rd-col-1.page-template-date-php #doc3 .datetable, .rd-pw-doc5.rd-col-1.single article, .rd-pw-doc5.rd-col-1.page article, .rd-pw-doc5.rd-col-1 .loop-item-show-allways article{ max-width:{$raindrops_full_width_max_width}px; margin:0 auto!important; /* @1.417 padding:2em;*/ }" . '/* raindrops is fluid 1 column end */'; } $fluid_width = raindrops_remove_spaces_from_css( $fluid_width ); return apply_filters( "raindrops_is_fluid", $fluid_width ); } } if ( !function_exists( 'raindrops_is_fixed' ) ) { function raindrops_is_fixed() { global $is_IE, $raindrops_page_width, $raindrops_base_font_size; $add_ie = ''; $pw = raindrops_warehouse_clone( "raindrops_page_width" ); $raindrops_base_font_size = apply_filters( 'raindrops_base_font_size', $raindrops_base_font_size ); //px size if ( 'doc' == $pw ) { $width = 750; $px = 'max-width:' . $width . 'px;'; $width = $width / $raindrops_base_font_size; } if ( 'doc2' == $pw ) { $width = 950; $px = 'max-width:' . $width . 'px;'; $width = $width / $raindrops_base_font_size; } if ( 'doc4' == $pw ) { $width = 974; $px = 'max-width:' . $width . 'px;'; $width = $width / $raindrops_base_font_size; } if ( 'custom-doc' == $pw ) { $width = $raindrops_page_width; $px = 'width:' . $width . 'px;'; $width = $width / $raindrops_base_font_size; } $raindrops_main_width = raindrops_main_width(); $raindrops_main_width = $raindrops_main_width / $raindrops_base_font_size; if ( $is_IE ) { $width = round( $width * 0.9759, 1 ); $add_ie = ''; $raindrops_main_width = round( $raindrops_main_width * 0.9759, 1 ); } else { $width = round( $width, 1 ); $raindrops_main_width = round( $raindrops_main_width, 1 ); } $custom_fixed_width = '/* raindrops is fixed start*/' . " \n#" . $pw . '{margin:auto;text-align:left;' . "\n" . 'width:' . $width . 'em;' . $add_ie . $px . '}' . "\n#container{width:" . $raindrops_main_width . 'em;}/* raindrops is fixed end */'; return apply_filters( "raindrops_is_fixed", $custom_fixed_width ); } } /** * * * * * */ add_filter( 'raindrops_embed_meta_css', 'raindrops_add_gallery_css' ); if ( !function_exists( 'raindrops_add_gallery_css' ) ) { function raindrops_add_gallery_css( $css ) { return $css . raindrops_gallerys(); } } if ( !function_exists( 'raindrops_gallerys' ) ) { function raindrops_gallerys() { global $raindrops_document_type; $raindrops_gallerys = raindrops_gallerys_clone(); $raindrops_gallerys = raindrops_remove_spaces_from_css( $raindrops_gallerys ); return $raindrops_gallerys; } } add_filter( 'raindrops_prev_next_post', 'raindrops_remove_empty_span' ); add_filter( 'raindrops_posted_on', 'raindrops_remove_empty_span' ); add_filter( 'raindrops_posted_in', 'raindrops_remove_empty_span' ); /** * * * * */ if ( !function_exists( 'raindrops_remove_empty_span' ) ) { function raindrops_remove_empty_span( $content ) { return preg_replace( '!]*>(\s*)?<\/span>!', '', $content ); } } /** * * * * * thanks aison */ if ( !function_exists( 'raindrops_page_menu_args' ) ) { function raindrops_page_menu_args( $args ) { global $raindrops_nav_menu_home_link; $args[ 'show_home' ] = $raindrops_nav_menu_home_link; return $args; } } /** * * * * * @since 0.980 */ if ( !function_exists( 'raindrops_insert_message_action_hook_position' ) ) { function raindrops_insert_message_action_hook_position( $hook_name = '' ) { global $wp_customize; if ( ( true == WP_DEBUG || $wp_customize) && is_user_logged_in() && current_user_can( 'edit_theme_options' ) ) { add_action( 'raindrops_after_nav_menu', 'raindrops_action_hook_messages' ); add_action( 'raindrops_append_entry_content', 'raindrops_action_hook_messages' ); add_action( 'raindrops_prepend_extra_sidebar', 'raindrops_action_hook_messages' ); add_action( 'raindrops_append_extra_sidebar', 'raindrops_action_hook_messages' ); add_action( 'raindrops_prepend_doc', 'raindrops_action_hook_messages' ); add_action( 'raindrops_append_doc', 'raindrops_action_hook_messages' ); add_action( 'raindrops_prepend_default_sidebar', 'raindrops_action_hook_messages' ); add_action( 'raindrops_append_default_sidebar', 'raindrops_action_hook_messages' ); add_action( 'raindrops_prepend_footer', 'raindrops_action_hook_messages' ); add_action( 'raindrops_append_footer', 'raindrops_action_hook_messages' ); add_action( 'raindrops_prepend_entry_content', 'raindrops_action_hook_messages' ); add_action( 'raindrops_prepend_loop', 'raindrops_action_hook_messages' ); add_action( 'raindrops_append_loop', 'raindrops_action_hook_messages' ); add_action( 'raindrops_before_article', 'raindrops_action_hook_messages' ); add_action( 'raindrops_after_article', 'raindrops_action_hook_messages' ); add_action( 'raindrops_prepend_widget_sticky', 'raindrops_action_hook_messages' ); add_action( 'raindrops_append_widget_sticky', 'raindrops_action_hook_messages' ); } } } raindrops_insert_message_action_hook_position(); /** * * * * * @since 1.204 */ if ( !function_exists( 'raindrops_prepend_loop' ) ) { function raindrops_prepend_loop() { $args = array( 'hook_name' => 'raindrops_prepend_loop', 'template_part_name' => 'hook-prepend-loop.php' ); get_template_part( 'hook', 'prepend-loop' ); do_action( 'raindrops_prepend_loop', $args ); } } /** * * * * * @since 1.204 */ if ( !function_exists( 'raindrops_append_loop' ) ) { function raindrops_append_loop() { $args = array( 'hook_name' => 'raindrops_append_loop', 'template_part_name' => 'hook-append-loop.php' ); get_template_part( 'hook', 'append-loop' ); do_action( 'raindrops_append_loop', $args ); } } /** * * * * * @since 0.980 */ if ( !function_exists( 'raindrops_action_hook_messages' ) ) { function raindrops_action_hook_messages( $args ) { global $raindrops_actions_hook_message; /** * When WP_DEBUG value true and $raindrops_actions_hook_message value true * Show Raindrops action filter position and examples * * $raindrops_actions_hook_message * @since 0.980 */ if ( !isset( $raindrops_actions_hook_message ) ) { $customizer_modify_value = raindrops_warehouse_clone( 'raindrops_actions_hook_message' ); if ( 'show' !== $customizer_modify_value ) { $raindrops_actions_hook_message = false; } else { $raindrops_actions_hook_message = true; } } if ( true == $raindrops_actions_hook_message ) { if ( isset( $args ) && array_key_exists( 'hook_name', $args ) && array_key_exists( 'template_part_name', $args ) ) { $message = esc_html__( 'add_action( \'%1$s\', \'your_function\' ) or add template part file the name \'%2$s\'.', 'raindrops' ); $message = sprintf( $message, $args[ 'hook_name' ], $args[ 'template_part_name' ] ); printf( '
        %1$s
        ', $message, 'word-break:break-all;word-wrap:break-word;' ); } } } } /** * * * * * @since 0.980 */ if ( !function_exists( 'raindrops_after_nav_menu' ) ) { function raindrops_after_nav_menu() { get_template_part( 'hook', 'after-nav-menu' ); $args = array( 'hook_name' => 'raindrops_after_nav_menu', 'template_part_name' => 'hook-after-nav-menu.php' ); do_action( 'raindrops_after_nav_menu', $args ); } } /** * * * * * @since 0.980 */ if ( !function_exists( 'raindrops_prepend_doc' ) ) { function raindrops_prepend_doc() { $args = array( 'hook_name' => 'raindrops_prepend_doc', 'template_part_name' => 'hook-prepend-doc.php' ); get_template_part( 'hook', 'prepend-doc' ); do_action( 'raindrops_prepend_doc', $args ); } } /** * * * * * @since 0.980 */ if ( !function_exists( 'raindrops_append_doc' ) ) { function raindrops_append_doc() { $args = array( 'hook_name' => 'raindrops_append_doc', 'template_part_name' => 'hook-append-doc.php' ); get_template_part( 'hook', 'append-doc' ); do_action( 'raindrops_append_doc', $args ); } } /** * * * * * @since 0.980 */ if ( !function_exists( 'raindrops_prepend_entry_content' ) ) { function raindrops_prepend_entry_content() { $args = array( 'hook_name' => 'raindrops_prepend_entry_content', 'template_part_name' => 'hook-prepend-entry-content.php' ); get_template_part( 'hook', 'prepend-entry-content' ); do_action( 'raindrops_prepend_entry_content', $args ); } } if ( !function_exists( 'raindrops_prepend_widget_sticky' ) ) { function raindrops_prepend_widget_sticky() { $args = array( 'hook_name' => 'raindrops_prepend_widget_sticky', 'template_part_name' => 'hook-prepend-widget-sticky.php' ); get_template_part( 'hook', 'prepend-widget-sticky' ); do_action( 'raindrops_prepend_widget_sticky', $args ); } } if ( !function_exists( 'raindrops_append_widget_sticky' ) ) { function raindrops_append_widget_sticky() { $args = array( 'hook_name' => 'raindrops_append_widget_sticky', 'template_part_name' => 'hook-append-widget-sticky.php' ); get_template_part( 'hook', 'append-widget-sticky' ); do_action( 'raindrops_append_widget_sticky', $args ); } } /** * * * * * @since 0.980 */ if ( !function_exists( 'raindrops_prepend_extra_sidebar' ) ) { function raindrops_prepend_extra_sidebar() { $args = array( 'hook_name' => 'raindrops_prepend_extra_sidebar', 'template_part_name' => 'hook-prepend-extra-sidebar.php' ); get_template_part( 'hook', 'prepend-extra-sidebar' ); do_action( 'raindrops_prepend_extra_sidebar', $args ); } } /** * * * * * @since 0.980 */ if ( !function_exists( 'raindrops_prepend_default_sidebar' ) ) { function raindrops_prepend_default_sidebar() { $args = array( 'hook_name' => 'raindrops_prepend_default_sidebar', 'template_part_name' => 'hook-prepend-default-sidebar.php' ); get_template_part( 'hook', 'prepend-default-sidebar' ); do_action( 'raindrops_prepend_default_sidebar', $args ); } } /** * * * * * @since 0.980 */ if ( !function_exists( 'raindrops_prepend_footer' ) ) { function raindrops_prepend_footer() { $args = array( 'hook_name' => 'raindrops_prepend_footer', 'template_part_name' => 'hook-prepend-footer.php' ); get_template_part( 'hook', 'prepend-footer' ); do_action( 'raindrops_prepend_footer', $args ); } } /** * * * * * @since 0.980 */ if ( !function_exists( 'raindrops_append_entry_content' ) ) { function raindrops_append_entry_content() { $args = array( 'hook_name' => 'raindrops_append_entry_content', 'template_part_name' => 'hook-append-entry-content.php' ); get_template_part( 'hook', 'append-entry-content' ); do_action( 'raindrops_append_entry_content', $args ); } } /** * * * * * @since 0.980 */ if ( !function_exists( 'raindrops_append_extra_sidebar' ) ) { function raindrops_append_extra_sidebar() { $args = array( 'hook_name' => 'raindrops_append_extra_sidebar', 'template_part_name' => 'hook-append-extra-sidebar.php' ); get_template_part( 'hook', 'append-extra-sidebar' ); do_action( 'raindrops_append_extra_sidebar', $args ); } } /** * * * * * @since 0.980 */ if ( !function_exists( 'raindrops_append_default_sidebar' ) ) { function raindrops_append_default_sidebar() { $args = array( 'hook_name' => 'raindrops_append_default_sidebar', 'template_part_name' => 'hook-append-default-sidebar.php' ); get_template_part( 'hook', 'append-default-sidebar' ); do_action( 'raindrops_append_default_sidebar', $args ); } } /** * * * * * @since 0.980 */ if ( !function_exists( 'raindrops_append_footer' ) ) { function raindrops_append_footer() { $args = array( 'hook_name' => 'raindrops_append_footer', 'template_part_name' => 'hook-append-footer.php' ); get_template_part( 'hook', 'append-footer' ); do_action( 'raindrops_append_footer', $args ); } } /** * * * * * @since 1.334 */ if ( !function_exists( 'raindrops_before_article' ) ) { function raindrops_before_article() { $args = array( 'hook_name' => 'raindrops_before_article', 'template_part_name' => 'hook-before_article.php' ); get_template_part( 'hook', 'before_article' ); do_action( 'raindrops_before_article', $args ); } } /** * * * * * @since 1.334 */ if ( !function_exists( 'raindrops_after_article' ) ) { function raindrops_after_article() { $args = array( 'hook_name' => 'raindrops_after_article', 'template_part_name' => 'hook-after_article.php' ); get_template_part( 'hook', 'after_article' ); do_action( 'raindrops_after_article', $args ); } } /** * * * * * @since 0.980 */ if ( !function_exists( 'raindrops_entry_title' ) ) { function raindrops_entry_title( $args = array() ) { global $post, $templates, $raindrops_link_unique_text; $default = array( 'raindrops_title_element' => 'h2', 'echo' => true ); $args = wp_parse_args( $args, $default ); $thumbnail = ''; $raindrops_unique_label = ''; extract( $args, EXTR_SKIP ); if ( !is_singular() || is_page_template( 'page-templates/list-of-post.php' ) || ( is_page_template( 'page-templates/full-width.php' ) && is_front_page() ) || ( is_page_template( 'page-templates/front-page.php' ) && is_front_page() ) ) { $html = '<' . $raindrops_title_element . ' class="%1$s">%2$s' . "\n" . str_repeat( "\t", 11 ) . '%5$s %6$s' . "\n" . str_repeat( "\t", 10 ) . ''; $html = sprintf( $html, apply_filters( 'raindrops_entry_title_class', 'h2 entry-title' ), $thumbnail, get_permalink(), the_title_attribute( array( 'before' => '', 'after' => '', 'echo' => false ) ), the_title( '', '', false ), $raindrops_unique_label ); if ( true == $echo ) { echo apply_filters( 'raindrops_entry_title', $html ); } else { return apply_filters( 'raindrops_entry_title', $html ); } } else { $html = '<' . $raindrops_title_element . ' class="%1$s">%4$s%3$s %2$s'; $html = sprintf( $html, apply_filters( 'raindrops_entry_title_class', 'h2 entry-title' ), the_title( '', '', false ), $raindrops_unique_label, $thumbnail ); if ( true == $echo ) { echo apply_filters( 'raindrops_entry_title', $html ); } else { return apply_filters( 'raindrops_entry_title', $html ); } } } } if ( !function_exists( 'raindrops_excerpt_with_html' ) ) { /** * * @param type $content * @return type * @since 1.278 */ function raindrops_excerpt_with_html( $content ) { $raindrops_excerpt_condition = raindrops_detect_excerpt_condition(); $raindrops_excerpt_enable = raindrops_warehouse_clone( 'raindrops_excerpt_enable' ); $raindrops_allow_oembed_excerpt_view = raindrops_warehouse_clone( 'raindrops_allow_oembed_excerpt_view' ); if ( true == $raindrops_excerpt_condition && 'yes' == $raindrops_excerpt_enable ) { return raindrops_html_excerpt_with_elements( $content, 200, ' ...', true, true ); } return $content; } } if ( !function_exists( 'raindrops_maybe_multibyte' ) ) { /** * * @param type $text * @return boolean * @since 1.278 */ function raindrops_maybe_multibyte( $text ) { $filter_value = apply_filters( 'raindrops_maybe_multibyte', 0, $text ); if ( is_bool( $filter_value ) ) { return $filter_value; } if ( !is_string( $text ) ) { return false; } if ( strlen( $text ) !== mb_strlen( $text, "UTF-8" ) ) { return true; } return false; } } if ( !function_exists( 'raindrops_html_excerpt_with_elements' ) ) { /** * * @param type $content * @param type $length * @param type $more * @param type $exact * @param type $allow_html * @return type * @since 1.278 */ function raindrops_html_excerpt_with_elements( $content, $length = 200, $more = '...', $exact = true, $allow_html = false ) { global $post; $no_closed_elements = '(img|br|input|hr|area|base|basefont|col|frame|isindex|link|meta|param|embed)'; $length = apply_filters( 'excerpt_length', $length ); $length = apply_filters( 'raindrops_html_excerpt_with_elements_length', $length ); $allow_html = apply_filters( 'raindrops_html_excerpt_with_elements_allow_html', $allow_html ); if ( isset( $post ) && has_excerpt() ) { return apply_filters( 'the_excerpt', get_the_excerpt() ); } if ( isset( $post->ID ) && is_sticky( $post->ID ) ) { return $content; } if ( $allow_html ) { if ( preg_match( '!\[raindrops skip-excerpt\]!', $content ) ) { return $content; } $striped_shortcode_content = strip_shortcodes( $content ); $striped_content = wp_kses( $striped_shortcode_content, array() ); if ( mb_strlen( $striped_content, "UTF-8" ) <= $length ) { return $content; } preg_match_all( '/(<.+?>|\[.+\])?([^<>]*)/s', $content, $lines, PREG_SET_ORDER ); $total_length = mb_strlen( $more, "UTF-8" ); $open_tags = array(); $truncate = ''; foreach ( $lines as $line_matchings ) { if ( isset( $line_matchings[ 1 ] ) and ! empty( $line_matchings[ 1 ] ) ) { if ( preg_match( '/^<(\s*.+?\/\s*|\s*' . $no_closed_elements . '(\s.+?)?)>$/is', $line_matchings[ 1 ] ) ) { } elseif ( preg_match( '!\[\/([^\]]+)\]!', $line_matchings[ 1 ], $tag_matchings ) ) { $pos = array_search( $tag_matchings[ 1 ], $open_tags ); if ( $pos !== false ) { unset( $open_tags[ $pos ] ); } } elseif ( preg_match( '/^<\s*\/([^\s]+?)\s*>$/s', $line_matchings[ 1 ], $tag_matchings ) ) { $pos = array_search( $tag_matchings[ 1 ], $open_tags ); if ( $pos !== false ) { unset( $open_tags[ $pos ] ); } } elseif ( preg_match( '/^<\s*([^\s>!]+).*?>$/s', $line_matchings[ 1 ], $tag_matchings ) ) { array_unshift( $open_tags, strtolower( $tag_matchings[ 1 ] ) ); } elseif ( preg_match( '/^\[\s*([^\s\]!]+).*?\]$/s', $line_matchings[ 1 ], $tag_matchings ) ) { array_unshift( $open_tags, strtolower( $tag_matchings[ 1 ] ) ); } $truncate .= $line_matchings[ 1 ]; } $content_length = mb_strlen( preg_replace( '/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i', ' ', $line_matchings[ 2 ] ), "UTF-8" ); if ( $total_length + $content_length > $length ) { $left = $length - $total_length; $entities_length = 0; if ( preg_match_all( '/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i', $line_matchings[ 2 ], $entities, PREG_OFFSET_CAPTURE ) ) { foreach ( $entities[ 0 ] as $entity ) { if ( $entity[ 1 ] + 1 - $entities_length <= $left ) { $left--; $entities_length += mb_strlen( $entity[ 0 ], "UTF-8" ); } else { break; } } } $truncate .= wp_html_excerpt( $line_matchings[ 2 ], $left + $entities_length, '' ); break; } else { $truncate .= $line_matchings[ 2 ]; $total_length += $content_length; } if ( $total_length >= $length ) { break; } } } else { if ( mb_strlen( $content, "UTF-8" ) <= $length ) { return $content; } else { $truncate = wp_html_excerpt( $striped_shortcode_content, $length - mb_strlen( $more, "UTF-8" ), $more ); } } if ( !$exact ) { $spacepos = mb_strrpos( $truncate, ' ' ); if ( isset( $spacepos ) ) { $truncate = mb_substr( $truncate, 0, $spacepos, "UTF-8" ); } } $truncate .= $more; if ( $allow_html ) { foreach ( $open_tags as $tag ) { $truncate .= ''; } } return apply_filters( 'raindrops_html_excerpt_with_elements', $truncate, __FUNCTION__ ); } } if ( !function_exists( 'raindrops_entry_content' ) ) { /** * * * * * @since 0.980 */ function raindrops_entry_content( $more_link_text = null, $stripteaser = false ) { global $post, $more_link_text; if ( raindrops_detect_display_none_condition() && !is_sticky() ) { return; } $raindrops_excerpt_condition = raindrops_detect_excerpt_condition(); $raindrops_excerpt_enable = raindrops_warehouse_clone( 'raindrops_excerpt_enable' ); $raindrops_allow_oembed_excerpt_view = raindrops_warehouse_clone( 'raindrops_allow_oembed_excerpt_view' ); if ( true == $raindrops_excerpt_condition && !is_sticky() && 'no' == $raindrops_excerpt_enable && ! preg_match('!\[raindrops skip-excerpt\]!', $post->post_content ) ) { /* remove shortcodes */ $excerpt = strip_shortcodes( get_the_excerpt() ); $excerpt = preg_replace( '!\[raindrops[^\]]+\]!', '', $excerpt ); $excerpt = apply_filters( 'the_excerpt', $excerpt ); $excerpt = apply_filters( 'raindrops_the_excerpt', $excerpt, __FUNCTION__ ); echo apply_filters( 'raindrops_entry_content', $excerpt ); } else { if ( empty( $more_link_text ) ) { $more_link_text = esc_html__( 'Continue reading ', 'raindrops' ) . '' . esc_html__( ' Post ID ', 'raindrops' ) . get_the_ID() . ''; } $content = ''; // wp-includes/post-template.php:265 - Trying to get property of non-object if ( isset( $post ) ) { $content .= get_the_content( $more_link_text, $stripteaser ); } $content = apply_filters( 'the_content', $content ); $content = apply_filters( 'raindrops_entry_content', $content ); $content = str_replace( ']]>', ']]>', $content ); /** * @1.325 */ if ( has_excerpt() && empty( $content ) && !wp_attachment_is_image( $post->ID ) ) { $content .= sprintf( '
        %1$s
        ', get_the_excerpt() ); } echo $content; } } } /** * * * * * @since 0.980 */ if ( !function_exists( 'raindrops_next_prev_links' ) ) { function raindrops_next_prev_links( $position = 'nav-above' ) { global $wp_query, $paged; $raindrops_old = $paged + 1; $raindrops_new = $paged - 1; $raindrops_old = raindrops_link_unique( $text = 'Next Page', $raindrops_old ); $raindrops_new = raindrops_link_unique( $text = 'Next Page', $raindrops_new ); if ( $wp_query->max_num_pages > 1 ) { $html = '
        ' . "\n" . str_repeat( "\t", 8 ) . '%1$s%2$s' . "\n" . str_repeat( "\t", 7 ) . '
        ' . "\n"; $html = sprintf( $html, get_next_posts_link( '' . $raindrops_old . esc_html__( ' Older posts', 'raindrops' ) ), get_previous_posts_link( '' . $raindrops_new . esc_html__( 'Newer posts', 'raindrops' ) . '' ), $position ); echo apply_filters( 'raindrops_next_prev_links', $html, $position ); } } } add_filter( 'raindrops_next_prev_links', 'raindrops_the_pagenation', 10, 2 ); if ( !function_exists( 'raindrops_the_pagenation' ) ) { function raindrops_the_pagenation( $html, $position ) { global $raindrops_document_type; if ( function_exists( 'get_the_posts_pagination' ) && $position == 'nav-below' ) { if ( $raindrops_document_type == 'html5' ) { $result = str_replace( array( 'role="navigation"' ), array( '' ), get_the_posts_pagination() ); return $result; } elseif ( $raindrops_document_type == 'xhtml' ) { $result = str_replace( array( 'role="navigation"' ), array( '' ), get_the_posts_pagination() ); $result = str_replace( array( '

      ' . esc_html__( 'Page', 'raindrops' ) . '2'; } else { $url = esc_url( add_query_arg( 'page', 2 ) ) . '#portfolio'; $html = '
    • ' . esc_html__( 'Page', 'raindrops' ) . '2
    • '; } } elseif ( $args[ 'paged' ] > 0 ) { $page = $args[ 'paged' ] + 1; $url = esc_url( add_query_arg( 'page', $page ) ) . '#portfolio'; $html = sprintf( $raindrops_html_page, esc_url( $url ), 'portfolio-next portfolio-' . $page, 'portfolio-nav-next', esc_html__( 'Page', 'raindrops' ) . ' ' . $page ); } $url = esc_url( add_query_arg( 'page', $args[ 'paged' ] ) ) . '#portfolio'; $raindrops_page_for_posts = get_option( 'page_for_posts' ); $raindrops_html_page = '
    • %4$s
    • '; if ( $args[ 'post_type' ] == 'post' && $raindrops_page_for_posts ) { $html .= sprintf( $raindrops_html_page, esc_url( get_permalink( $raindrops_page_for_posts ) ), 'portfolio-link-to-page-for-posts', 'link-to-page-title', get_the_title( $raindrops_page_for_posts ) ); } if ( 2 == $args[ 'paged' ] ) { $page = $args[ 'paged' ] - 1; $url = esc_url( add_query_arg( 'page', $page ) ) . '#portfolio'; $html .= sprintf( $raindrops_html_page, esc_url( $url ), 'portfolio-prev portfolio-home', 'portfolio-nav-prev', __( 'Portfolio Home', 'raindrops' ) ); } elseif ( $args[ 'paged' ] > 2 ) { $page = $args[ 'paged' ]; $page = $page - 1; $url = esc_url( add_query_arg( 'page', $page ) ) . '#portfolio'; $html .= sprintf( $raindrops_html_page, esc_url( $url ), 'portfolio-prev portfolio-' . $page, 'portfolio-nav-prev', esc_html__( 'Page', 'raindrops' ) . ' ' . $page ); } echo apply_filters( 'raindrops_portfolio_nav', sprintf( '
        %1$s
      ', $html ) ); } else { //! empty( $raindrops_posts ) ?>
      < >%4$s

      '; if ( preg_match( '!page=!', $query_string ) ) { ?>

      End

      >
      ' . $pre . '%3$s' . $after . ''; if ( empty( $more_link_text ) ) { $raindrops_aria_hidden = raindrops_doctype_elements( '', 'aria-hidden="true"', false ); $more_link_text = esc_html__( 'Continue reading ', 'raindrops' ) . '' . esc_html__( ' Post ID ', 'raindrops' ) . $id . ''; } $output = ''; $strip_teaser = false; $more = false; if ( preg_match( '//', $content, $matches ) ) { $fragment_identifier = ''; } else { $fragment_identifier = '#more-' . $id; } if ( preg_match( '//', $content, $matches ) ) { $content = explode( $matches[ 0 ], $content, 2 ); if ( !empty( $matches[ 1 ] ) ) { $more_link_text = esc_html( $matches[ 1 ] ); } if ( !empty( $matches[ 1 ] ) && !empty( $more_link_text ) ) { $more_link_text = strip_tags( wp_kses_no_null( trim( $matches[ 1 ] ) ) ); } $more = true; } if ( is_array( $content ) ) { $content = $content[ 0 ]; $content .= apply_filters( 'the_content_more_link', sprintf( $html, esc_url( get_permalink( $id ) ), $fragment_identifier, $more_link_text ), $more_link_text ); $content = force_balance_tags( $content ); return apply_filters( 'raindrops_add_more', $content, $more ); } else { return apply_filters( 'raindrops_add_more', $content, $more ); } } } /** * * * * @since 1.211 */ if ( !function_exists( 'raindrops_status_bar' ) ) { function raindrops_status_bar() { global $raindrops_status_bar, $post; /** * * Show Raindrops status bar at browser bottom * * shows true hide false * @since 1.211 */ if ( !isset( $raindrops_status_bar ) ) { $customizer_modify_value = raindrops_warehouse_clone( 'raindrops_status_bar' ); if ( 'show' !== $customizer_modify_value ) { $raindrops_status_bar = false; } else { $raindrops_status_bar = true; } } if ( $raindrops_status_bar == false ) { return; } ?>
      top

      '; echo apply_filters( 'raindrops_status_bar_top', $link_to_top ); if ( 'posts' == get_option( 'show_on_front' ) ) { if ( is_month() ) { raindrops_monthly_archive_prev_next_navigation(); } } ?>
      'page', 'post_status' => 'publish', 'numberposts' => -1, 'order' => 'ASC', 'orderby' => 'post_title', 'post_parent' => $post->ID, ); $html = '%2$s'; $child_pages = query_posts( $args ); if ( !empty( $child_pages ) && is_array( $child_pages ) ) { $number = count( $child_pages ); ?> ID ) ) ); $title = apply_filters( 'the_title', $child->post_title ); printf( $html, $permalink, $title ); if ( end( $child_pages ) !== $child ) { echo ' , '; } } } wp_reset_query(); ?>
      $v ) { if ( !empty( $key ) ) { if ( in_array( $key, $target_sidebars ) && !empty( $v ) ) { $copy_for_theme[ $key ] = $v; } } } if ( isset( $copy_for_theme ) && !empty( $copy_for_theme ) ) { $raindrops_theme_settings[ 'widget_ids' ] = $copy_for_theme; } if ( 'option' == $raindrops_setting_type ) { update_option( 'raindrops_theme_settings', $raindrops_theme_settings ); } if ( 'theme_mod' == $raindrops_setting_type ) { $old_mods = get_theme_mods(); if ( is_array( $old_mods ) ) { $new_mods = array_merge( $old_mods, $raindrops_theme_settings ); } else { $new_mods = $raindrops_theme_settings; } update_option( "theme_mods_$raindrops_current_theme_slug", $new_mods ); } } return $sidebars_widgets; } } /** * * * @since 1.231 */ if ( !function_exists( 'raindrops_skip_links' ) ) { function raindrops_skip_links() { global $raindrops_theme_settings, $wp_widget_factory, $rsidebar_show, $wp_customize; if ( isset( $wp_customize ) ) { return; } $result = ''; $html = "\n" . str_repeat( "\t", 1 ) . ''; if ( $raindrops_theme_settings !== 'no' ) { if ( isset( $raindrops_theme_settings[ 'widget_ids' ] ) ) { $copy = $raindrops_theme_settings[ 'widget_ids' ]; if ( $rsidebar_show == false ) { unset( $copy[ 'sidebar-2' ] ); } if ( is_singular() ) { return; } foreach ( $copy as $key => $array_val ) { if ( isset( $array_val ) && is_array( $array_val ) ) { foreach ( $array_val as $val ) { $result .= sprintf( $html, wp_kses( $val, array() ), esc_attr( $val ), esc_html( strtoupper( $val ) ) ); } } } return apply_filters( 'raindrops_skip_links', $result ); } } else { $raindrops_id_bases = array( 'WP_Widget_Categories' => 'categories', 'WP_Widget_Archives' => 'archives', 'WP_Widget_Calendar' => 'calendar', 'WP_Widget_Pages' => 'pages', 'WP_Widget_Recent_Comments' => 'recent-comments', 'WP_Widget_RSS' => 'rss', 'WP_Widget_Text' => 'text', 'WP_Widget_Tag_Cloud' => 'tag_cloud', 'WP_Nav_Menu_Widget' => 'nav_menu', 'WP_Widget_Search' => 'search' ); foreach ( $raindrops_id_bases as $key => $val ) { if ( is_active_widget( '', '', $val ) ) { $result .= sprintf( $html, wp_kses( $wp_widget_factory->widgets[ $key ]->id, array() ), esc_attr( $wp_widget_factory->widgets[ $key ]->name ), esc_html( $wp_widget_factory->widgets[ $key ]->name ) ); } } return apply_filters( 'raindrops_skip_links', $result ); } } } /** * Filter of paragraph correction * * * @param type $content * @return type * @sincd 1.231 */ if ( !function_exists( 'raindrops_remove_wrong_p_before' ) ) { function raindrops_remove_wrong_p_before( $content ) { return str_replace( array( '
      ', '
      ' ), array( "
      \n\n", "\n
      " ), $content ); } } if ( !function_exists( 'raindrops_remove_wrong_p' ) ) { function raindrops_remove_wrong_p( $content ) { $allblocks = '(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|form|map|area|blockquote|address|math|style|h[1-6]|hr|fieldset|noscript|legend|section|article|aside|hgroup|header|footer|nav|figure|details|menu|summary)'; /* 1.261 remove p at allblocks */ $content = preg_replace( '!([^(

      )]*)

      ()!', "$1$2", $content ); $content = preg_replace( '!(<(select|del|option|canvas|mrow|svg|rect|optgroup) [^>]*>)(
      |

      )!', "$1", $content ); $content = preg_replace( '!(|||||||||||||)
      !', "$1", $content ); $content = preg_replace( '!

      \s*(]*>)\s*

      !', "$1", $content ); $content = preg_replace( '!(]*>)\s*

      !', "$1", $content ); $content = preg_replace( '!(

      )(]*>)!', "$2", $content ); $content = preg_replace( '!(

      [^<]*)()!', "$1

      $2", $content ); $content = preg_replace( '!(<' . $allblocks . '[^>]*>[^<]*)

      !', "$1", $content ); $content = preg_replace( '!(<' . $allblocks . '[^>]*>)([^(<|\s)]+)

      !', "$1

      $2

      ", $content ); $content = str_replace( 'class="wp-caption-text">

      ', 'class="wp-caption-text">', $content ); return $content; } } if ( !function_exists( 'raindrops_link_text_filter' ) ) { /** * * @param type $content * @return type * @since 1.328 */ function raindrops_link_text_filter( $content ) { $content = preg_replace_callback( "|]+>.*?(https?:\/\/[-_.!*\'()a-zA-Z0-9;\/?:@&=+$,%#]+).*?|", "raindrops_link_url_text_decode", $content ); return $content; } } if ( !function_exists( 'raindrops_link_url_text_decode' ) ) { /** * * @param type $matches * @return type * @since 1.328 */ function raindrops_link_url_text_decode( $matches ) { if ( isset( $matches[ 1 ] ) && false !== strpos( $matches[ 1 ], '%' ) ) { $replace = urldecode( $matches[ 1 ] ); $replace = esc_html( $replace ); return preg_replace( "|>" . $matches[ 1 ] . "|", ">{$replace}", $matches[ 0 ] ); } return $matches[ 0 ]; } } /** * * * @since 1.234 */ if ( !function_exists( 'raindrops_call_custom_css' ) ) { function raindrops_call_custom_css() { new raindrops_custom_css(); } } /** * * post metabox * Raindrops indivisual CSS */ if ( !class_exists( 'raindrops_custom_css' ) ) { class raindrops_custom_css { public function __construct() { add_action( 'add_meta_boxes', array( $this, 'add_meta_box' ) ); add_action( 'save_post', array( $this, 'save' ) ); } public function add_meta_box( $post_type ) { $post_types = array( 'post', 'page' ); if ( in_array( $post_type, $post_types ) ) { add_meta_box( 'raindrops_custom_css' , esc_html__( 'Custom CSS For This Entry', 'raindrops' ) , array( $this, 'render_meta_box_content' ) , $post_type , 'advanced' , 'high' ); } } public function save( $post_id ) { if ( !isset( $_POST[ 'raindrops_inner_custom_box_nonce' ] ) ) { return $post_id; } $nonce = $_POST[ 'raindrops_inner_custom_box_nonce' ]; if ( !wp_verify_nonce( $nonce, 'raindrops_inner_custom_box' ) ) { return $post_id; } if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) { return $post_id; } if ( 'page' == $_POST[ 'post_type' ] ) { if ( !current_user_can( 'edit_page', $post_id ) ) return $post_id; } else { if ( !current_user_can( 'edit_post', $post_id ) ) return $post_id; } $data = sanitize_text_field( $_POST[ 'raindrops_custom_css_field' ] ); $data = str_replace( array( "\n", "\r" ), '', $data ); update_post_meta( $post_id, '_css', $data ); if ( isset( $_POST[ 'add-to-front' ] ) && !empty( $_POST[ 'add-to-front' ] ) ) { $data = sanitize_text_field( $_POST[ 'add-to-front' ] ); update_post_meta( $post_id, '_add-to-front', $data ); } if ( isset( $_POST[ 'header-image-show' ] ) && !empty( $_POST[ 'header-image-show' ] ) ) { $data = sanitize_text_field( $_POST[ 'header-image-show' ] ); update_post_meta( $post_id, '_raindrops_header_image_show', $data ); } if ( isset( $_POST[ 'header-image-file' ] ) && !empty( $_POST[ 'header-image-file' ] ) ) { $data = sanitize_text_field( $_POST[ 'header-image-file' ] ); update_post_meta( $post_id, '_raindrops_this_header_image', $data ); } } public function render_meta_box_content( $post ) { do_action( ' raindrops_custom_css_pre' ); $form = ''; wp_nonce_field( 'raindrops_inner_custom_box', 'raindrops_inner_custom_box_nonce' ); $value = get_post_meta( $post->ID, '_css', true ); //$value = str_replace( array( '{', '}', ), array( "{\n", "\n}\n", ), $value ); $value = str_replace( array( '{', '}', "\t" ), array( "{\r\n\t", "}\r\n", ' ' ), $value ); $value = str_replace( '![^(\"|\')];!', ";\r\n", $value ); /** * 1/307 * test */ $value = str_replace( ';', ";\r\n ", $value ); $value = str_replace( " }", "}", $value ); $value = preg_replace( "!^\s!msi", '', $value ); $raindrops_restore_check = get_theme_mod( 'header_image', get_theme_support( 'custom-header', 'default-image' ) ); $current_value_header = get_post_meta( $post->ID, '_raindrops_this_header_image', true ); $form .= '' . ''; /* * 1.295 commentout Unnatural behavior * $form .= ''; */ $raindrops_show_on_front = get_option( 'show_on_front' ); // val posts or page $raindrops_static_front_page_id = get_option( 'page_on_front' ); $raindrops_static_front_page_template_slug = basename( get_page_template_slug( $raindrops_static_front_page_id ) ); $raindrops_current_screen = get_current_screen(); $current_value = get_post_meta( $post->ID, '_add-to-front', true ); $page_page_auto_include_template = apply_filters( 'raindrops_page_auto_include_template', 'front-page.php' ); if ( $raindrops_static_front_page_template_slug == $page_page_auto_include_template && $raindrops_current_screen->post_type == 'page' ) { $form .= '

      ' . esc_html__( 'Add Front Page', 'raindrops' ) . '

      '; $form .= '

      ' . __( 'Add Front Page This Content', 'raindrops' ) . '

      '; $form .= '

      ' . __( 'No Need', 'raindrops' ) . '

      '; } /** * 1.295 change conditional test * if ( 'remove-header' !== $raindrops_restore_check && $raindrops_static_front_page_template_slug !== 'front-page.php' ) { * @1.400 add filter */ if ( $raindrops_show_on_front !== 'page' && 'remove-header' !== $raindrops_restore_check ) { $raindrops_override_control = true; } else { $raindrops_override_control = false; } $raindrops_header_img_override_option = apply_filters( 'raindrops_header_img_override_option', $raindrops_override_control ); if ( true == $raindrops_header_img_override_option ) { $form .= '

      ' . esc_html__( 'show_on_front', 'raindrops' ) . '

      '; $images = get_uploaded_header_images(); $form .= '

      ' . __( 'Hide Header Image', 'raindrops' ) . '

      '; $form .= '

      ' . __( 'Default Image', 'raindrops' ) . '

      '; $form .= '
      '; $header_image_html = '

      ' . '' . '' . '

      '; foreach ( $images as $image ) { $form .= sprintf( $header_image_html, 'style="display:inline-block;"', 'style="position:relative;top:-1em;"', $image[ 'attachment_id' ], checked( $image[ 'attachment_id' ], $current_value_header, false ), $image[ 'url' ] ); } $form .= '
      '; $form .= '

      ' . esc_html__( 'Add Custom Header', 'raindrops' ) . '

      '; } if ( $raindrops_static_front_page_template_slug == 'front-page.php' && 'page' == get_option( 'show_on_front' ) ) { $form .= '

      ' . esc_html__( 'Override header Image', 'raindrops' ) . '

      '; $form .= '

      ' . esc_html__( 'Now Selected Front Page template,You can use Featured Image for override header image', 'raindrops' ) . '

      '; } printf( $form, 'raindrops_custom_css_field', __( 'The Custom CSS Field only for the current post', 'raindrops' ), esc_textarea( $value ), 'style="width:100%;height:13em;font-size:1.3em;"' ); do_action( ' raindrops_custom_css_after' ); } } } if ( !function_exists( 'raindrops_play_list_add_atts' ) ) { /** * * @param type $out * @param type $pairs * @param type $atts * @return string */ function raindrops_play_list_add_atts( $out, $pairs, $atts ) { global $post; if ( false !== ($type = raindrops_has_indivisual_notation() ) ) { if ( isset( $type[ 'color_type' ] ) && 'dark' == $type[ 'color_type' ] ) { $out[ 'style' ] = 'dark'; } } else { $color_type = raindrops_warehouse_clone( 'raindrops_style_type' ); if ( 'dark' == $color_type ) { $out[ 'style' ] = 'dark'; } } return $out; } } if ( !function_exists( 'raindrops_complementary_color' ) ) { function raindrops_complementary_color( $hex_color = '#444' ) { return raindrops_complementary_color_clone( $hex_color ); } } if ( !function_exists( 'raindrops_add_complementary_color' ) ) { function raindrops_add_complementary_color() { global $post; if ( 'yes' == raindrops_warehouse_clone( 'raindrops_complementary_color_for_title_link' ) ) { $raindrops_link_color = raindrops_warehouse_clone( 'raindrops_hyperlink_color' ); $raindrops_complementary_color = raindrops_complementary_color( $raindrops_link_color ); $raindrops_css = sprintf( '.entry-title span{color:%1$s;}', $raindrops_complementary_color ); $raindrops_css = apply_filters( 'raindrops_add_complementary_color', $raindrops_css, $raindrops_link_color, $raindrops_complementary_color ); if ( false == raindrops_has_indivisual_notation() && $raindrops_complementary_color !== $raindrops_link_color ) { wp_add_inline_style( 'style', $raindrops_css ); } } } } if ( !function_exists( 'raindrops_oembed_filter' ) ) { /** * * @param type $html * @param type $url * @param type $attr * @param type $post_ID * @return type string html * @since 1.246 */ function raindrops_oembed_filter( $html, $url, $attr, $post_ID ) { global $is_IE; if ( !$is_IE ) { $html = str_replace( 'frameborder="0"', '', $html ); } $element = raindrops_doctype_elements( 'div', 'figure', false ); /** * https://www.reverbnation.com/ */ if ( preg_match( '!(reverbnation.com)!', $url ) ) { return sprintf( '<%2$s class="rd-reverbnation clearfix">
      %1$s
      ', $html, $element ); } /* * https://speakerd.s3.amazonaws.com/presentations/50021f75cf1db900020005e7/slide_0.jpg?1362165300 */ if ( preg_match( '!(speakerdeck.com|speakerd)!', $url ) ) { return sprintf( '<%2$s class="rd-ratio-075 rd-speakerdeck clearfix">
      %1$s
      ', $html, $element ); } /* * https://www.slideshare.net/slideshow/embed_code/7306301 */ if ( preg_match( '!(slideshare.net)!', $url ) ) { return sprintf( '<%2$s class="oembed-container rd-slideshare clearfix">
      %1$s
      ', $html, $element ); } /* * https://www.mixcloud.com/ */ if ( preg_match( '!(mixcloud.com)!', $url ) ) { return sprintf( '<%2$s class="oembed-container rd-mixcloud clearfix">
      %1$s
      ', $html, $element ); } /** * https://www.reddit.com/ */ if ( preg_match( '!(reddit.com)!', $url ) ) { return sprintf( '<%2$s class="rd-reddit clearfix">
      %1$s
      ', $html, $element ); } /** * note: 4:3 ratio can use .rd-ratio-075 */ if ( !preg_match( '!(twitter.com|tumblr.com|speakerdeck)!', $url ) && !preg_match( '!(wp-embedded-content)!', $html ) ) { return sprintf( '<%2$s class="oembed-container clearfix">%1$s', $html, $element ); } return $html; } } /** * Change color type styles from embed head element to external link * * @since 1.254 */ global $wp_customize; if ( !isset( $wp_customize ) ) { /** * @1.254 */ add_action( 'after_setup_theme', 'raindrops_setup_style_loader' ); } if ( !function_exists( 'raindrops_setup_style_loader' ) ) { /** * * @1.254 */ function raindrops_setup_style_loader() { global $raindrops_stylesheet_type; if ( !isset( $raindrops_stylesheet_type ) ) { $raindrops_stylesheet_type = raindrops_warehouse_clone( 'raindrops_stylesheet_in_html' ); } if ( $raindrops_stylesheet_type == 'external' ) { //@ see line:501 query var add_action( 'wp_enqueue_scripts', 'raindrops_register_color_type_style', 99 ); add_action( 'template_redirect', 'raindrops_color_type_style_buffer' ); } } } add_action( 'send_headers', 'raindrops_dinamic_css_header' ); add_action( 'save_post', 'raindrops_blog_last_modified_date', 10, 2 ); if ( !function_exists( 'raindrops_blog_last_modified_date' ) ) { function raindrops_blog_last_modified_date( $post_id, $post ) { set_theme_mod( 'raindrops_blog_last_modified_date', gmdate( 'D, d M Y H:i:s \G\M\T', time() ) ); } } if ( !function_exists( 'raindrops_dinamic_css_header' ) ) { function raindrops_dinamic_css_header( $headers ) { $query_string = filter_input( INPUT_ENV, 'QUERY_STRING' ); if ( preg_match( '!raindrops_color_type=1!', $query_string ) ) { header( 'Content-type: text/css' ); header( "Cache-Control: public, maxage=3600" ); header( 'Expires: ' . gmdate( 'D, d M Y H:i:s \G\M\T', time() + 3600 ) ); header( "Pragma: cache" ); $last_modified = get_theme_mod( 'raindrops_blog_last_modified_date' ); if ( !empty( $last_modified ) ) { header( 'Last-Modified:' . $last_modified ); } } } } if ( !function_exists( 'raindrops_register_color_type_style' ) ) { /** * * @global type $raindrops_current_data_version * @1.254 */ function raindrops_register_color_type_style() { global $raindrops_current_data_version, $post, $posts, $raindrops_current_column; $query = ''; $count = count( $posts ); if ( isset( $post ) && $count == 1 ) { $query = sprintf( '&raindrops_pid=%1$s', $post->ID ); } $version = md5( raindrops_embed_css() ); wp_register_style( 'raindrops_color_type', sprintf( '/?%1$s=1%2$s&qcAC=1', 'raindrops_color_type', $query ), array(), $version ); wp_enqueue_style( 'raindrops_color_type' ); } } if ( !function_exists( 'raindrops_color_type_style_buffer' ) ) { /** * * @1.254 */ function raindrops_color_type_style_buffer() { global $raindrops_fallback_human_interface_show, $post, $raindrops_current_column; if ( intval( get_query_var( 'raindrops_color_type' ) ) == 1 ) { if ( $raindrops_fallback_human_interface_show == true ) { exit; } do_action( 'raindrops_external_css_pre' ); $style = apply_filters( 'raindrops_color_type_style_buffer', raindrops_embed_css() ); if ( is_child_theme() && function_exists( 'raindrops_child_embed_css' ) ) { $style = apply_filters( 'raindrops_color_type_style_buffer', raindrops_child_embed_css() ); /* 1.304 todo structure change for external css */ } if ( !defined( 'WP_DEBUG' ) || WP_DEBUG == false ) { //$style = preg_replace('!('. wp_spaces_regexp() .'){2,}!', ' ', $style ); } ob_start(); $css = $style; $css = wp_kses( $css, array() ); $css = wp_strip_all_tags( $css ); echo $css; exit; ob_clean(); } } } if ( !function_exists( 'raindrops_unique_entry_title' ) ) { function raindrops_unique_entry_title( $postid = '', $echo = false ) { global $post; if ( isset( $post ) && empty( $postid ) ) { $postid = $post->ID; } elseif ( empty( $post ) ) { return; } $post_object = get_post( $postid ); $post_name = $post_object->post_name; $unique_title = urldecode( wp_unique_post_slug( $post_name, $post->ID, 'publish', 'post', 0 ) ); preg_match( '!(.+)(-[0-9]+)$!', $unique_title, $regs ); if ( isset( $regs[ 2 ] ) ) { if ( true == $echo ) { echo esc_html( $regs[ 2 ] ); } else { return esc_html( $regs[ 2 ] ); } } } } if ( !function_exists( 'raindrops_footer_text' ) ) { function raindrops_footer_text() { global $raindrops_current_theme_name, $raindrops_current_data_theme_uri, $template, $raindrops_accessibility_link; $raindrops_custom_footer_credit = raindrops_warehouse_clone( 'raindrops_custom_footer_credit' ); if ( !empty( $raindrops_custom_footer_credit ) ) { $current_year = date( 'Y' ); echo str_replace( '%current_year%', $current_year, $raindrops_custom_footer_credit ); return; } $raindrops_copyright_text = sprintf( apply_filters( 'raindrops_copyright_text', '©%1$s ' . $raindrops_current_theme_name . ' ' ), date( "Y" ) ); $raindrops_address_html = '
      '; $raindrops_address_html .= apply_filters( 'raindrops_prepend_footer_address', '' ); $raindrops_address_rss = "\n" . str_repeat( "\t", 2 ) . '%1$s%3$s' . "\n" . str_repeat( "\t", 3 ) . '' . esc_html__( 'and', 'raindrops' ) . '' . "\n" . str_repeat( "\t", 2 ) . '%5$s'; $raindrops_address_html .= sprintf( $raindrops_address_rss, $raindrops_copyright_text, get_bloginfo( 'rss2_url' ), esc_html__( "Entries RSS", 'raindrops' ), get_bloginfo( 'comments_rss2_url' ), esc_html__( 'Comments RSS', 'raindrops' ) ); $raindrops_address_html .= ' '; if ( is_child_theme() ) { $raindrops_theme_name = 'Child theme ' . esc_html( ucwords( $raindrops_current_theme_name ) ) . ' of ' . esc_html__( "Raindrops Theme", 'raindrops' ); } else { $raindrops_theme_name = esc_html__( "Raindrops Theme", 'raindrops' ); } $raindrops_address_html .= sprintf( "\n" . str_repeat( "\t", 2 ) . '%s ', $raindrops_current_data_theme_uri, $raindrops_theme_name ); $raindrops_address_html .= apply_filters( 'raindrops_append_footer_address', '' ); $raindrops_address_html .= "\n" . str_repeat( "\t", 1 ) . '
      '; echo apply_filters( 'raindrops_footer_text', $raindrops_address_html ); } } if ( !function_exists( 'raindrops_wp_headers' ) ) { function raindrops_wp_headers( $headers, $this ) { global $raindrops_xhtml_media_type; /** * xhtml media type * value 'application/xhtml+xml' or 'text/html' */ if ( !isset( $raindrops_xhtml_media_type ) ) { $raindrops_xhtml_media_type = raindrops_warehouse_clone( 'raindrops_xhtml_media_type' ); } if ( !is_admin() && !is_user_logged_in() && 'xhtml' == raindrops_warehouse_clone( 'raindrops_doc_type_settings' ) && $raindrops_xhtml_media_type == 'application/xhtml+xml' ) { $headers[ "Content-Type" ] = $raindrops_xhtml_media_type . '; charset=' . get_bloginfo( 'charset' ); add_filter( 'option_html_type', 'raindrops_xhtml_media_type', 10 ); } return $headers; } } if ( !function_exists( 'raindrops_xhtml_media_type' ) ) { function raindrops_xhtml_media_type( $type ) { global $raindrops_xhtml_media_type; if ( !is_admin() && !is_user_logged_in() && 'xhtml' == raindrops_warehouse_clone( 'raindrops_doc_type_settings' ) && $raindrops_xhtml_media_type == 'application/xhtml+xml' ) { return $raindrops_xhtml_media_type; } return $type; } } if ( !function_exists( 'raindrops_xhtml_http_equiv' ) ) { function raindrops_xhtml_http_equiv( $output = true ) { global $raindrops_xhtml_media_type; if ( $raindrops_xhtml_media_type == 'text/html' && 'xhtml' == raindrops_warehouse_clone( 'raindrops_doc_type_settings' ) ) { /** * By already header (), htmltype and charset has been sent */ // printf( ''. "\n" ); printf( '' . "\n" ); printf( '' . "\n" ); } } } add_action( 'save_post', 'raindrops_register_webfonts', 10, 3 ); if ( !function_exists( 'raindrops_register_webfonts' ) ) { /** * * @param type $post_ID * @param type $post * @param type $update * @return boolean * @1.264 */ function raindrops_register_webfonts( $post_ID, $post, $update ) { if ( !current_user_can( 'edit_posts' ) ) { return false; } $early_access = array( 'alefhebrew', 'amiri', 'dhurjati', 'dhyana', 'droidarabickufi', 'droidarabicnaskh', 'droidsansethiopic', 'droidsanstamil', 'droidsansthai', 'droidserifthai', 'gidugu', 'gurajada', 'hanna', 'jejugothic', 'jejuhallasan', 'jejumyeongjo', 'karlatamilinclined', 'karlatamilupright', 'kopubbatang', 'lakkireddy', 'laomuangdon', 'laomuangkhong', 'laosanspro', 'lateef', 'lohitbengali', 'lohitdevanagari', 'lohittamil', 'mallanna', 'mandali', 'myanmarsanspro', 'nats', 'ntr', 'nanumbrushscript', 'nanumgothic', 'nanumgothiccoding', 'nanummyeongjo', 'nanumpenscript', 'notokufiarabic', 'notonaskharabic', 'notonastaliqurdudraft', 'notosansarmenian', 'notosansbengali', 'notosanscherokee', 'notosansdevanagari', 'notosansdevanagariui', 'notosansethiopic', 'notosansgeorgian', 'notosansgujarati', 'notosansgurmukhi', 'notosanshebrew', 'notosansjapanese', 'notosanskannada', 'notosanskhmer', 'notosanskufiarabic', 'notosanslao', 'notosanslaoui', 'notosansmalayalam', 'notosansmyanmar', 'notosansosmanya', 'notosanssinhala', 'notosanstamil', 'notosanstamilui', 'notosanstelugu', 'notosansthai', 'notosansthaiui', 'notoserifarmenian', 'notoserifgeorgian', 'notoserifkhmer', 'notoseriflao', 'notoserifthai', 'opensanshebrew', 'opensanshebrewcondensed', 'padauk', 'peddana', 'phetsarath', 'ponnala', 'ramabhadra', 'raviprakash', 'scheherazade', 'souliyo', 'sreekrushnadevaraya', 'suranna', 'suravaram', 'tenaliramakrishna', 'thabit', 'tharlon', 'cwtexfangsong', 'cwtexhei', 'cwtexkai', 'cwtexming' ); $flag_early_access = false; $include_fonts = ''; $link_html = '' . "\n"; $url = apply_filters( 'google_fonts_endpoint_url', '//fonts.googleapis.com/css' ); $secondary = ''; $separator = ''; $mid_name = ''; $has_mid_name = array(); $web_font_styles = ''; $font_for_style_italic = ''; $font_for_style_weight = ''; if ( preg_match_all( '!class="([^\"]*)(google-font-)([a-z0-9-]+)([^\"]*)"!', $post->post_title . $post->post_content, $regs, PREG_SET_ORDER ) ) { if ( isset( $regs ) && !empty( $regs ) ) { foreach ( $regs as $reg ) { if ( strstr( $reg[ 3 ], '-' ) ) { if ( count( $has_mid_name = explode( '-', $reg[ 3 ] ) ) == 3 ) { list( $primary, $mid_name, $secondary ) = $has_mid_name; } else { list( $primary, $secondary) = explode( '-', $reg[ 3 ] ); } } else { $primary = $reg[ 3 ]; } preg_match_all( '!([0-9]00)(i)?!', $reg[ 3 ], $weight_and_italic ); if ( is_array( $weight_and_italic ) ) { $weight_and_italic_values = implode( ',', $weight_and_italic[ 0 ] ); $weight_and_italic_values = str_replace( 'i', 'italic', $weight_and_italic_values ); if ( !empty( $weight_and_italic_values ) ) { $separator = ':'; } } $primary = preg_replace( '![0-9]00(i)?!', '', $primary ); $secondary = preg_replace( '![0-9]00(i)?!', '', $secondary ); $mid_name = preg_replace( '![0-9]00(i)?!', '', $mid_name ); if ( true == array_search( $primary . $mid_name . $secondary, $early_access ) ) { $flag_early_access = true; } if ( !empty( $has_mid_name ) ) { $font_name = ucfirst( $primary ) . ' ' . ucfirst( $mid_name ) . ' ' . ucfirst( $secondary ) . $separator . $weight_and_italic_values; $font_for_style = ucfirst( $primary ) . ' ' . ucfirst( $mid_name ) . ' ' . ucfirst( $secondary ); ; } elseif ( !empty( $secondary ) && empty( $has_mid_name ) ) { $font_name = ucfirst( $primary ) . ' ' . ucfirst( $secondary ) . $separator . $weight_and_italic_values; $font_for_style = ucfirst( $primary ) . ' ' . ucfirst( $secondary ); } else { $font_name = ucfirst( $primary ); $font_for_style = ucfirst( $primary ); } if ( isset( $reg[ 3 ] ) ) { if ( strstr( $weight_and_italic_values, ',' ) ) { } else { if ( !empty( $weight_and_italic_values ) ) { if ( strstr( $weight_and_italic_values, 'italic' ) ) { $font_for_style_italic = 'font-style: italic;'; } if ( preg_match( '!([0-9]00)(i)?!', $weight_and_italic_values, $font_weight_value ) ) { $font_for_style_weight = 'font-weight: ' . absint( $font_weight_value[ 1 ] ) . ';'; } } } $web_font_styles = str_replace( '.mce-content-body .google-font-' . sanitize_html_class( $reg[ 3 ] ) . ', .hfeed .google-font-' . sanitize_html_class( $reg[ 3 ] ) . '{ font-family:"' . $font_for_style . '", sans-serif;' . $font_for_style_italic . $font_for_style_weight . '}' . "\n", '', $web_font_styles ); $web_font_styles .= '.mce-content-body .google-font-' . sanitize_html_class( $reg[ 3 ] ) . ', .hfeed .google-font-' . sanitize_html_class( $reg[ 3 ] ) . '{ font-family:"' . $font_for_style . '", sans-serif;' . $font_for_style_italic . $font_for_style_weight . '}' . "\n"; } $query_val = str_replace( '%2B', '+', urlencode( $font_name ) ); if ( preg_match( '!(font-effect-)([a-z-)]+)!', $reg[ 0 ], $effect ) ) { $font_url = esc_url( add_query_arg( array( 'family' => $query_val, 'effect' => urlencode( $effect[ 2 ] ) ), $url ) ); } else { $font_url = esc_url( add_query_arg( 'family', $query_val, $url ) ); } $font_url = str_replace( '&', '&', $font_url ); $id = $reg[ 3 ]; if ( !empty( $effect[ 2 ] ) ) { $id = $id . '-' . $effect[ 2 ]; } if ( true == $flag_early_access ) { $font_url = 'http://fonts.googleapis.com/earlyaccess/'; $font_url .= str_replace( ' ', '', strtolower( $font_name . '.css' ) ); $font_url = str_replace( $separator . $weight_and_italic_values, '', $font_url ); $id = str_replace( $weight_and_italic_values, '', $id ); $include_fonts = str_replace( sprintf( $link_html, $font_url, 'google-font-early-' . sanitize_html_class( $id ) . '-css' ), '', $include_fonts ); $include_fonts .= sprintf( $link_html, $font_url, 'google-font-early-' . sanitize_html_class( $id ) . '-css' ); } else { $include_fonts = str_replace( sprintf( $link_html, $font_url, 'google-font-' . sanitize_html_class( $id ) . '-css' ), '', $include_fonts ); $include_fonts .= sprintf( $link_html, $font_url, 'google-font-' . sanitize_html_class( $id ) . '-css' ); } unset( $regs ); $primary = ''; $secondary = ''; $separator = ''; $weight_and_italic_values = ''; $font_name = ''; $font_url = ''; $font_for_style_italic = ''; $font_for_style_weight = ''; $mid_name = ''; $has_mid_name = array(); $flag_early_access = false; } /* patch 1.272 */ $include_fonts = str_replace( '++', '+', $include_fonts ); update_post_meta( $post_ID, '_web_fonts_link_element', $include_fonts ); update_post_meta( $post_ID, '_web_fonts_styles', $web_font_styles ); $already_included = get_post_meta( $post_ID ); if ( empty( $already_included ) ) { delete_post_meta( $post_ID, '_web_fonts_link_element' ); } } } } } if ( !function_exists( 'raindrops_tiny_mce_before_init' ) ) { /** * * @param array $init_array * @return string * @since 1.264 */ function raindrops_tiny_mce_before_init( $init_array ) { $separator = ''; if ( !empty( $init_array ) ) { $separator = ','; } $init_array[ 'content_css' ] = trim( $init_array[ 'content_css' ], ',' ) . $separator . raindrops_google_fonts_for_tinymce(); return $init_array; } } if ( !function_exists( 'raindrops_google_fonts_for_tinymce' ) ) { /** * * @global type $post * @return type * @since 1.264 */ function raindrops_google_fonts_for_tinymce() { if ( raindrops_warehouse_clone( 'raindrops_sync_style_for_tinymce' ) !== 'yes' ) { return; } global $post; $google_font_link_elements = get_post_meta( $post->ID, '_web_fonts_link_element', true ); $comma_separated_urls = ''; if ( preg_match_all( '!href="([^"]+)"!', $google_font_link_elements, $regs, PREG_SET_ORDER ) ) { foreach ( $regs as $reg ) { $comma_separated_urls .= ', ' . $reg[ 1 ]; } } return trim( $comma_separated_urls, ',' ); } } if ( !function_exists( 'raindrops_editor_styles_callback' ) ) { /** * * @global type $content_width * @return type * @since 1.264 */ function raindrops_editor_styles_callback() { global $content_width; if ( raindrops_warehouse_clone( 'raindrops_sync_style_for_tinymce' ) !== 'yes' ) { return; } $metabox_style = ''; $result = ''; if ( isset( $_REQUEST[ 'id' ] ) && !empty( $_REQUEST[ 'id' ] ) ) { $post_id = absint( $_REQUEST[ 'id' ] ); $metabox_style = get_post_meta( $post_id, '_css', true ); $style = get_post_meta( $post_id, '_web_fonts_styles', true ); $result = str_replace( $style, '', $result ); $result .= $result . $style; } $defined_colors = raindrops_embed_css(); $defined_colors = str_replace( array( 'body', '.entry-content' ), array( 'no-body', 'html .mceContentBody' ), $defined_colors ); $font_size = raindrops_warehouse_clone( 'raindrops_basefont_settings' ); $font_color = raindrops_warehouse_clone( 'raindrops_default_fonts_color' ); $link_color = raindrops_warehouse_clone( 'raindrops_hyperlink_color' ); $raindrops_editor_styles_width = apply_filters( 'raindrops_editor_styles_width', $content_width ); $editor_custom_styles = 'html .mceContentBody{max-width:' . $raindrops_editor_styles_width . 'px;}' . "\n"; $editor_custom_styles .= 'html .mceContentBody{font-size:' . $font_size . 'px;}' . "\n"; if ( isset( $font_color ) && !empty( $font_color ) ) { $editor_custom_styles .= 'html .mceContentBody.mce-content-body{color:' . $font_color . ';}' . "\n"; } if ( isset( $link_color ) && !empty( $link_color ) ) { $editor_custom_styles .= 'html .mceContentBody a{color:' . $link_color . ';}' . "\n"; } header( 'Content-type: text/css' ); echo $editor_custom_styles; echo apply_filters( 'raindrops_editor_styles_callback', $result ); echo $defined_colors; echo $metabox_style; die(); } } if ( !function_exists( 'raindrops_get_pinup_widget_ids' ) ) { /** * * @return type array * @since 1.265 */ function raindrops_get_pinup_widget_ids() { $widgets = wp_get_sidebars_widgets(); $ids = array(); if ( isset( $widgets ) && is_array( $widgets ) ) { foreach ( $widgets as $key => $val_array ) { if ( preg_match( '$sidebar$', $key ) ) { if ( is_array( $val_array ) ) { foreach ( $val_array as $widget ) { if ( preg_match( '$raindrops_pinup_entry_widget-([0-9]+)$', $widget, $regs ) ) { $ids[] = absint( $regs[ 1 ] ); } } } } } } return $ids; } } if ( !function_exists( 'raindrops_apply_pinup_styles' ) ) { /** * * @return type string styles * @since 1.265 */ function raindrops_apply_pinup_styles() { $widget_ids = raindrops_get_pinup_widget_ids(); $style = ''; foreach ( $widget_ids as $id ) { $style .= raindrops_pinup_parse_styles( $id ); } return $style; } } if ( !function_exists( 'raindrops_pinup_widget_ids_to_post_ids' ) ) { /** * * @param type $ids * @return boolean * @since 1.265 */ function raindrops_pinup_widget_ids_to_post_ids( $ids ) { $widget_array = get_option( 'widget_raindrops_pinup_entry_widget' ); $raindrops_pinup_post_id = array(); if ( is_array( $ids ) ) { foreach ( $ids as $id ) { if ( isset( $widget_array[ $id ][ "id" ] ) ) { $raindrops_pinup_post_id[] = $widget_array[ $id ][ "id" ]; } } return $raindrops_pinup_post_id; } return false; } } if ( !function_exists( 'raindrops_pinup_parse_styles' ) ) { /** * * @param type $id * @return string * @since 1.265 */ function raindrops_pinup_parse_styles( $id ) { $id_prefix = 'pinup-'; $widget_array = get_option( 'widget_raindrops_pinup_entry_widget' ); $styles = $widget_array[ $id ][ "inline_style" ]; $raindrops_pinup_post_id = $widget_array[ $id ][ "id" ]; if ( empty( $styles ) ) { return ''; } if ( preg_match( '${$', $styles ) ) { preg_match_all( '$[^}]*{([^}]*)}$', $styles, $regs, PREG_SET_ORDER ); $result = ''; foreach ( $regs as $each_style ) { $result .= '#' . $id_prefix . $raindrops_pinup_post_id . ' ' . $each_style[ 0 ]; } } else { $result = '#' . $id_prefix . $raindrops_pinup_post_id . '{ ' . $styles . ' }'; } return $result; } } /** * * @since 1.265 */ global $wp_customize; if ( isset( $wp_customize ) ) { add_filter( 'raindrops_embed_meta_css', 'raindrops_pinup_entry_style' ); } if ( !function_exists( 'raindrops_pinup_entry_style' ) ) { /** * * @param type $css * @return type string styel filterd value * @since 1.265 */ function raindrops_pinup_entry_style( $css ) { return $css . raindrops_apply_pinup_styles(); } } if ( !function_exists( 'raindrops_month_list_count' ) ) { /** * * @param type $count * @return int * @since 1.271 */ function raindrops_month_list_count( $count ) { return 50; } } if ( !function_exists( 'raindrops_add_header_archive_description' ) && function_exists( 'get_the_archive_description' ) ) { /** * * @since1.272 */ function raindrops_add_header_archive_description() { if ( is_category() || is_tag() ) { $html = '' . "\n"; $raindrops_archive_description_length = apply_filters( 'raindrops_archive_description_length', 115 ); $description = apply_filters( 'raindrops_category_description', get_the_archive_description() ); $description = wp_kses( $description, array() ); $description = wp_html_excerpt( $description, $raindrops_archive_description_length, '' ); if ( !empty( $description ) ) { $result = sprintf( $html, 'description', $description ); echo apply_filters( 'raindrops_add_header_archive_description', $result ); } } } } /** * fallback function renema but child theme or custom user * * @return type */ if ( !function_exists( 'raindrops_show_one_column' ) ) { function raindrops_show_one_column() { _deprecated_function( __FUNCTION__, '1.272', 'raindrops_column_controller()' ); return raindrops_column_controller(); } } if ( !function_exists( 'raindrops_add_class' ) ) { function raindrops_add_class( $id = 'yui-u first', $echo = false ) { _deprecated_function( __FUNCTION__, '1.272', 'raindrops_dinamic_class()' ); if ( false == $echo ) { return raindrops_dinamic_class( $id = 'yui-u first', $echo = false ); } else { echo raindrops_dinamic_class( $id = 'yui-u first', $echo = false ); } } } if ( !function_exists( 'raindrops_category_navigation' ) ) { function raindrops_category_navigation() { global $raindrops_category_navigation; if ( isset( $raindrops_category_navigation ) && false == $raindrops_category_navigation ) { return; } $result = ''; $tmp_id = get_query_var( 'cat' ); $tmp_id = absint( $tmp_id ); $sibling = ''; $tmp_parent = get_category_parents( $tmp_id, true, ' » ' ); if ( strip_tags( $tmp_parent ) !== get_the_category_by_ID( $tmp_id ) . ' » ' ) { $tmp_parent = trim( $tmp_parent, ' » ' ); $result = preg_replace( '!]+>' . get_the_category_by_ID( $tmp_id ) . '!', '', $tmp_parent ); $result .= sprintf( '%1$s » ', get_the_category_by_ID( $tmp_id ) ); } $tmp_child_ids = get_term_children( $tmp_id, 'category' ); if ( isset( $tmp_child_ids ) && !empty( $tmp_child_ids ) ) { foreach ( $tmp_child_ids as $tmp_id ) { $tmp_id = absint( $tmp_id ); $term = get_term_by( 'id', $tmp_id, 'category' ); $url = esc_url( get_term_link( $tmp_id, 'category' ) ); if ( is_wp_error( $url ) ) { continue; } if ( false !== $term && isset( $term->parent ) ) { if ( $sibling == $term->parent ) { $category_separator = '|'; $flag = 'sibling'; } else { $category_separator = "»"; $flag = 'parent'; } $category_separator = apply_filters( 'raindrops_category_navigation_separator', $category_separator, $flag ); $result .= " {$category_separator} " . '' . esc_html( $term->name ) . ""; $sibling = $term->parent; } } } $result = str_replace( '» »', '»', $result ); return apply_filters( 'raindrops_category_navigation', '
      ' . trim( $result, ' » ' ) . '
      ' ); } } if ( !function_exists( 'raindrops_post_category_relation' ) ) { function raindrops_post_category_relation() { global $post; // @1.416 todo $result = array(); $tmp_id = absint( get_query_var( 'cat' ) ); $categories = get_the_category( $post->ID ); foreach ( $categories as $category ) { $category->term_id = absint( $category->term_id ); $parents = get_category_parents( $category->term_id, true, '»' ); $parents_item = str_replace( '' . $category->name . "»", '' . $category->name . "»", $parents ); $parents = explode( '»', $parents_item ); if ( !empty( $parents_item ) ) { //$result[] = ''.esc_html__('Parent Category:','raindrops' ).''; } foreach ( $parents as $links ) { $result[] = $links; } $replace_check = get_the_category_by_ID( $category->term_id ); $replace_check = esc_url( get_category_link( $category->term_id ) ); $tmp_child_ids = get_term_children( $category->term_id, 'category' ); $child_result = ''; $child_ready = array(); if ( !empty( $tmp_child_ids ) ) { //$result[] = ''.esc_html__('Child Category:','raindrops' ).''; foreach ( $tmp_child_ids as $tmp_id ) { $tmp_id = absint( $tmp_id ); $term = get_term_by( 'id', $tmp_id, 'category' ); //$result[] = '' . $term->name . ""; } } } $result = array_unique( $result ); $result = implode( ' ', $result ); // @1.416 todo $result = preg_replace( '!]+>[^<]+!', '', $result ); return apply_filters( 'raindrops_post_category_relation', rtrim( $result, ' » ' ) ); } } if ( !function_exists( 'raindrops_article_wrapper_class' ) ) { /** * * @return string * @since1.277 * todo: @1.333 works improperly when using cache plugin. needs client side add class. * test code: raindrops-helper.js line:4 test code... */ function raindrops_article_wrapper_class() { global $post; $class = array(); if ( isset( $post ) && preg_match( '!<[^>]*?(lang-ja|lang-not-ja)[^>]*?>!', $post->post_content ) ) { $detect_lang = raindrops_get_accept_language(); if ( !empty( $detect_lang ) ) { array_push( $class, 'rd-l-' . $detect_lang ); } } if ( isset( $post ) && preg_match( "!\[raindrops[^\]]+(class)=(\"|')*?([^\"']+)(\"|')*?[^\]]*\]!si", $post->post_content, $matches ) ) { if ( isset( $matches[ 3 ] ) && !empty( $matches[ 3 ] ) ) { $classes = preg_split( "/[\s,]+/", $matches[ 3 ] ); foreach ( $classes as $extend_class ) { array_push( $class, $extend_class ); } } } return apply_filters( 'raindrops_article_wrapper_class', $class ); } } function raindrops_the_article_wrapper_class() { global $post; $results = raindrops_article_wrapper_class(); $result = array(); foreach ( $results as $v ) { array_push( $result, sanitize_html_class( $v ) ); } $result = array_unique( $result ); $result = trim( implode( ' ', $result ) ); if ( !empty( $result ) ) { printf( ' class="%1$s"', $result ); } } if ( !function_exists( 'raindrops_get_accept_language' ) ) { /** * * @return boolean * @since 1.278 */ function raindrops_get_accept_language() { $accept_language = filter_input( INPUT_ENV, "HTTP_ACCEPT_LANGUAGE" ); if ( !is_null( $accept_language ) && isset( $accept_language ) ) { $browser_lang = $accept_language; $browser_lang = explode( ",", $browser_lang ); $browser_lang = wp_strip_all_tags( $browser_lang[ 0 ] ); if ( isset( $browser_lang ) ) { return $browser_lang; } return false; } } } if ( !function_exists( 'raindrops_excerpt_id' ) ) { /** * @since 1.278 */ function raindrops_excerpt_id() { if ( is_singular() ) { echo ''; } } } if ( !function_exists( 'raindrops_excerpt_after_link' ) ) { /** * * @global type $post * @param type $content * @param type $function * @return type * @since 1.278 */ function raindrops_excerpt_after_link( $content, $function ) { global $post; $raindrops_excerpt_more = raindrops_warehouse_clone( 'raindrops_read_more_after_excerpt' ); $more_link_text = esc_html__( 'Continue reading ', 'raindrops' ) . '' . esc_html__( ' Post ID ', 'raindrops' ) . get_the_ID() . ''; $html = '
      '; $link = sprintf( $html, esc_url( get_permalink( $post->ID ) . '#read' ), $more_link_text ); if ( $raindrops_excerpt_more == 'yes' && isset( $post ) && ( $function == 'raindrops_entry_content' || $function == 'raindrops_html_excerpt_with_elements' ) && !is_singular() ) { return $content . $link; } return $content; } } if ( !function_exists( 'raindrops_oembed_result' ) ) { /** * * @param type $html * @param type $url * @param type $args * @return type * @since 1.278 */ function raindrops_oembed_result( $html, $url, $args ) { $raindrops_excerpt_condition = raindrops_detect_excerpt_condition(); $raindrops_excerpt_enable = raindrops_warehouse_clone( 'raindrops_excerpt_enable' ); $raindrops_allow_oembed_excerpt_view = raindrops_warehouse_clone( 'raindrops_allow_oembed_excerpt_view' ); if ( true == $raindrops_excerpt_condition && 'yes' == $raindrops_excerpt_enable ) { if ( 'yes' == $raindrops_allow_oembed_excerpt_view ) { return $html; } else { return; } } return $html; } } if ( !function_exists( 'raindrops_parse_webfonts' ) ) { /** * * @param type $post_ID * @param type $post * @param type $update * @return boolean * @1.264 */ function raindrops_parse_webfonts( $data ) { if ( is_admin() && !current_user_can( 'edit_posts' ) ) { return false; } $early_access = array( 'alefhebrew', 'amiri', 'dhurjati', 'dhyana', 'droidarabickufi', 'droidarabicnaskh', 'droidsansethiopic', 'droidsanstamil', 'droidsansthai', 'droidserifthai', 'gidugu', 'gurajada', 'hanna', 'jejugothic', 'jejuhallasan', 'jejumyeongjo', 'karlatamilinclined', 'karlatamilupright', 'kopubbatang', 'lakkireddy', 'laomuangdon', 'laomuangkhong', 'laosanspro', 'lateef', 'lohitbengali', 'lohitdevanagari', 'lohittamil', 'mallanna', 'mandali', 'myanmarsanspro', 'nats', 'ntr', 'nanumbrushscript', 'nanumgothic', 'nanumgothiccoding', 'nanummyeongjo', 'nanumpenscript', 'notokufiarabic', 'notonaskharabic', 'notonastaliqurdudraft', 'notosansarmenian', 'notosansbengali', 'notosanscherokee', 'notosansdevanagari', 'notosansdevanagariui', 'notosansethiopic', 'notosansgeorgian', 'notosansgujarati', 'notosansgurmukhi', 'notosanshebrew', 'notosansjapanese', 'notosanskannada', 'notosanskhmer', 'notosanskufiarabic', 'notosanslao', 'notosanslaoui', 'notosansmalayalam', 'notosansmyanmar', 'notosansosmanya', 'notosanssinhala', 'notosanstamil', 'notosanstamilui', 'notosanstelugu', 'notosansthai', 'notosansthaiui', 'notoserifarmenian', 'notoserifgeorgian', 'notoserifkhmer', 'notoseriflao', 'notoserifthai', 'opensanshebrew', 'opensanshebrewcondensed', 'padauk', 'peddana', 'phetsarath', 'ponnala', 'ramabhadra', 'raviprakash', 'scheherazade', 'souliyo', 'sreekrushnadevaraya', 'suranna', 'suravaram', 'tenaliramakrishna', 'thabit', 'tharlon', 'cwtexfangsong', 'cwtexhei', 'cwtexkai', 'cwtexming' ); $flag_early_access = false; $include_fonts = ''; $link_html = '@import url(%1$s);' . "\n"; $url = apply_filters( 'google_fonts_endpoint_url', '//fonts.googleapis.com/css' ); $secondary = ''; $separator = ''; $mid_name = ''; $has_mid_name = array(); $web_font_styles = ''; $font_for_style_italic = ''; $font_for_style_weight = ''; if ( preg_match_all( '!([^\s]*)(google-font-)([a-z0-9-]+)([^\s]*)!', $data, $regs, PREG_SET_ORDER ) ) { if ( isset( $regs ) && !empty( $regs ) ) { foreach ( $regs as $reg ) { if ( strstr( $reg[ 3 ], '-' ) ) { if ( count( $has_mid_name = explode( '-', $reg[ 3 ] ) ) == 3 ) { list( $primary, $mid_name, $secondary ) = $has_mid_name; } else { list( $primary, $secondary) = explode( '-', $reg[ 3 ] ); } } else { $primary = $reg[ 3 ]; } preg_match_all( '!([0-9]00)(i)?!', $reg[ 3 ], $weight_and_italic ); if ( is_array( $weight_and_italic ) ) { $weight_and_italic_values = implode( ',', $weight_and_italic[ 0 ] ); $weight_and_italic_values = str_replace( 'i', 'italic', $weight_and_italic_values ); if ( !empty( $weight_and_italic_values ) ) { $separator = ':'; } } $primary = preg_replace( '![0-9]00(i)?!', '', $primary ); $secondary = preg_replace( '![0-9]00(i)?!', '', $secondary ); $mid_name = preg_replace( '![0-9]00(i)?!', '', $mid_name ); if ( true == array_search( $primary . $mid_name . $secondary, $early_access ) ) { $flag_early_access = true; } if ( !empty( $has_mid_name ) ) { $font_name = ucfirst( $primary ) . ' ' . ucfirst( $mid_name ) . ' ' . ucfirst( $secondary ) . $separator . $weight_and_italic_values; $font_for_style = ucfirst( $primary ) . ' ' . ucfirst( $mid_name ) . ' ' . ucfirst( $secondary ); ; } elseif ( !empty( $secondary ) && empty( $has_mid_name ) ) { $font_name = ucfirst( $primary ) . ' ' . ucfirst( $secondary ) . $separator . $weight_and_italic_values; $font_for_style = ucfirst( $primary ) . ' ' . ucfirst( $secondary ); } else { $font_name = ucfirst( $primary ); $font_for_style = ucfirst( $primary ); } if ( isset( $reg[ 3 ] ) ) { if ( strstr( $weight_and_italic_values, ',' ) ) { } else { if ( !empty( $weight_and_italic_values ) ) { if ( strstr( $weight_and_italic_values, 'italic' ) ) { $font_for_style_italic = 'font-style: italic;'; } if ( preg_match( '!([0-9]00)(i)?!', $weight_and_italic_values, $font_weight_value ) ) { $font_for_style_weight = 'font-weight: ' . absint( $font_weight_value[ 1 ] ) . ';'; } } } $web_font_styles = str_replace( '.mce-content-body .google-font-' . sanitize_html_class( $reg[ 3 ] ) . ', .hfeed .google-font-' . sanitize_html_class( $reg[ 3 ] ) . ', h1.google-font-' . sanitize_html_class( $reg[ 3 ] ) . ' span{ font-family:"' . $font_for_style . '", sans-serif;' . $font_for_style_italic . $font_for_style_weight . '}' . "\n", '', $web_font_styles ); $web_font_styles .= '.mce-content-body .google-font-' . sanitize_html_class( $reg[ 3 ] ) . ', .hfeed .google-font-' . sanitize_html_class( $reg[ 3 ] ) . ', .google-font-' . sanitize_html_class( $reg[ 3 ] ) . ' span{ font-family:"' . $font_for_style . '", sans-serif;' . $font_for_style_italic . $font_for_style_weight . '}' . "\n"; } $query_val = str_replace( '%2B', '+', urlencode( $font_name ) ); if ( preg_match( '!(font-effect-)([a-z-)]+)!', $reg[ 0 ], $effect ) ) { $font_url = esc_url( add_query_arg( array( 'family' => $query_val, 'effect' => urlencode( $effect[ 2 ] ) ), $url ) ); } else { $font_url = esc_url( add_query_arg( 'family', $query_val, $url ) ); } $font_url = str_replace( '&', '&', $font_url ); $id = $reg[ 3 ]; if ( !empty( $effect[ 2 ] ) ) { $id = $id . '-' . $effect[ 2 ]; } if ( true == $flag_early_access ) { $font_url = 'http://fonts.googleapis.com/earlyaccess/'; $font_url .= str_replace( ' ', '', strtolower( $font_name . '.css' ) ); $font_url = str_replace( $separator . $weight_and_italic_values, '', $font_url ); $id = str_replace( $weight_and_italic_values, '', $id ); $include_fonts = str_replace( sprintf( $link_html, $font_url, 'google-font-early-' . sanitize_html_class( $id ) . '-css' ), '', $include_fonts ); $include_fonts .= sprintf( $link_html, $font_url ); } else { $include_fonts = str_replace( sprintf( $link_html, $font_url, 'google-font-' . sanitize_html_class( $id ) . '-css' ), '', $include_fonts ); $include_fonts .= sprintf( $link_html, $font_url ); } unset( $regs ); $primary = ''; $secondary = ''; $separator = ''; $weight_and_italic_values = ''; $font_name = ''; $font_url = ''; $font_for_style_italic = ''; $font_for_style_weight = ''; $mid_name = ''; $has_mid_name = array(); $flag_early_access = false; } /* patch 1.272 */ $include_fonts = str_replace( '++', '+', $include_fonts ); return array( 'import_rule' => $include_fonts, 'apply_style' => $web_font_styles ); } } } } if ( !function_exists( 'raindrops_get_classes_from_primary_menu' ) ) { /** * * @return boolean * @since1.278 */ function raindrops_get_classes_from_primary_menu() { $menu_slug = 'primary'; $locations = get_nav_menu_locations(); if ( isset( $locations[ $menu_slug ] ) ) { $menu_id = $locations[ $menu_slug ]; $items = wp_get_nav_menu_items( $menu_id ); $class_strings = ''; if ( isset( $items ) && !empty( $items ) ) { foreach ( $items as $val ) { if ( isset( $val->classes ) && is_array( $val ) ) { $class_strings .= ' ' . implode( ',', $val->classes ) . ' '; } } return esc_attr( $class_strings ); } else { return false; } } return false; } } if ( !function_exists( 'raindrops_apply_google_font_import_rule_for_article_title' ) ) { /** * * @param type $css * @return type * @since 1.278 */ function raindrops_apply_google_font_import_rule_for_article_title( $css ) { $setting_value = raindrops_warehouse_clone( 'raindrops_article_title_css_class' ); $fonts_get = raindrops_parse_webfonts( $setting_value ); $import_rule = $fonts_get[ 'import_rule' ]; if ( !empty( $import_rule ) ) { return wp_strip_all_tags( $import_rule . $css ); } return $css; } } if ( !function_exists( 'raindrops_apply_google_font_import_rule_for_site_title' ) ) { /** * * @param type $css * @return type * @since 1.278 */ function raindrops_apply_google_font_import_rule_for_site_title( $css ) { $setting_value = raindrops_warehouse_clone( 'raindrops_site_title_css_class' ); $fonts_get = raindrops_parse_webfonts( $setting_value ); $import_rule = $fonts_get[ 'import_rule' ]; if ( !empty( $import_rule ) ) { return wp_strip_all_tags( $import_rule . $css ); } return $css; } } if ( !function_exists( 'raindrops_apply_google_font_import_rule_for_primary_menu' ) ) { /** * * @param type $css * @return type * @since 1.278 */ function raindrops_apply_google_font_import_rule_for_primary_menu( $css ) { $setting_value = raindrops_get_classes_from_primary_menu(); $fonts_get = raindrops_parse_webfonts( $setting_value ); $import_rule = $fonts_get[ 'import_rule' ]; if ( !empty( $import_rule ) ) { return wp_strip_all_tags( $import_rule . $css ); } return $css; } } if ( !function_exists( 'raindrops_apply_google_font_styles_for_article_title' ) ) { /** * * @param type $css * @return type * @since 1.278 */ function raindrops_apply_google_font_styles_for_article_title( $css ) { $setting_value = raindrops_warehouse_clone( 'raindrops_article_title_css_class' ); $fonts_get = raindrops_parse_webfonts( $setting_value ); $style = $fonts_get[ 'apply_style' ]; if ( !empty( $style ) ) { return wp_strip_all_tags( $style . $css ); } return $css; } } if ( !function_exists( 'raindrops_apply_google_font_styles_for_site_title' ) ) { /** * * @param type $css * @return type * @since 1.278 */ function raindrops_apply_google_font_styles_for_site_title( $css ) { $setting_value = raindrops_warehouse_clone( 'raindrops_site_title_css_class' ); $fonts_get = raindrops_parse_webfonts( $setting_value ); $style = $fonts_get[ 'apply_style' ]; if ( !empty( $style ) ) { return wp_strip_all_tags( $style . $css ); } return $css; } } if ( !function_exists( 'raindrops_apply_google_font_styles_for_primary_menu' ) ) { /** * * @param type $css * @return type * @since 1.278 */ function raindrops_apply_google_font_styles_for_primary_menu( $css ) { $setting_value = raindrops_get_classes_from_primary_menu(); $fonts_get = raindrops_parse_webfonts( $setting_value ); $style = $fonts_get[ 'apply_style' ]; if ( !empty( $style ) ) { return wp_strip_all_tags( $style . $css ); } return $css; } } if ( !function_exists( 'raindrops_is_place_of_site_title' ) ) { /** * * @return boolean * @since 1.278 */ function raindrops_is_place_of_site_title() { global $post; $raindrops_type_site_title = raindrops_warehouse_clone( 'raindrops_place_of_site_title' ); if ( get_header_image() == false ) { raindrops_update_theme_option( 'raindrops_place_of_site_title', 'above' ); $raindrops_type_site_title = 'above'; } If ( $raindrops_type_site_title == 'header_image' ) { if ( isset( $post->ID ) ) { $display_header_image_file = get_post_meta( $post->ID, '_raindrops_this_header_image', true ); } if ( isset( $post->ID ) && is_singular() && $display_header_image_file == 'hide' ) { return true; } return false; } return true; } } if ( !function_exists( 'raindrops_custom_header_image_contents' ) ) { /** * * @param type $content * @return type * @since 1.278 */ function raindrops_custom_header_image_contents( $content ) { $setting_value = raindrops_warehouse_clone( 'raindrops_place_of_site_title' ); If ( $setting_value == 'header_image' ) { return $content . raindrops_site_title(); } return $content; } } if ( !function_exists( 'raindrops_custom_site_title_class' ) ) { /** * * @param type $return_value * @return type * @since 1.278 */ function raindrops_custom_site_title_class( $return_value ) { $setting_value = raindrops_warehouse_clone( 'raindrops_site_title_css_class' ); if ( $setting_value !== 'none' && !empty( $setting_value ) ) { return $return_value . ' ' . wp_kses( $setting_value, array() ); } return $return_value; } } if ( !function_exists( 'raindrops_custom_site_title_style' ) ) { /** * * @param type $return_value * @return type * @since 1.278 */ function raindrops_custom_site_title_style( $return_value ) { global $post; $display_header_image_file = ''; $style = apply_filters( 'raindrops_site_title_in_header_image_css', '', '#header-image #site-title, #raindrops_metaslider #site-title' ); $setting_value = raindrops_warehouse_clone( 'raindrops_place_of_site_title' ); If ( $setting_value == 'header_image' && get_header_image() !== false ) { if ( isset( $post->ID ) ) { $display_header_image_file = get_post_meta( $post->ID, '_raindrops_this_header_image', true ); } if ( isset( $post->ID ) && is_singular() && $display_header_image_file == 'hide' ) { $style .= '#hd {display:block;}'; } else { $style .= '#hd {display:none;}'; } } $setting_value = raindrops_warehouse_clone( 'raindrops_tagline_in_the_header_image' ); If ( $setting_value == 'hide' || $setting_value == 'above' ) { $style .= '#header-image .tagline{display:none;}'; } $setting_value = raindrops_warehouse_clone( 'raindrops_site_title_font_size' ); If ( is_numeric( $setting_value ) && $setting_value < 11 ) { $style .= '#header-image #site-title{font-size:' . $setting_value . 'vw;}'; } $setting_value_left_type = raindrops_warehouse_clone( 'raindrops_site_title_left_margin_type' ); if ( 'centered' == $setting_value_left_type ) { $setting_value_top = (float) raindrops_warehouse_clone( 'raindrops_site_title_top_margin' ); $style .='#header-image #site-title, #raindrops_metaslider #site-title{position:absolute;left:0; right:0; margin-left: auto; margin-right: auto; text-align: center; top:' . $setting_value_top . '%; }'; } elseif ( 'default' == $setting_value_left_type ) { $setting_value_top = (float) raindrops_warehouse_clone( 'raindrops_site_title_top_margin' ); $setting_value_left = 1; if ( is_numeric( $setting_value_top ) && is_numeric( $setting_value_top ) ) { $style .='#header-image #site-title, #raindrops_metaslider #site-title{position:absolute;left:' . $setting_value_left . '%; top:' . $setting_value_top . '%; }'; } } else { $setting_value_top = (float) raindrops_warehouse_clone( 'raindrops_site_title_top_margin' ); $setting_value_left = (float) raindrops_warehouse_clone( 'raindrops_site_title_left_margin' ); if ( is_numeric( $setting_value_top ) && is_numeric( $setting_value_top ) ) { $style .='#header-image #site-title, #raindrops_metaslider #site-title{position:absolute;left:' . $setting_value_left . '%; top:' . $setting_value_top . '%;}'; } } return wp_strip_all_tags( $return_value . $style ); } } if ( !function_exists( 'raindrops_customizer_add_article_title_css_class' ) ) { /** * * @param type $class * @return type * @since 1.295 */ function raindrops_customizer_add_article_title_css_class( $class ) { $customizer_config = raindrops_warehouse_clone( 'raindrops_article_title_css_class' ); if ( !empty( $customizer_config ) ) { return $class . ' ' . trim( $customizer_config ); } else { return $class; } } } if ( !function_exists( 'raindrops_customizer_hide_default_category' ) ) { /** * * @param type $css * @return type * @since 1.295 */ function raindrops_customizer_hide_default_category( $css ) { $permalink_structure = get_option( 'permalink_structure' ); $customizer_config = raindrops_warehouse_clone( 'raindrops_display_default_category' ); $css_rule_set = '.entry-meta a[href$="%1$s/"],.entry-meta a[href$="%1$s"]{display:none;}'; $css_rule_set .= '.author dd a[href$="%1$s/"],.author dd a[href$="%1$s"]{display:none;}'; if ( !empty( $permalink_structure ) && 'show' !== $customizer_config ) { $default_category_id = get_option( 'default_category' ); $default_category_info = get_category( $default_category_id ); $default_category_slug = $default_category_info->slug; $css_add = sprintf( $css_rule_set, $default_category_slug ); return $css . $css_add; } return $css; } } if ( !function_exists( 'raindrops_customizer_hide_post_author' ) ) { /** * * @param type $css * @return type * @since 1.295 */ function raindrops_customizer_hide_post_author( $css ) { $customizer_config = raindrops_warehouse_clone( 'raindrops_display_article_author' ); if ( 'hide' == $customizer_config ) { $css_add = '.posted-on .author a, .ported-on .posted-by-string, div[class^="entry-meta"] .author a, div[class^="entry-meta"] .posted-by-string{display:none;}'; return $css . $css_add; } return $css; } } if ( !function_exists( 'raindrops_customizer_hide_post_date' ) ) { /** * * @param type $css * @return type * @since 1.295 */ function raindrops_customizer_hide_post_date( $css ) { $customizer_config = raindrops_warehouse_clone( 'raindrops_display_article_publish_date' ); if ( 'hide' == $customizer_config ) { $css_add = '.posted-on .posted-on-string, .posted-on .entry-date, div[class^="entry-meta"] .posted-on-string, div[class^="entry-meta"] .entry-date{display:none;}'; $css_add .= '.author time.entry-date{display:none;}'; $css_add .= '.posted-on-after .posted-on-string, .posted-on-after .entry-date, div[class^="entry-meta"] .posted-on-string, div[class^="entry-meta"] .entry-date{display:none;}'; return $css . $css_add; } if ( 'emoji' == $customizer_config ) { $css_add = '.posted-on-after .posted-on-string, div[class^="entry-meta"] .posted-on-string, .posted-on .posted-on-string{display:none;}'; return $css . $css_add; } return $css; } } if ( !function_exists( 'raindrops_excerpt_length' ) ) { /** * * @param type $length * @return type * @since 1.296 */ function raindrops_excerpt_length( $length ) { return absint( raindrops_warehouse_clone( 'raindrops_excerpt_length' ) ); } } if ( !function_exists( 'raindrops_import_parent_theme_mods' ) ) { /** * * @global type $raindrops_setting_type * @global type $wp_customize * @return boolean * @since 1.297 */ function raindrops_import_parent_theme_mods() { global $raindrops_setting_type, $wp_customize; $oarent_slug = get_option( 'template' ); $child_slug = get_option( 'stylesheet' ); $mods = get_option( "theme_mods_$oarent_slug" ); if ( isset( $wp_customize ) && false !== $mods && false !== $child_slug && false !== $oarent_slug && is_child_theme() ) { if ( get_option( "mods_$child_slug" ) ) { delete_option( "mods_$child_slug" ); } if ( 'import' == get_theme_mod( "raindrops_parent_theme_mods" ) ) { set_theme_mod( "raindrops_parent_theme_mods", 'no' ); } if ( 'import' == raindrops_warehouse_clone( 'raindrops_parent_theme_mods' ) ) { raindrops_update_theme_option( 'raindrops_parent_theme_mods', 'no' ); } return update_option( "theme_mods_$child_slug", $mods ); } return false; } } if ( !function_exists( 'raindrops_press_this_add_class' ) ) { function raindrops_press_this_add_class( $return_value ) { if ( isset( $return_value[ "quote" ] ) ) { $return_value[ "quote" ] = str_replace( array( '\n". $return_value["link"] ."\n"; } return $return_value; } } if ( !function_exists( 'raindrops_recent_comments_avatar' ) ) { function raindrops_recent_comments_avatar( $return, $author, $comment_ID ) { global $raindrops_recent_comments_avatar; $core_avatar_setting = get_option( 'show_avatars' ); if ( false == $raindrops_recent_comments_avatar || empty( $core_avatar_setting ) || is_admin() ) { return $return; } /** * apply only widget */ if ( in_the_loop() ) { return $return; } $comment_object = get_comment( $comment_ID ); if ( isset( $comment_object ) ) { $email_address = $comment_object->comment_author_email; $default_avatar = get_option( 'avatar_default' ); $avatar = get_avatar( $email_address, 32, $default_avatar, $author ); return $avatar . $return; } return $return; } } if ( !function_exists( 'raindrops_content_shareing' ) ) { /** * * @global type $post * @global type $raindrops_allow_share_link * @global type $raindrops_share_link_image * @global type $is_gecko * @global type $is_IE * @param string $type * @param type $excerpt_length * @return text * @since 1.315 */ function raindrops_content_shareing( $type = '', $excerpt_length = 100 ) { global $post, $raindrops_allow_share_link, $raindrops_share_link_image, $is_gecko, $is_IE, $blog_id; $max_show_hedding_name_count = apply_filters( 'raindrops_content_shareing_hedding_count', 5 ); if ( false == $raindrops_allow_share_link ) { return; } if ( !isset( $post ) ) { return; } if ( isset( $raindrops_share_link_image ) && 'post_thumbnail' == $raindrops_share_link_image ) { $type = 'post_thumbnail'; } $site_icon = ''; $article = get_post( $post->ID ); $permalink = esc_url( get_permalink( $post->ID ) ) . '#'; $title = $article->post_title; $title = wp_kses( $title, array() ); $title = wptexturize( $title ); $title = str_replace( array( "'" ), array( ''' ), $title ); /* @1.403 */ $content = $article->post_content; $content = strip_shortcodes( $content ); preg_match_all( '/]*>(.*?)<\/h[1-6]>/', $content, $matches ); $content_result = ''; $matches = array_filter( $matches ); if ( !empty( $matches ) ) { foreach ( $matches[ 0 ] as $key => $val ) { if ( $key > $max_show_hedding_name_count - 1 ) { $content_result .= apply_filters( 'raindrops_content_shareing_more', '...' ); break; } $content_result .= str_replace( array( 'ID ) . '

      ' . $content_result . '

      '; $permalink = esc_url( get_permalink( $post->ID ) ); if ( isset( $blog_id ) && is_multisite() ) { $id = get_blog_option( $blog_id, 'site_icon' ); } else { $id = get_option( 'site_icon' ); } if ( isset( $id ) ) { $site_icon = wp_get_attachment_image( $id ); } $post_thumbnail = get_the_post_thumbnail( $post->ID ); if ( empty( $post_thumbnail ) ) { $post_thumbnail = $site_icon; } $additional_filter = apply_filters( 'raindrops_content_shareing', '' ); $style = apply_filters( 'raindrops_content_shareing_style', ".clip-link *{margin:0!important;padding:0!important;box-sizing:border-box;} .clip-link .quote-raindrops{background:#fff;color:#333;padding:.3em!important;font-size:16px;border:1px solid #ccc;overflow:hidden;} .clip-link .quote-raindrops{ position:static;min-width:0;} .clip-link .quote-raindrops ul{overflow:hidden;} .clip-link .quote-raindrops h3{background:#fff;color:#333;padding:0;margin:0;font-size:16px;display:inline-block;line-height:1.1;} .clip-link .quote-raindrops a{background:#fff;color:#666;padding:0;10px;font-size:16px;font-weight:700} .clip-link .quote-raindrops img{width:auto;height:65px;} .clip-link .quote-raindrops .first{ width:65px;height:65px;float:left;list-style:none;margin:0;} .clip-link .quote-raindrops .second{ margin-left:80px!important;display:block;list-style:none;} .clip-link .quote-raindrops .first:empty + .second{margin-left:0;display:block;list-style:none;} .clip-link .link-info:empty{display:none;} .clip-link .link-excerpt{font-size:1em;} .clip-link .titles span {padding:.2em .5em!important;border-bottom:1px solid #ccc;margin:.25em!important;display:inline-block;} @media (max-width: 640px) { .clip-link .quote-raindrops .second, .clip-link .quote-raindrops .first{ margin:0; float:none; width:auto; list-style:none; text-align:left; display:block; } .clip-link .quote-raindrops .first{ text-align:center; background:#ccc; } .clip-link .quote-raindrops .second{ margin:0!important; } }" ); $style = str_replace( array( "\t", "\r", "\n", " " ), array( '', ' ', '', ' ' ), $style ); if ( $is_gecko ) { $style = ''; $post_thumbnail = ''; $site_icon = ''; $html = '

      %4$s

      %5$s
      %6$s
      '; } else { $html = ''; } if ( 'post_thumbnail' == $type ) { return 'data:text/plain;charset=utf-8,' . sprintf( $html, $style, $post_thumbnail, $permalink, $title, $excerpt, $additional_filter ); } return 'data:text/plain;charset=utf-8,' . sprintf( $html, $style, $site_icon, $permalink, $title, $excerpt, $additional_filter ); } } if ( !function_exists( 'raindrops_localize_style_add' ) ) { /** * * @param type $style * @return array * @1.330 */ function raindrops_localize_style_add( $style ) { $locale = get_locale(); if ( false !== ( $url = raindrops_locate_url( 'fonts.css' ) ) ) { $style[] = $url; } if ( false !== ( $url = raindrops_locate_url( 'languages/css/' . $locale . '.css' ) ) ) { $style[] = $url; } return $style; } } if ( !function_exists( 'raindrops_archive_year_navigation' ) ) { /** * * @param type $echo * @return string * @since 1.335 */ function raindrops_archive_year_navigation( $echo = true ) { $html = '
    • %3$s%4$s
    • '; $result = ''; wp_reset_postdata(); if ( true !== $echo ) { return $result; } else { echo $result; } } } if ( !function_exists( 'raindrops_post_password_form_html5' ) ) { /** * * @global type $post * @param type $form * @return type * @since 1.336 */ function raindrops_post_password_form_html5( $form ) { global $post; $document_type = raindrops_warehouse_clone( 'raindrops_doc_type_settings' ); if ( 'html5' !== $document_type ) { return $form; } $label = 'pwbox-' . ( empty( $post->ID ) ? rand() : $post->ID ); $form = <<< POST_FORM

      %4\$s

      POST_FORM; $form = str_replace( array( "\n", "\r" ), '', $form ); $output = sprintf( $form, site_url( 'wp-login.php?action=postpass', 'login_post' ), $label, esc_html__( 'Password', 'raindrops' ), esc_attr__( 'This content is password protected. To view it please enter your password', 'raindrops' ), esc_attr__( 'Submit', 'raindrops' ) ); $output = apply_filters( 'raindrops_post_password_form_html5', $output ); return $output; } } if ( !function_exists( 'raindrops_color_pallet_tagcloud' ) ) { /** * * @global type $raindrops_tag_cloud_widget_presentation * @param type $css * @return type */ function raindrops_color_pallet_tagcloud( $css ) { global $raindrops_tag_cloud_widget_presentation, $raindrops_tag_cloud_widget_threshold_val; if ( false == $raindrops_tag_cloud_widget_presentation ) { return $css; } $raindrops_current_style_type = raindrops_warehouse_clone( 'raindrops_style_type' ); if ( 'dark' == $raindrops_current_style_type ) { $saturation_base = 80; $lightness_base = 60; } else { $saturation_base = 80; $lightness_base = 40; } $start_angle = 0; $result = ''; $count_sep = absint( $raindrops_tag_cloud_widget_threshold_val ); /** end config */ $taxonomies = array( 'post_tag' ); $args = array( 'orderby' => 'count', 'order' => 'DESC', ); $terms = get_terms( $taxonomies, $args ); if ( empty( $terms ) ) { return $css; } $count_terms = count( $terms ); $radian = 270 / $count_terms; if ( 'no' == raindrops_warehouse_clone( 'raindrops_color_coded_post_tag' ) ) { $flag = false; } else { $flag = true; } foreach ( $terms as $key => $term ) { $v = $key + 1; $hue = $start_angle + ( $radian * $v ); $saturation = $saturation_base . '%'; $lightness = $lightness_base . '%'; if ( $term->count > $count_sep ) { $result .= '.widget_tag_cloud .tagcloud .tag-link-' . $term->term_id . '{color:hsl(' . $hue . ',' . $saturation . ',' . $lightness . ');} '; if ( true == $flag ) { $result .= '.rd-tag-em .post-tag .tag-link-' . $term->term_id . '{background:hsla(' . $hue . ',' . $saturation . ',' . $lightness . ',0.3 );} '; $result .= '.rd-tag-em .tag-' . $term->term_id . '-wrapper .title:before{color:hsl(' . $hue . ',' . $saturation . ',' . $lightness . ');} '; } } else { $result .= '.widget_tag_cloud .tagcloud .tag-link-' . $term->term_id . '{display:none;} '; if ( true == $flag ) { $result .= '.rd-tag-em .post-tag .tag-link-' . $term->term_id . '{display:none;} '; } } } $result = raindrops_remove_spaces_from_css( $result ); return $css . apply_filters( 'raindrops_color_pallet_tagcloud', $result ); } } if ( !function_exists( 'raindrops_get_the_posted_in_category' ) ) { /** * * @global type $wp_rewrite * @param type $separator * @param type $parents * @param type $post_id * @return type * @since 1.337 */ function raindrops_get_the_posted_in_category( $separator = '', $parents = '', $post_id = false ) { global $wp_rewrite; if ( !is_object_in_taxonomy( get_post_type( $post_id ), 'category' ) ) { /** This filter is documented in wp-includes/category-template.php */ return apply_filters( 'the_category', '', $separator, $parents ); } $categories = get_the_category( $post_id ); if ( empty( $categories ) ) { /** This filter is documented in wp-includes/category-template.php */ return apply_filters( 'the_category', __( 'Uncategorized', 'raindrops' ), $separator, $parents ); } $rel = ( is_object( $wp_rewrite ) && $wp_rewrite->using_permalinks() ) ? 'rel="category tag"' : 'rel="category"'; $thelist = ''; if ( '' == $separator ) { $html = '
    • %3$s
    • '; $thelist .= '
        '; foreach ( $categories as $category ) { $thelist .= "\n\t"; $permalink = esc_url( get_category_link( $category->term_id ) ); $thelist .= sprintf( $html, $permalink, $rel, $category->name, $category->term_id ); } $thelist .= '
      '; } else { $i = 0; foreach ( $categories as $category ) { if ( 0 < $i ) $thelist .= $separator; $thelist .= '' . $category->name . ''; ++$i; } } return apply_filters( 'the_category', $thelist, $separator, $parents ); } } if ( !function_exists( 'raindrops_get_the_posted_in_tag' ) ) { /** * * @global type $post * @param type $before * @param type $sep * @param type $after * @return boolean * @since 1.337 */ function raindrops_get_the_posted_in_tag( $before = '', $sep = '', $after = '' ) { global $post; if ( !isset( $post ) ) { return; } $id = $post->ID; $taxonomy = 'post_tag'; $terms = get_the_terms( $id, $taxonomy ); if ( is_wp_error( $terms ) ) { return $terms; } if ( empty( $terms ) ) { return false; } $links = array(); foreach ( $terms as $term ) { $link = get_term_link( $term, $taxonomy ); if ( is_wp_error( $link ) ) { return $link; } $links[] = ''; } $term_links = apply_filters( "term_links-$taxonomy", $links ); $result = $before . join( $sep, $term_links ) . $after; return apply_filters( 'the_tags', $result, $before, $sep, $after, $id ); } } if ( !function_exists( 'raindrops_pdf_send_to_editor' ) ) { /** * * @param type $html * @param type $attachment_id * @param type $attachment * @return type * @1.343 */ function raindrops_pdf_send_to_editor( $html, $attachment_id, $attachment ) { $post = get_post( $attachment_id ); if ( substr( $post->post_mime_type, 0, 15 ) == 'application/pdf' ) { return str_replace( 'ID ) && false !== strpos( $content, 'raindrops_modal_fragment_id_automatic' ) ) { $modals = explode( '#raindrops_modal', $content ); $result = ''; foreach ( $modals as $key => $modal ) { $unique_id = 'modal_box_' . absint( $post->ID ) . '_' . absint( $key ); $flagment_link = esc_url( get_permalink( $post->ID ) . '#' . $unique_id ); $result .= str_replace( array( 'raindrops_modal_fragment_id_automatic', '_fragment_id_automatic', ), array( $unique_id, $flagment_link ), $modal ); } return $result; } return $content; } } if ( !function_exists( 'raindrops_widget_page_style' ) ) { /** * @since 1.405 */ function raindrops_widget_page_style() { $colors = raindrops_wp_admin_css_colors( 'colors' ); if ( isset( $colors[ 2 ] ) && !empty( $colors[ 2 ] ) ) { $background_theme = raindrops_header_image_filter_color_validate( $colors[ 2 ] ); } else { $background_theme = '#1abc9c'; } if ( isset( $colors[ 3 ] ) && !empty( $colors[ 3 ] ) ) { $background_addon = raindrops_header_image_filter_color_validate( $colors[ 3 ] ); } else { $background_addon = '#95a5a6'; } $custom_css = ".raindrops-widget-color-theme-excerpt,div[id*=\"_recent-post-groupby-cat-\"] h3, div[id*=\"_raindrops_pinup_entry_widget-\"] h3,div[id*=\"_raindrops_extend_archive_widget-\"] h3{ background: {$background_theme}; color: #000; }"; $custom_css .= ".raindrops-widget-color-addon-excerpt,div[id*=\"_tribe-events-list-widget-\"] h3, div[id*=\"_metaslider_widget-\"] h3,div[id*=\"_bcn_widget\"] h3{ background: {$background_addon}; color: #000; }"; $custom_css .= " .raindrops-widget-color-addon-excerpt,.raindrops-widget-color-theme-excerpt{ padding:1em; }"; $custom_css .= " #available-widgets-list div[id*=\"_tribe-events-list-widget-\"] h3,#available-widgets-list div[id*=\"_metaslider_widget-\"] h3, #available-widgets-list div[id*=\"_bcn_widget\"] h3,#available-widgets-list div[id*=\"_recent-post-groupby-cat-\"] h3, #available-widgets-list div[id*=\"_raindrops_pinup_entry_widget-\"] h3,#available-widgets-list div[id*=\"_raindrops_extend_archive_widget-\"] h3{ padding:5px; }"; wp_add_inline_style( 'widgets', $custom_css ); } } if ( !function_exists( 'raindrops_widget_style_description' ) ) { /** * @since 1.405 */ function raindrops_widget_style_description() { $html = '

      %1$s %2$s

      '; printf( $html, esc_html__( 'Theme Widget', 'raindrops' ), esc_html__( 'Add On Widget', 'raindrops' ) ); } } if ( !function_exists( 'raindrops_responsive_sidebar_switch' ) ) { /** * * @param type $items * @return wp_nav_menu_items * @1.410 */ function raindrops_responsive_sidebar_switch( $items ) { global $raindrops_current_column; $after = ''; $before = ''; $sidebar_position = raindrops_warehouse_clone( 'raindrops_col_width' ); $menu_text = esc_html__( 'Open', 'raindrops' ); $extra_sidebar_title = esc_html__( 'Extra Sidebar', 'raindrops' ); $default_sidebar_title = esc_html__( 'Main Sidebar', 'raindrops' ); $extra_sidebar_html = '
    • '; $default_sidebar_html = ''; if ( 2 < raindrops_get_column_count() ) { $after .= sprintf( $extra_sidebar_html, $extra_sidebar_title, $menu_text ); } if ( 't1' == $sidebar_position || 't2' == $sidebar_position || 't3' == $sidebar_position ) { $before .= sprintf( $default_sidebar_html, $default_sidebar_title, $menu_text ); } else { $after .= sprintf( $default_sidebar_html, $default_sidebar_title, $menu_text ); } return $before . $items . $after; } } if ( !function_exists( 'raindrops_get_column_count' ) ) { /** * * @global type $raindrops_current_column * @return columns count * @since 1.410 */ function raindrops_get_column_count() { global $raindrops_current_column; $column = 3; if ( false !== ($type = raindrops_has_indivisual_notation() ) ) { if ( isset( $type[ 'col' ] ) ) { $column = absint( $type[ 'col' ] ); } } else { if ( isset( $raindrops_current_column ) && !empty( $raindrops_current_column ) ) { $column = absint( $raindrops_current_column ); } } return $column; } } if ( !function_exists( 'raindrops_term_description' ) ) { /** * * @global type $raindrops_use_term_description * @param type $title * @since 1.410 */ function raindrops_term_description( $title ) { global $raindrops_use_term_description; if ( false == $raindrops_use_term_description ) { return; } $html = apply_filters( 'raindrops_term_description_html', '
      %1$s
      ' ); if ( is_category() ) { $description = apply_filters( 'raindrops_category_description', get_the_archive_description() ); if ( !empty( $description ) ) { printf( $html, $description, 'rd-category-description' ); } } if ( is_tag() ) { $description = apply_filters( 'raindrops_tag_description', tag_description() ); if ( !empty( $description ) ) { printf( $html, $description, 'rd-tag-description' ); } } } } if ( !function_exists( 'raindrops_xhtml_language_attributes' ) ) { /** * * @param type $lang_attr * @return type * @since 1.411 */ function raindrops_xhtml_language_attributes( $lang_attr, $doctype ) { if ( 'xhtml' == $doctype ) { $lang = get_bloginfo( 'language' ); return $lang_attr . " lang=\"$lang\""; } return $lang_attr; } } if ( !function_exists( 'raindrops_custom_image_send_to_editor' ) ) { /** * * @global type $raindrops_document_type * @param type $html * @return type * @since 1.411 */ function raindrops_custom_image_send_to_editor( $html ) { /** * html5 can not use indivisual values * change rel to class */ $html = preg_replace( '!\s*rel="([^"]+)"!', ' class="$1"', $html ); return $html; } } if ( !function_exists( 'raindrops_remove_itemprop_from_site_logo' ) ) { /** * This attribute needs Set width itemscope attribute, itemtype attribute. * Raindrops yet not support microdata * @param type $logo * @return type * @1.411 */ function raindrops_remove_itemprop_from_site_logo( $logo ) { $logo = preg_replace( '!itemprop="[^"]+"!', '', $logo ); return $logo; return $logo; } } if ( !function_exists( 'raindrops_remove_grabatar_srcset' ) ) { /** * Raindrops avatar size is only 1 size, no needs responsive image sizes * @param type $avatar * @return type * @1.411 */ function raindrops_remove_grabatar_srcset( $avatar ) { $avatar = preg_replace( "!srcset='[^']+'!", '', $avatar ); return $avatar; } } if ( !function_exists( 'raindrops_gettext_with_context' ) ) { /** * Raindrops Theme Support Document Type XHTML1.0 * Change reference to undeclared general entity raquo to numerical character references * for link elements feed titles * * @param string $translated * @param type $text * @param type $context * @param type $domain * @return string * @since 1.411 */ function raindrops_gettext_with_context( $translated, $text, $context, $domain ) { if ( '»' == $text ) { $translated = '»'; } return $translated; } } if ( !function_exists( 'raindrops_remove_sizes_attribute' ) ) { /** * link sizes attribute is not support yet all populer browser * * @param type $site_icon * @return type * @since 1.411 */ function raindrops_remove_sizes_attribute( $site_icon ) { $site_icon = preg_replace( '!sizes="[^"]+"!', '', $site_icon ); return $site_icon; } } if ( !function_exists( 'raindrops_current_post_hilight' ) ) { /** * * @global type $post * @global type $wp_styles * @since 1.413 */ function raindrops_current_post_hilight() { global $post, $wp_styles; if ( is_singular() ) { $current_url = get_permalink( $post->ID ); $inline_style = '.widget_recent_entries a[href="' . $current_url . '"]{background:rgba(127,127,127,.3);}'; wp_add_inline_style( 'style', $inline_style ); } if ( is_tag() ) { $id = get_queried_object_id(); $current_url = get_tag_link( $id ); $inline_style = '.widget_tag_cloud a[href="' . $current_url . '"]{background:rgba(127,127,127,.3);}'; wp_add_inline_style( 'style', $inline_style ); } if ( is_category() ) { $id = get_queried_object_id(); $current_url = get_tag_link( $id ); $inline_style = '.widget_recent-post-groupby-cat a[href="' . $current_url . '"] span{background:rgba(127,127,127,.3);}'; wp_add_inline_style( 'style', $inline_style ); } if ( is_date() && is_month() ) { $month = get_query_var( 'monthnum' ); $year = get_query_var( 'year' ); $current_url = get_month_link( $year, $month ); $inline_style = '.widget_archive a[href="' . $current_url . '"]{background:rgba(127,127,127,.3);}'; $inline_style .= '.raindrops-extend-archive li a[href="' . $current_url . '"]{background:rgba(127,127,127,.3);}'; wp_add_inline_style( 'style', $inline_style ); } } } if ( !function_exists( 'raindrops_archive_has_count' ) ) { /** * It does not work properly if you are displaying a plurality of archive widgets. * @return type * @since 1.415 */ function raindrops_archive_has_count() { $archive_widget = new WP_Widget_Archives(); $settings = $archive_widget->get_settings(); $settings = reset( $settings ); if ( isset( $settings[ 'count' ] ) ) { return (bool) $settings[ 'count' ]; } return false; } } if ( !function_exists( 'raindrops_color_pallet_category' ) ) { function raindrops_color_pallet_category( $css ) { global $raindrops_category_widget_presentation, $raindrops_category_widget_threshold_val; if ( false == $raindrops_category_widget_presentation ) { return $css; } if ( 'yes' !== raindrops_warehouse_clone( 'raindrops_color_coded_category' ) ) { return $css; } $raindrops_current_style_type = raindrops_warehouse_clone( 'raindrops_style_type' ); if ( 'dark' == $raindrops_current_style_type ) { $saturation_base = 80; $lightness_base = 60; } else { $saturation_base = 80; $lightness_base = 40; } $start_angle = 0; $result = ''; $count_sep = absint( $raindrops_category_widget_threshold_val ); /** end config */ $taxonomies = array( 'category' ); $args = array( 'orderby' => 'count', 'order' => 'DESC', 'hierarchical' => false, ); $terms = get_terms( $taxonomies, $args ); if ( empty( $terms ) ) { return $css; } $count_terms = count( $terms ); $radian = 270 / $count_terms; foreach ( $terms as $key => $term ) { $v = $key + 1; $hue = $start_angle + ( $radian * $v ); $saturation = $saturation_base . '%'; $lightness = $lightness_base . '%'; $alpha = 0.3; $alpha_b = $alpha * 2; if ( 0.6 < $alpha || $lightness_base <= 40 ) { $color = '#000'; } else { $color = '#fff'; } if ( $term->count > $count_sep ) { // for article extend color class $result .= '.rd-cat-em .cat-color-' . $term->term_id . ' {color:' . $color . ';background:hsla(' . $hue . ',' . $saturation . ',' . $lightness . ',' . $alpha . ');} '; $result .= '.rd-cat-em .cat-color-' . $term->term_id . ' a{color:' . $color . ';}'; // for article $result .= '.rd-cat-em .post .cat-item-' . $term->term_id . ' {background:hsla(' . $hue . ',' . $saturation . ',' . $lightness . ',' . $alpha . ');} '; // for sidebars $result .= '.rd-cat-em .yui-b .cat-item-' . $term->term_id . ':before{color:' . $color . ';background:hsla(' . $hue . ',' . $saturation . ',' . $lightness . ',' . $alpha_b . ');} '; $result .= '.rd-cat-em footer .cat-item-' . $term->term_id . ':before{color:' . $color . ';background:hsla(' . $hue . ',' . $saturation . ',' . $lightness . ',' . $alpha_b . ');} '; $result .= '.rd-cat-em footer .cat-item-' . $term->term_id . ' a{color:' . $color . ';}'; //for archive title before icon $result .= '.rd-cat-em .category-archives .cat-item-' . $term->term_id . '-wrapper .title:before{color:hsla(' . $hue . ',' . $saturation . ',' . $lightness . ',' . $alpha_b . ');} '; } else { $result .= 'rd-cat-em .cat-item.cat-item-' . $term->term_id . ' {display:none;} '; $result .= 'rd-cat-em .category-archives .cat-item.cat-item-' . $term->term_id . ' {display:none;} '; } } $result = raindrops_remove_spaces_from_css( $result ); return $css . apply_filters( 'raindrops_color_pallet_category', $result ); } } if ( !function_exists( 'raindrops_nextpage_tag_with_header_nav' ) ) { /** * * @global type $post * @global type $page * @return type * @since1.420 */ function raindrops_nextpage_tag_with_header_nav() { global $post, $page; $prev = ''; $next = ''; $current_page = 0; $count = 0; if ( isset( $page ) && isset( $post ) && preg_match_all( '##', $post->post_content, $result, PREG_SET_ORDER ) ) { $count = (int) count( $result ); $current_page = (int) $page; $link = get_permalink( $post->ID ); if ( $current_page <= $count ) { $next = esc_url( add_query_arg( 'page', $current_page + 1, $link ) ); } if ( $current_page > 2 ) { $prev = esc_url( add_query_arg( 'page', $current_page - 1, $link ) ); } elseif ( $current_page == 2 ) { $prev = esc_url( $link ); } } return array( 'prev' => $prev, 'next' => $next ); } } if ( !function_exists( 'raindrops_nextpage_tag_with_header_rel' ) ) { /** * * @param type $rel_prev * @return type * @since 1.420 */ function raindrops_nextpage_tag_with_header_rel( $rel_prev ) { $link = raindrops_nextpage_tag_with_header_nav(); $result_html = ''; $result = ''; if ( !empty( $link[ 'prev' ] ) ) { $result_html = sprintf( $result_html, $link[ 'prev' ] ); $result = apply_filters( 'raindrops_nextpage_tag_with_header_nav', $result_html . PHP_EOL, $link[ 'prev' ], $link[ 'next' ] ); } else { $result = $rel_prev; } $result_html = ''; if ( !empty( $link[ 'next' ] ) ) { $result_html = sprintf( $result_html, $link[ 'next' ] ); $result .= apply_filters( 'raindrops_nextpage_tag_with_header_nav', PHP_EOL . $result_html . PHP_EOL, $link[ 'prev' ], $link[ 'next' ] ); } if ( !empty( $result ) ) { return $result; } return $rel_prev; } } if ( !function_exists( 'raindrops_nextpage_tag_with_header_nav_helper' ) ) { /** * * @param type $rel_next * @return type * @since 1.420 */ function raindrops_nextpage_tag_with_header_nav_helper( $rel_next ) { $link = raindrops_nextpage_tag_with_header_nav(); if ( !empty( $link[ 'next' ] ) ) { return ''; } return $rel_next; } } if ( !function_exists( 'raindrops_remove_noteaser_link_scroll' ) ) { /** * * @global type $multipage * @global type $page * @global type $post * @param type $link * @return type * @1.423 */ function raindrops_remove_noteaser_link_scroll( $link ) { global $multipage, $page, $post; if ( false !== strpos( $post->post_content, '' ) && (!$multipage || $page == 1 ) ) { $link = preg_replace( '|#more-[0-9]+|', '', $link ); return $link; } return $link; } } /** * * * * @since 1.138 */ do_action( 'raindrops_last' );