';
printf( $html, 'headimg', 'top' );
$uploads = wp_upload_dir();
$header_image_uri = $uploads[ 'url' ] . '/' . raindrops_warehouse_clone( 'raindrops_header_image' );
$html = '
';
$exception_page_width = raindrops_warehouse_clone( 'raindrops_page_width' );
if ( 'doc3' == $exception_page_width ) {
/* doc3 fluid layout , image displayed shrink , expand */
$add_fluid_style = "";
$add_fluid_style_description_html = '
' . esc_html__( 'Current theme is fluid settings', 'Raindrops' ) . '
' . esc_html__( 'image size will be shrink to fit page', 'Raindrops' ) . '
';
$add_fluid_style_description_html .= '
' . esc_html__( 'Theme Settings', 'Raindrops' ) . ' ';
$add_fluid_style_description_html .= '
';
} else {
$add_fluid_style = "";
$add_fluid_style_description_html = '';
}
printf( $html, 'hd', raindrops_upload_image_parser( $header_image_uri, 'inline', '#hd' ) . $add_fluid_style );
/** Site description display position
*
*
* Site description diaplay at image when if header text Display Text value is yes.
* Site description diaplay at header bar when if header text Display Text value is no.
*
*
*/
if ( 'blank' == get_theme_mod( 'header_textcolor' ) || '' == get_theme_mod( 'header_textcolor' ) ) {
$raindrops_show_hide = '';
$style = ' style="display:none;"';
} elseif ( preg_match( "!([0-9a-f]{6}|[0-9a-f]{3})!si", get_header_textcolor() ) ) {
$style = ' style="color:#' . get_header_textcolor() . ';"';
$raindrops_show_hide = ' style="display:none;"';
} else {
$style = '';
$raindrops_show_hide = ' style="display:none;"';
}
/**
* Conditional Switch html headding element
*
*
*
*
*
*/
if ( is_home() || is_front_page() ) {
$heading_elememt = 'h1';
} else {
$heading_elememt = 'div';
}
$title_format = '<%s class="h1" id="site-title">
%s %s>';
printf( $title_format, $heading_elememt, home_url(), esc_attr( get_bloginfo( 'name', 'display' ) ), "home", get_bloginfo( 'name', 'display' ), $heading_elememt );
/**
* Site description diaplay at header bar when if header text Display Text value is no.
*
*
*
*
*/
$raindrops_site_desctiption_html = '
%s
';
printf( $raindrops_site_desctiption_html, $raindrops_show_hide, get_bloginfo( 'description' ) );
/**
* header image
*
*
*
*
*
*/
echo raindrops_header_image();
echo $add_fluid_style_description_html;
}
}
/**
* 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;
}
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 = 'Article';
} 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 = ' to entry';
} else {
$add_label = '';
}
$format_label = 'Post Format ' . esc_attr( $format ) . $add_label;
}
if ( empty( $title ) ) {
$html = '
';
return $html;
}
}
if ( isset( $post->ID ) && $raindrops_link_unique_text == true ) {
$title = $title. raindrops_unique_entry_title( $post->ID );
}
return apply_filters( 'raindrops_fallback_title', $title );
}
}
/**
*
*
*
* @since 1.139
*/
///////////////////////////////////test
if ( !function_exists( 'raindrops_detect_header_image_size' ) ) {
function raindrops_detect_header_image_size( $xy = 'width' ) {
global $raindrops_custom_header_args;
$all_header_images = array();
$header_image = get_custom_header();
$header_image_uri = $header_image->url;
$header_image_basename = basename( $header_image_uri );
if ( $raindrops_custom_header_args[ "default-image" ] == $header_image_uri ) {
if ( 'width' == $xy ) {
return $raindrops_custom_header_args[ "width" ];
} elseif ( 'height' == $xy ) {
return $raindrops_custom_header_args[ "height" ];
}
}
$all_header_images = get_uploaded_header_images();
if ( 'width' == $xy ) {
if ( isset( $all_header_images[ $header_image_basename ][ 'width' ] ) ) {
return $all_header_images[ $header_image_basename ][ 'width' ];
} else {
return $header_image->width;
}
} elseif ( 'height' == $xy ) {
if ( isset( $all_header_images[ $header_image_basename ][ 'height' ] ) ) {
return $all_header_images[ $header_image_basename ][ 'height' ];
} else {
return $header_image->height;
}
}
return false;
}
}
/**
* 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
*/
if ( !function_exists( 'raindrops_header_image' ) ) {
function raindrops_header_image( $type = 'default', $args = array() ) {
global $raindrops_page_width, $post;
$raindrops_document_width = $raindrops_page_width;
$raindrops_header_image = get_custom_header();
$raindrops_header_image_uri = $raindrops_header_image->url;
$raindrops_header_image_width = raindrops_detect_header_image_size( 'width' );
$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;
}
$text_attr = ' style="color:#' . esc_attr( get_theme_mod( 'header_textcolor' ) ) . ';' . esc_attr( $add_style ) . '" ' . esc_html( $add_class );
$text_attr = apply_filters( 'raindrops_header_image_description_attr', $text_attr );
}
if ( 'doc3' == Raindrops_warehouse_clone( "raindrops_page_width" ) ) {
$width = 'width:100%';
} else {
$width = 'width:' . $raindrops_document_width . 'px';
}
if ( $type == 'default' || !isset( $type ) ) {
$html = '
';
$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 ) {
$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-image:url( ' . esc_url( $img ) . ' );' ), 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' ) ) {
$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 )] [h1|div]>
*/
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' );
if ( 'blank' == $header_text_color || '' == $header_text_color ) {
$hd_style = '';
} else {
$hd_style = ' style="color:#' . $header_text_color . ';"';
}
$title_format = '<%1$s class="%6$s" id="site-title">
%5$s %1$s>';
$html = sprintf( $title_format,
$heading_elememt,
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' )
);
return apply_filters( "raindrops_site_title", $html );
}
}
/**
* filter function for wp_title hook
* element title
*/
if ( !function_exists( 'raindrops_filter_title' ) ) {
function raindrops_filter_title( $title, $sep = true, $seplocation = 'right' ) {
global $page, $paged;
$page_info = '';
$add_title = array();
$site_description = get_bloginfo( 'description', 'display' );
if ( !empty( $title ) ) {
$add_title[] = str_replace( $sep, '', $title );
}
$add_title[] = get_bloginfo( 'name' );
if ( !empty( $site_description ) && ( is_home() || is_front_page() ) ) {
$add_title[] = $site_description;
}
// Add a page number
if ( $paged > 1 || $page > 1 ) {
$page_info = sprintf( esc_html__( ' Page %s', 'Raindrops' ), max( $paged, $page ) );
}
if ( 'right' == $seplocation ) {
$add_title = array_reverse( $add_title );
$title = implode( " $sep ", $add_title ) . $page_info;
} else {
$title = implode( " $sep ", $add_title ) . $page_info;
}
return $title;
}
}
/**
*
*
*
*
*
*/
if ( !function_exists( "raindrops_show_one_column" ) ) {
function raindrops_show_one_column() {
global $post;
if ( isset( $post ) ) {
$raindrops_content_check = get_post( $post->ID );
$raindrops_content_check = $raindrops_content_check->post_content;
if ( preg_match( "!\[raindrops[^\]]+(col)=(\"|')*?([^\"' ]+)(\"|')*?[^\]]*\]!si", $raindrops_content_check, $regs ) ) {
return $regs[ 3 ];
} else {
return false;
}
} elseif ( 'hide' == Raindrops_warehouse_clone( 'raindrops_show_right_sidebar' ) ) {
return 2;
} elseif ( 'show' == Raindrops_warehouse_clone( 'raindrops_show_right_sidebar' ) ) {
return 3;
}
}
}
/**
*
*
*
*
*
*/
if ( !function_exists( "raindrops_color_type_custom" ) ) {
function raindrops_color_type_custom( $css ) {
global $post;
if ( isset( $post ) && is_singular() ) {
$raindrops_content_check = get_post( $post->ID );
$raindrops_content_check = $raindrops_content_check->post_content;
if ( preg_match( "!\[raindrops[^\]]+(color_type)=(\"|')*?([^\"' ]+)(\"|')*?[^\]]*\]!si", $raindrops_content_check, $regs ) ) {
$color_type = trim( $regs[ 3 ] );
return raindrops_design_output( $color_type ) . raindrops_color_base();
} else {
return $css;
}
}elseif( intval( get_query_var( 'raindrops_color_type' ) ) == 1 && $post_id = get_query_var( 'p' ) ) {
//&& $raindrops_new_style_load == true
$raindrops_content_check = get_post( $post_id );
$raindrops_content_check = $raindrops_content_check->post_content;
if ( preg_match( "!\[raindrops[^\]]+(color_type)=(\"|')*?([^\"' ]+)(\"|')*?[^\]]*\]!si", $raindrops_content_check, $regs ) ) {
$color_type = trim( $regs[ 3 ] );
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, $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' );
}
}
}
//add_filter( 'the_content', 'raindrops_fallback_human_interface' );
//add_filter( 'raindrops_posted_in', 'raindrops_fallback_human_interface' );
/**
*
*
*
*
* @since 0.958
*/
if ( !function_exists( "raindrops_fallback_human_interface" ) ) {
function raindrops_fallback_human_interface( $content ) {
if ( ( is_home() || is_front_page() ) && true == small_screen_check() ) {
return;
} else {
return $content;
}
}
}
/**
*
*
*
*
* @since 0.958
*/
if ( !function_exists( "small_screen_check" ) ) {
function small_screen_check() {
global $raindrops_fluid_minimum_width, $raindrops_fallback_human_interface_show;
$size = '';
if ( isset( $_SERVER[ 'HTTP_UA_PIXELS' ] ) && !empty( $_SERVER[ 'HTTP_UA_PIXELS' ] ) ) {
$size = $_SERVER[ 'HTTP_UA_PIXELS' ];
}
if ( isset( $_SERVER[ 'HTTP_X_UP_DEVCAP_SCREENPIXELS' ] ) && !empty( $_SERVER[ 'HTTP_X_UP_DEVCAP_SCREENPIXELS' ] ) ) {
$size = $_SERVER[ 'HTTP_X_UP_DEVCAP_SCREENPIXELS' ];
}
if ( isset( $_SERVER[ 'HTTP_X_JPHONE_DISPLAY' ] ) && !empty( $_SERVER[ 'HTTP_X_JPHONE_DISPLAY' ] ) ) {
$size = $_SERVER[ 'HTTP_X_JPHONE_DISPLAY' ];
}
$size = preg_split( '[x,*]', $size );
if ( true == $raindrops_fallback_human_interface_show ) {
return true;
}
if ( isset( $size[ 0 ] ) && is_numeric( $size[ 0 ] ) ) {
if ( $size[ 0 ] < $raindrops_fluid_minimum_width ) {
return true;
} else {
return false;
}
}
return false;
}
}
/**
*
*
*
*
* @since 0.958
*/
if ( !function_exists( "raindrops_fallback_user_interface_view" ) ) {
function raindrops_fallback_user_interface_view() {
global $raindrops_current_theme_name, $raindrops_current_data_version;
wp_deregister_style( 'style' );
wp_deregister_style( 'raindrops_reset_fonts_grids' );
wp_deregister_style( 'raindrops_grids' );
wp_deregister_style( 'raindrops_fonts' );
wp_deregister_style( 'raindrops_css3' );
wp_deregister_style( 'child' );
$current_theme = $raindrops_current_theme_name;
$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' );
add_filter( 'raindrops_indv_css', '__return_false' );
add_filter( 'raindrops_is_fluid', '__return_false' );
add_filter( 'raindrops_is_fixed', '__return_false' );
add_filter( 'raindrops_embed_meta_css', '__return_false' );
}
if ( small_screen_check() == true ) {
add_action( 'wp_print_styles', 'raindrops_fallback_user_interface_view', 99 );
add_action( 'wp_head', 'raindrops_mobile_meta' );
}
}
/**
*
*
*
*
*/
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_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 = raindrops_detect_header_image_size( 'width' );
$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 = $display_header_image_attr[ 0 ];
$raindrops_header_image_width = $display_header_image_attr[ 1 ];
$raindrops_header_image_height = $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;
}
if ( is_single() || is_page() ) {
$color_type = '';
$raindrops_content_check = get_post( $post->ID );
$raindrops_content_check = $raindrops_content_check->post_content;
if ( preg_match( "!\[raindrops[^\]]+(color_type)=(\"|')*?([^\"' ]+)(\"|' )*?[^\]]*\]!si", $raindrops_content_check, $regs ) ) {
$color_type = "rd-type-" . trim( $regs[ 3 ] );
}
if ( preg_match( "!\[raindrops[^\]]+(col)=(\"|')*?([^\"' ]+)(\"|')*?[^\]]*\]!si", $raindrops_content_check, $regs ) ) {
$color_type .= ' ';
$color_type .= "rd-col-" . $regs[ 3 ];
}
} else {
$raindrops_options = get_option( "raindrops_theme_settings" );
if ( isset( $raindrops_options[ "raindrops_style_type" ] ) && !empty( $raindrops_options[ "raindrops_style_type" ] ) ) {
}
}
$color_type = '';
if ( isset( $post->ID ) ) {
$raindrops_content_check = get_post( $post->ID );
}
if ( isset( $raindrops_content_check ) ) {
$raindrops_content_check = $raindrops_content_check->post_content;
if ( preg_match( "!\[raindrops[^\]]+(color_type)=(\"|')*?([^\"' ]+)(\"|' )*?[^\]]*\]!si", $raindrops_content_check, $regs ) && is_singular() ) {
$color_type = "rd-type-" . trim( $regs[ 3 ] );
}
if ( preg_match( "!\[raindrops[^\]]+(col)=(\"|')*?([^\"' ]+)(\"|')*?[^\]]*\]!si", $raindrops_content_check, $regs ) && is_singular() ) {
$color_type .= ' ';
$color_type .= "rd-col-" . $regs[ 3 ];
}
} else {
$raindrops_options = get_option( "raindrops_theme_settings" );
if ( isset( $raindrops_options[ "raindrops_style_type" ] ) && !empty( $raindrops_options[ "raindrops_style_type" ] ) ) {
$color_type = "rd-type-" . $raindrops_options[ "raindrops_style_type" ];
}
}
$raindrops_page_width = raindrops_warehouse_clone( 'raindrops_page_width' );
wp_enqueue_script( 'raindrops_helper_script', get_template_directory_uri() . '/raindrops-helper.js', 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;
}
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 ,
'post' => $post,
'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 ),
'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' ),
)
);
}
}
/**
*
*
*
*
*
*/
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;
return "/* test: $c_width */";
$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 $is_IE, $raindrops_fluid_minimum_width, $raindrops_fluid_maximum_width;
$width = intval( $raindrops_fluid_minimum_width );
$extra_sidebar_width = raindrops_warehouse_clone( 'raindrops_right_sidebar_width_percent' );
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;
}
$fluid_width = '/* raindrops is fluid start */' .
"\n#doc3{min-width:" . $raindrops_fluid_minimum_width . 'px;max-width:' . $raindrops_fluid_maximum_width . 'px;}' . "\n#container > .first{width:" . $main_column_width_fluid . "%;}" . "\n#access{min-width:" . $raindrops_fluid_minimum_width . 'px;}'."\n".'/* raindrops is fluid end */';
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() {
$raindrops_gallerys = raindrops_gallerys_clone();
if ( WP_DEBUG !== true ) {
$raindrops_gallerys = str_replace( array( "\n", "\r", "\t", '"', '--', '\"' ),
array( "", "", "", '"', '', '"' ),
$raindrops_gallerys );
}
return apply_filters( "raindrops_gallerys_css", $raindrops_gallerys );
}
}
/**
*
*
*
*
* @since 0.965
*/
add_action( 'customize_register', 'raindrops_customize_register' );
/**
*
*
*
*
*/
if ( !function_exists( 'raindrops_customize_register' ) ) {
function raindrops_customize_register( $wp_customize ) {
global $raindrops_current_theme_name, $raindrops_base_setting_args, $raindrops_base_font_size;
$raindrops_theme_name = wp_get_theme();
$wp_customize->add_section( 'raindrops_theme_settings', array( 'title' => esc_html__( 'Color Scheme', 'Raindrops' ), 'priority' => 26, ) );
$wp_customize->add_section( 'raindrops_theme_settings_sidebar', array( 'title' => esc_html__( 'Sidebars', 'Raindrops' ), 'priority' => 27, ) );
$wp_customize->add_section( 'raindrops_theme_settings_fonts', array( 'title' => esc_html__( 'Fonts', 'Raindrops' ), 'priority' => 28, ) );
$wp_customize->add_section( 'raindrops_theme_settings_document', array( 'title' => esc_html__( 'Document', 'Raindrops' ), 'priority' => 25, ) );
$wp_customize->add_section( 'raindrops_theme_settings_content', array( 'title' => esc_html__( 'Post Content Types', 'Raindrops' ), 'priority' => 29, ) );
$wp_customize->add_section( 'raindrops_theme_settings_plugins', array( 'title' => esc_html__( 'Recommend Plugins Presentation', 'Raindrops' ), 'priority' => 30, ) );
$wp_customize->add_section( 'raindrops_theme_settings_uninstall', array( 'title' => esc_html__( 'Uninstall Option', 'Raindrops' ), 'priority' => 99, ) );
$wp_customize->add_setting( 'raindrops_theme_settings[raindrops_style_type]', array( 'default' => raindrops_warehouse_clone( 'raindrops_style_type' ), 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'raindrops_style_type_validate' ) );
$wp_customize->add_setting( 'raindrops_theme_settings[raindrops_page_width]', array( 'default' => raindrops_warehouse_clone( 'raindrops_page_width' ), 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'raindrops_page_width_validate' ) );
$wp_customize->add_setting( 'raindrops_theme_settings[raindrops_base_color]', array( 'default' => raindrops_warehouse_clone( 'raindrops_base_color' ), 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'raindrops_base_color_validate' ) );
$wp_customize->add_setting( 'raindrops_theme_settings[raindrops_show_right_sidebar]', array( 'default' => raindrops_warehouse_clone( 'raindrops_show_right_sidebar' ), 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'raindrops_show_right_sidebar_validate' ) );
$wp_customize->add_setting( 'raindrops_theme_settings[raindrops_col_width]', array( 'default' => raindrops_warehouse_clone( 'raindrops_col_width' ), 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'raindrops_col_width_validate' ) );
$wp_customize->add_setting( 'raindrops_theme_settings[raindrops_show_menu_primary]', array( 'default' => raindrops_warehouse_clone( 'raindrops_show_menu_primary' ), 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'raindrops_show_menu_primary_validate' ) );
$wp_customize->add_setting( 'raindrops_theme_settings[raindrops_default_fonts_color]', array( 'default' => '', 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'raindrops_default_fonts_color_validate' ) );
$wp_customize->add_setting( 'raindrops_theme_settings[raindrops_hyperlink_color]', array( 'default' => '', 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'raindrops_hyperlink_color_validate' ) );
$wp_customize->add_setting( 'raindrops_theme_settings[raindrops_complementary_color_for_title_link]', array( 'default' => raindrops_warehouse_clone( 'raindrops_complementary_color_for_title_link' ),
'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'raindrops_complementary_color_for_title_link_validate' ) );
$wp_customize->add_setting( 'raindrops_theme_settings[raindrops_doc_type_settings]', array( 'default' => raindrops_warehouse_clone( 'raindrops_doc_type_settings' ), 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'raindrops_doc_type_settings_validate' ) );
$wp_customize->add_setting( 'raindrops_theme_settings[raindrops_footer_color]', array( 'default' => raindrops_warehouse_clone( 'raindrops_footer_color' ), 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'raindrops_footer_color_validate' ) );
$wp_customize->add_setting( 'raindrops_theme_settings[raindrops_accessibility_settings]', array( 'default' => raindrops_warehouse_clone( 'raindrops_accessibility_settings' ), 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'raindrops_accessibility_settings_validate' ) );
$wp_customize->add_setting( 'raindrops_theme_settings[raindrops_plugin_presentation_bcn_nav_menu]',
array( 'default' => raindrops_warehouse_clone( 'raindrops_plugin_presentation_bcn_nav_menu' ),
'type' => 'option', 'capability' => 'edit_theme_options',
'sanitize_callback' => 'raindrops_plugin_presentation_bcn_nav_menu_validate'
) );
$wp_customize->add_setting( 'raindrops_theme_settings[raindrops_plugin_presentation_wp_pagenav]',
array( 'default' => raindrops_warehouse_clone( 'raindrops_plugin_presentation_wp_pagenav' ),
'type' => 'option', 'capability' => 'edit_theme_options',
'sanitize_callback' => 'raindrops_plugin_presentation_wp_pagenav_validate'
) );
$wp_customize->add_setting( 'raindrops_theme_settings[raindrops_plugin_presentation_meta_slider]',
array( 'default' => raindrops_warehouse_clone( 'raindrops_plugin_presentation_meta_slider' ),
'type' => 'option', 'capability' => 'edit_theme_options',
'sanitize_callback' => 'raindrops_plugin_presentation_meta_slider_validate'
) );
$wp_customize->add_setting( 'raindrops_theme_settings[raindrops_plugin_presentation_the_events_calendar]',
array( 'default' => raindrops_warehouse_clone( 'raindrops_plugin_presentation_the_events_calendar' ),
'type' => 'option', 'capability' => 'edit_theme_options',
'sanitize_callback' => 'raindrops_plugin_presentation_the_events_calendar_validate'
) );
if ( RAINDROPS_USE_LIST_EXCERPT !== false ) {
$wp_customize->add_setting( 'raindrops_theme_settings[raindrops_entry_content_is_home]', array( 'default' => raindrops_warehouse_clone( 'raindrops_entry_content_is_home' ), 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'raindrops_entry_content_is_home_validate' ) );
//$wp_customize->add_setting( 'raindrops_theme_settings[raindrops_entry_content_is_category]', array( 'default' => raindrops_warehouse_clone( 'raindrops_entry_content_is_category' ), 'type' => 'option', 'capability' => 'edit_theme_options', ) );
$wp_customize->add_setting( 'raindrops_theme_settings[raindrops_entry_content_is_category]', array( 'default' => raindrops_warehouse_clone( 'raindrops_entry_content_is_category' ), 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'raindrops_entry_content_is_category_validate' ) );
//$wp_customize->add_setting( 'raindrops_theme_settings[raindrops_entry_content_is_search]', array( 'default' => raindrops_warehouse_clone( 'raindrops_entry_content_is_search' ), 'type' => 'option', 'capability' => 'edit_theme_options', ) );
$wp_customize->add_setting( 'raindrops_theme_settings[raindrops_entry_content_is_search]', array( 'default' => raindrops_warehouse_clone( 'raindrops_entry_content_is_search' ), 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'raindrops_entry_content_is_search_validate' ) );
}
//$wp_customize->add_setting( 'raindrops_theme_settings[raindrops_footer_link_color]', array( 'default' => raindrops_warehouse_clone( 'raindrops_footer_link_color' ), 'type' => 'option', 'capability' => 'edit_theme_options', ) );
$wp_customize->add_setting( 'raindrops_theme_settings[raindrops_footer_link_color]', array( 'default' => raindrops_warehouse_clone( 'raindrops_footer_link_color' ), 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'raindrops_footer_link_color_validate' ) );
$raindrops_font_max_size = 20;
if ( isset( $raindrops_base_font_size ) ) {
$raindrops_basefont_default_val = absint( $raindrops_base_font_size );
$raindrops_basefont_size = array();
for ( $i = $raindrops_basefont_default_val; $i < $raindrops_font_max_size + 1; $i++ ) {
$font_size_key = "{$i}px";
$raindrops_basefont_size[ $font_size_key ] = $i;
}
} else {
$raindrops_basefont_default_val = raindrops_warehouse_clone( 'raindrops_basefont_settings' );
$raindrops_basefont_size = array();
for ( $i = 13; $i < $raindrops_font_max_size + 1; $i++ ) {
$font_size_key = "{$i}px";
$raindrops_basefont_size[ $font_size_key ] = $i;
}
}
$raindrops_style_type_choices = raindrops_register_styles( "w3standard" );
$raindrops_col_width = array( esc_html__( "left 160px", 'Raindrops' ) => "t1", esc_html__( "left 180px", 'Raindrops' ) => "t2", esc_html__( "left 300px", 'Raindrops' ) => "t3", esc_html__( "right 180px", 'Raindrops' ) => "t4", esc_html__( "right 240px", 'Raindrops' ) => "t5", esc_html__( "right 300px", 'Raindrops' ) => "t6" );
$raindrops_extra_col_width = array( esc_html__( "25%", 'Raindrops' ) => "25", esc_html__( "33%", 'Raindrops' ) => "33", esc_html__( "50%", 'Raindrops' ) => "50", esc_html__( "66%", 'Raindrops' ) => "66", esc_html__( "75%", 'Raindrops' ) => "75" );
$wp_customize->add_setting( 'raindrops_theme_settings[raindrops_basefont_settings]', array( 'default' => $raindrops_basefont_default_val, 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'raindrops_basefont_settings_validate' ) );
$wp_customize->add_setting( 'raindrops_theme_settings[raindrops_right_sidebar_width_percent]', array( 'default' => raindrops_warehouse_clone( 'raindrops_right_sidebar_width_percent' ), 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'raindrops_right_sidebar_width_percent_validate' ) );
$wp_customize->add_setting( 'raindrops_theme_settings[raindrops_fluid_max_width]', array( 'default' => raindrops_warehouse_clone( 'raindrops_fluid_max_width' ), 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'raindrops_fluid_max_width_validate' ) );
$wp_customize->add_setting( 'raindrops_theme_settings[raindrops_disable_keyboard_focus]',
array( 'default' => raindrops_warehouse_clone( 'raindrops_disable_keyboard_focus' ),
'type' => 'option',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'raindrops_disable_keyboard_focus_validate' ) );
$wp_customize->add_setting( 'raindrops_theme_settings[raindrops_sync_style_for_tinymce]',
array( 'default' => raindrops_warehouse_clone( 'raindrops_sync_style_for_tinymce' ),
'type' => 'option',
'capability' => 'edit_theme_options', 'sanitize_callback' => 'raindrops_sync_style_for_tinymce_validate'
)
);
$wp_customize->add_setting( 'raindrops_theme_settings[raindrops_uninstall_option]',
array( 'default' => raindrops_warehouse_clone( 'raindrops_uninstall_option' ),
'type' => 'option',
'capability' => 'edit_theme_options', 'sanitize_callback' => 'raindrops_uninstall_option_validate'
)
);
$wp_customize->add_setting( 'raindrops_theme_settings[raindrops_menu_primary_font_size]',
array( 'default' => raindrops_warehouse_clone( 'raindrops_menu_primary_font_size' ),
'type' => 'option',
'capability' => 'edit_theme_options', 'sanitize_callback' => 'raindrops_menu_primary_font_size_validate'
)
);
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'raindrops_base_color', array( 'label' => esc_html__( 'Base color', 'Raindrops' ), 'section' => 'raindrops_theme_settings', 'settings' => 'raindrops_theme_settings[raindrops_base_color]' ) ) );
$wp_customize->add_control( 'raindrops_style_type', array( 'label' => esc_html__( 'Color Type', 'Raindrops' ), 'section' => 'raindrops_theme_settings', 'settings' => 'raindrops_theme_settings[raindrops_style_type]', 'type' => 'radio', 'choices' => $raindrops_style_type_choices, ) );
$wp_customize->add_control( 'raindrops_doc_type_settings', array( 'label' => esc_html__( 'Document Type Definition', 'Raindrops' ), 'section' => 'raindrops_theme_settings_document', 'settings' => 'raindrops_theme_settings[raindrops_doc_type_settings]', 'type' => 'radio', 'choices' => array( 'html5' => 'HTML5', 'xhtml' => 'XHTML1.0', ), ) );
$wp_customize->add_control( 'raindrops_accessibility_settings', array( 'label' => esc_html__( 'Force Unique Link Text', 'Raindrops' ), 'section' => 'raindrops_theme_settings_document', 'settings' => 'raindrops_theme_settings[raindrops_accessibility_settings]', 'type' => 'radio', 'choices' => array( 'no' => 'No', 'yes' => 'Yes', ), ) );
$wp_customize->add_control( 'raindrops_page_width', array( 'label' => esc_html__( 'Document Width', 'Raindrops' ), 'section' => 'raindrops_theme_settings_document', 'settings' => 'raindrops_theme_settings[raindrops_page_width]', 'type' => 'radio', 'choices' => array( 'doc' => esc_html__( '750px Fixed Layout', 'Raindrops' ), 'doc2' => esc_html__( '950px Fixed Layout', 'Raindrops' ), 'doc3' => esc_html__( 'Fluid Responsive Layout', 'Raindrops' ), 'doc4' => esc_html( '974px Fixed Layout', 'Raindrops' ), ), ) );
$wp_customize->add_control( 'raindrops_col_width',
array( 'label' => esc_html__( 'Default Sidebar', 'Raindrops' ),
'section' => 'raindrops_theme_settings_sidebar',
'settings' => 'raindrops_theme_settings[raindrops_col_width]',
'type' => 'radio',
'choices' => array_flip( $raindrops_col_width
),
) );
$wp_customize->add_control( 'raindrops_disable_keyboard_focus',
array( 'label' => esc_html__( 'Disable Keyboad Focus', 'Raindrops' ),
'section' => 'raindrops_theme_settings_document',
'settings' => 'raindrops_theme_settings[raindrops_disable_keyboard_focus]',
'type' => 'radio',
'choices' => array(
'disable' => esc_html__( 'Disable', 'Raindrops' ),
'enable' => esc_html__( 'Enable', 'Raindrops' ),
),
) );
$wp_customize->add_control( 'raindrops_show_right_sidebar', array( 'label' => esc_html__( 'Display Extra Sidebar', 'Raindrops' ),
'section' => 'raindrops_theme_settings_sidebar',
'settings' => 'raindrops_theme_settings[raindrops_show_right_sidebar]',
'type' => 'radio', 'choices' => array( 'show' => esc_html__( 'Show', 'Raindrops' ), 'hide' => esc_html__( 'Hide', 'Raindrops' ), ), ) );
$wp_customize->add_control( 'raindrops_right_sidebar_width_percent', array( 'label' => esc_html__( 'Extra Sidebar Width', 'Raindrops' ),
'section' => 'raindrops_theme_settings_sidebar',
'settings' => 'raindrops_theme_settings[raindrops_right_sidebar_width_percent]',
'type' => 'radio',
'choices' => array_flip( $raindrops_extra_col_width ), ) );
$wp_customize->add_control( 'raindrops_show_menu_primary', array( 'label' => esc_html__( 'Display hide', 'Raindrops' ), 'section' => 'nav', 'settings' => 'raindrops_theme_settings[raindrops_show_menu_primary]', 'type' => 'radio', 'choices' => array( 'show' => 'Show', 'hide' => 'Hide', ), ) );
$wp_customize->add_control( 'raindrops_fluid_max_width', array( 'label' => esc_html__( 'Fluid Max Width (px)', 'Raindrops' ), 'section' => 'raindrops_theme_settings_document', 'settings' => 'raindrops_theme_settings[raindrops_fluid_max_width]', 'type' => 'text', ) );
if ( RAINDROPS_USE_LIST_EXCERPT !== false ) {
$wp_customize->add_control( 'raindrops_entry_content_is_home', array( 'label' => esc_html__( 'Home Listed Entry Contents', 'Raindrops' ), 'section' => 'raindrops_theme_settings_content', 'settings' => 'raindrops_theme_settings[raindrops_entry_content_is_home]', 'type' => 'radio', 'choices' => array( 'content' => esc_html__( 'Show Content', 'Raindrops' ), 'excerpt' => esc_html__( 'Show Excerpt', 'Raindrops' ), 'none' => esc_html__( 'Hide', 'Raindrops' ), ) ) );
$wp_customize->add_control( 'raindrops_entry_content_is_category', array( 'label' => esc_html__( 'Category Archives Entry Contents', 'Raindrops' ), 'section' => 'raindrops_theme_settings_content', 'settings' => 'raindrops_theme_settings[raindrops_entry_content_is_category]', 'type' => 'radio', 'choices' => array( 'content' => esc_html__( 'Show Content', 'Raindrops' ), 'excerpt' => esc_html__( 'Show Excerpt', 'Raindrops' ), 'none' => esc_html__( 'Hide', 'Raindrops' ), ) ) );
$wp_customize->add_control( 'raindrops_entry_content_is_search', array( 'label' => esc_html__( 'Search Result Entry Contents', 'Raindrops' ), 'section' => 'raindrops_theme_settings_content', 'settings' => 'raindrops_theme_settings[raindrops_entry_content_is_search]', 'type' => 'radio', 'choices' => array( 'content' => esc_html__( 'Show Content', 'Raindrops' ), 'excerpt' => esc_html__( 'Show Excerpt', 'Raindrops' ), 'none' => esc_html__( 'Hide', 'Raindrops' ), ) ) );
}
/*
* font color
*/
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'raindrops_default_fonts_color2', array( 'label' => esc_html__( 'Font Color', 'Raindrops' ), 'section' => 'colors', 'settings' => 'raindrops_theme_settings[raindrops_default_fonts_color]' ) ) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'raindrops_footer_color2', array( 'label' => esc_html__( 'Footer Font Color', 'Raindrops' ), 'section' => 'colors', 'settings' => 'raindrops_theme_settings[raindrops_footer_color]' ) ) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'raindrops_footer_link_color2', array( 'label' => esc_html__( 'Footer Link Color', 'Raindrops' ), 'section' => 'colors', 'settings' => 'raindrops_theme_settings[raindrops_footer_link_color]' ) ) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'raindrops_hyperlink_color2', array( 'label' => esc_html__( 'Link Color', 'Raindrops' ), 'section' => 'colors', 'settings' => 'raindrops_theme_settings[raindrops_hyperlink_color]' ) ) );
$wp_customize->add_control( 'raindrops_complementary_color_for_title_link2', array( 'label' => esc_html__( 'Complementary Link Color For Entry Title', 'Raindrops' ),
'section' => 'colors',
'settings' => 'raindrops_theme_settings[raindrops_complementary_color_for_title_link]',
'type' => 'radio',
'choices' => array( 'yes' => 'Yes', 'no' => 'no' ), ) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'raindrops_default_fonts_color', array( 'label' => esc_html__( 'Font Color', 'Raindrops' ), 'section' => 'raindrops_theme_settings_fonts', 'settings' => 'raindrops_theme_settings[raindrops_default_fonts_color]' ) ) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'raindrops_hyperlink_color', array( 'label' => esc_html__( 'Link Color', 'Raindrops' ), 'section' => 'raindrops_theme_settings_fonts', 'settings' => 'raindrops_theme_settings[raindrops_hyperlink_color]' ) ) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'raindrops_footer_color', array( 'label' => esc_html__( 'Footer Font Color', 'Raindrops' ), 'section' => 'raindrops_theme_settings_fonts', 'settings' => 'raindrops_theme_settings[raindrops_footer_color]' ) ) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'raindrops_footer_link_color', array( 'label' => esc_html__( 'Footer Link Color', 'Raindrops' ), 'section' => 'raindrops_theme_settings_fonts', 'settings' => 'raindrops_theme_settings[raindrops_footer_link_color]' ) ) );
$wp_customize->add_control( 'raindrops_complementary_linkcolor_for_title_link', array( 'label' => esc_html__( 'Complementary Link Color For Entry Title', 'Raindrops' ),
'section' => 'raindrops_theme_settings_fonts',
'settings' => 'raindrops_theme_settings[raindrops_complementary_color_for_title_link]',
'type' => 'radio',
'choices' => array( 'yes' => 'Yes', 'no' => 'no' ), ) );
$wp_customize->add_control( 'raindrops_basefont_settings', array( 'label' => esc_html__( 'Base Font Size', 'Raindrops' ),
'section' => 'raindrops_theme_settings_fonts',
'settings' => 'raindrops_theme_settings[raindrops_basefont_settings]',
'type' => 'radio',
'choices' => array_flip( $raindrops_basefont_size ), ) );
if ( 'yes' == get_theme_mod( 'raindrops_breadcrumb_navxt_status' ) ) {
$wp_customize->add_control( 'raindrops_plugin_presentation_bcn_nav_menu', array(
'label' => esc_html__( 'Breadcrumb NavXT Automatic Presentation', 'Raindrops' ),
'section' => 'raindrops_theme_settings_plugins',
'settings' => 'raindrops_theme_settings[raindrops_plugin_presentation_bcn_nav_menu]',
'type' => 'radio',
'choices' => array( 'yes' => 'Yes', 'none' => 'no' ), ) );
}
if ( 'yes' == get_theme_mod( 'raindrops_wp_pagenavi_status' ) ) {
$wp_customize->add_control( 'raindrops_plugin_presentation_wp_pagenav', array(
'label' => esc_html__( 'WP PageNavi Automatic Presentation', 'Raindrops' ),
'section' => 'raindrops_theme_settings_plugins',
'settings' => 'raindrops_theme_settings[raindrops_plugin_presentation_wp_pagenav]',
'type' => 'radio',
'choices' => array( 'yes' => 'Yes', 'none' => 'no' ), ) );
}
if ( 'yes' == get_theme_mod( 'raindrops_ml_slider_status' ) ) {
$wp_customize->add_control( 'raindrops_plugin_presentation_meta_slider', array(
'label' => esc_html__( 'Meta Slider ID for HomePage', 'Raindrops' ),
'section' => 'raindrops_theme_settings_plugins',
'settings' => 'raindrops_theme_settings[raindrops_plugin_presentation_meta_slider]',
'type' => 'text', ) );
}
if ( 'yes' == get_theme_mod( 'raindrops_the_events_calendar_status' ) ) {
$wp_customize->add_control( 'raindrops_plugin_presentation_the_events_calendar', array(
'label' => esc_html__( 'The Events Calendar Automatic Presentation', 'Raindrops' ),
'section' => 'raindrops_theme_settings_plugins',
'settings' => 'raindrops_theme_settings[raindrops_plugin_presentation_the_events_calendar]',
'type' => 'radio',
'choices' => array( 'yes' => 'Yes', 'none' => 'no' ), ) );
}
$wp_customize->add_control( 'raindrops_sync_style_for_tinymce',
array(
'label' => esc_html__( 'Synchronize Style for Visual Editor', 'Raindrops' ),
'section' => 'raindrops_theme_settings',
'settings' => 'raindrops_theme_settings[raindrops_sync_style_for_tinymce]',
'type' => 'radio',
'choices' => array( 'yes' => 'Yes', 'none' => 'No' ),
)
);
$wp_customize->add_control( 'raindrops_uninstall_option',
array(
'label' => esc_html__( 'Delete all Theme Settings when Switch Theme', 'Raindrops' ),
'section' => 'raindrops_theme_settings_uninstall',
'settings' => 'raindrops_theme_settings[raindrops_uninstall_option]',
'type' => 'radio',
'choices' => array( 'keep' => 'Keep', 'delete' => 'Delete All' ),
'description' => '
'. esc_html__( 'The deleted data can not be restored', 'Raindrops' ). ' ',
)
);
$wp_customize->add_control( 'raindrops_menu_primary_font_size',
array(
'label' => esc_html__( 'Menu Primary Font Size', 'Raindrops' ),
'section' => 'nav',
'settings' => 'raindrops_theme_settings[raindrops_menu_primary_font_size]',
'type' => 'text',
'description' => '
'. esc_html__( 'Menu Primary Font Size. default value is 100( % ). set font size between 77 and 182', 'Raindrops' ). '
',
)
);
//raindrops_plugin_presentation_the_events_calendar
/* Label change 'Display Header Text' */
$wp_customize->add_control( 'display_header_text', array(
'settings' => 'header_textcolor',
'label' => __( 'Move Tagline Position from top right to header image', 'Raindrops' ),
'section' => 'title_tagline',
'type' => 'checkbox',
) );
do_action( 'raindrops_customize_register' );
}
}
add_filter( 'raindrops_prev_next_post', 'raindrops_remove_element' );
add_filter( 'raindrops_posted_on', 'raindrops_remove_element' );
add_filter( 'raindrops_posted_in', 'raindrops_remove_element' );
/**
*
*
*
*
*/
if ( !function_exists( 'raindrops_remove_element' ) ) {
function raindrops_remove_element( $content ) {
return preg_replace( '!
]+><\/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( 'insert_message_action_hook_position' ) ) {
function insert_message_action_hook_position( $hook_name = '' ) {
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' );
}
}
if ( true == WP_DEBUG && true == $raindrops_actions_hook_message ) {
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 ) {
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\'.' );
$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 );
}
}
/**
*
*
*
*
* @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 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', );
$args = wp_parse_args( $args, $default );
$thumbnail = '';
$raindrops_unique_label = '';
extract( $args, EXTR_SKIP );
if ( has_post_thumbnail( $post->ID ) && !is_singular() && !post_password_required() ) {
$thumbnail .= "\n". str_repeat("\t", 11 ). '';
$thumbnail .= get_the_post_thumbnail( $post->ID, array( 48, 48 ), array( "style" => "vertical-align:middle;", "alt" => esc_attr__( 'Featured Image', 'Raindrops' ) ) );
$thumbnail .= "\n". str_repeat("\t", 11 ). ' ';
}
if ( ! has_post_thumbnail( $post->ID ) && !is_singular() && !post_password_required() ) {
$thumbnail = apply_filters('raindrops_title_thumbnail', $thumbnail ,'', ' ');
}
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">%5$s'. "\n". str_repeat("\t", 11 ).'%6$s %4$s '. "\n". str_repeat("\t", 10 ). '' . $raindrops_title_element . '>';
$html = sprintf( $html, apply_filters('raindrops_entry_title_class', 'h2 entry-title'), get_permalink(), the_title_attribute( array( 'before' => '', 'after' => '', 'echo' => false ) ), the_title( '', '', false ), $thumbnail, $raindrops_unique_label );
echo apply_filters( 'raindrops_entry_title', $html );
} else {
$html = '<' . $raindrops_title_element . ' class="%1$s">%4$s%3$s %2$s ' . $raindrops_title_element . '>';
$html = sprintf( $html, apply_filters('raindrops_entry_title_class', 'h2 entry-title'), the_title( '', '', false ), $raindrops_unique_label, $thumbnail );
echo apply_filters( 'raindrops_entry_title', $html );
}
}
}
/**
*
*
*
*
* @since 0.980
*/
if ( !function_exists( 'raindrops_entry_content' ) ) {
function raindrops_entry_content( $more_link_text = null, $stripteaser = false ) {
global $post;
if ( raindrops_detect_display_none_condition() && !is_sticky() ) {
return;
}
$raindrops_excerpt_condition = raindrops_detect_excerpt_condition();
if ( true == $raindrops_excerpt_condition && !is_sticky() ) {
/* remove shortcodes */
$excerpt = preg_replace( '!\[[^\]]+\]!', '', get_the_excerpt() );
$excerpt = apply_filters( 'the_excerpt', $excerpt );
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 );
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 );
}
}
}
if ( version_compare( $wp_version, '4.0.1', '>' ) ) {
add_filter( 'raindrops_next_prev_links', 'raindrops_the_pagenation', 10, 2);
}
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' ) {
return get_the_posts_pagination();
} elseif( $raindrops_document_type == 'xhtml' ) {
$result = str_replace( array(''),array(''), get_the_posts_pagination() );
return $result;
} else {
return $html;
}
}
return $html;
}
/**
*
*
*
*
* @since 0.980
*/
if ( !function_exists( 'raindrops_sidebar_menus' ) ) {
function raindrops_sidebar_menus( $position = 'default' ) {
global $post, $raindrops_wp_version;
$attr = '';
if ( 'default' == $position ) {
$html = '
' . get_search_form( false ) . ' ';
$html .= '
';
$html .= '' . wp_get_archives( 'type=monthly&echo=0' ) . ' ';
$html .= ' ';
} else {
$html = wp_list_categories( 'show_count=1&title_li=
&echo=0' );
}
echo apply_filters( 'raindrops_sidebar_menus', $html );
wp_reset_postdata();
}
}
if ( !function_exists( 'raindrops_link_get' ) ) {
/**
*
* @param type $text
* @return boolean
* @since 1.246
*/
function raindrops_link_get( $text = '' ) {
if ( preg_match_all( "/(https?:\/\/)([-_.!˜*\'()a-zA-Z0-9;\/?:@&=+$,%#]+)/iu", $text, $matches, PREG_SET_ORDER ) ) {
return $matches;
}
return false;
}
}
if ( !function_exists( 'raindrops_replace_oembed_link_to_icon' ) ) {
/**
*
* @param type $post_content
* @return type
* @since 1.246
*/
function raindrops_replace_oembed_link_to_icon( $post_content = '' ) {
$replaced_content = $post_content;
$link_removed_content = $post_content;
$icon_html = '';
$raindrops_post_content_links = raindrops_link_get( $post_content );
if ( isset( $raindrops_post_content_links ) && !empty( $raindrops_post_content_links ) ) {
foreach ( $raindrops_post_content_links[ 0 ] as $key => $uri ) {
if ( wp_oembed_get( $uri ) ) {
$css_class = parse_url( $uri );
$css_class = str_replace( '.', '-', $css_class );
$icon_html_1 = '
Cloud ';
$icon_html .= apply_filters( 'raindrops_replace_oembed_link_to_icon_icon', $icon_html_1 );
$replaced_content = str_replace( $uri, $icon_html, $post_content );
$replaced_content = apply_filters( 'raindrops_replace_oembed_link_to_icon_replace', $replaced_content, $icon_html );
$link_removed_content = str_replace( $uri, '', $post_content );
$link_removed_content = apply_filters( 'raindrops_replace_oembed_link_to_icon_removed', $link_removed_content, $icon_html );
}
}
} else {
$replaced_content = $post_content;
$link_removed_content = $post_content;
$icon_html = '';
}
return array( 'replaced_content' => $replaced_content, 'link_removed_content' => $link_removed_content, 'icon_html' => $icon_html );
}
}
$raindrops_use_transient = true;
if ( !function_exists( 'raindrops_transient_update' ) ) {
/**
*
* @param type $post_id
* @since 1.246
*/
function raindrops_transient_update( $post_id ) {
delete_transient( 'raindrops_recent_posts' );
delete_transient( 'raindrops_category_posts' );
delete_transient( 'raindrops_get_tag_posts' );
}
}
if ( !function_exists( 'raindrops_recent_posts' ) ) {
/**
*
* @param array $args
* @return html
* @since 1.246
*/
function raindrops_recent_posts( $args = array() ) {
global $raindrops_bf_recent_posts_setting, $raindrops_use_transient;
if ( false === ( $val = get_transient( __FUNCTION__ ) ) || get_transient( 'raindrops_bf_recent_posts_setting') !== md5(serialize( $raindrops_bf_recent_posts_setting ) ) ) {
$result = raindrops_get_recent_posts( $args = array() );
if( $raindrops_use_transient == true ) {
set_transient( 'raindrops_bf_recent_posts_setting', md5(serialize( $raindrops_bf_recent_posts_setting )));
set_transient( __FUNCTION__, $result);
}
echo $result;
return;
}
echo $val;
if( $raindrops_use_transient == false ) {
delete_transient( 'raindrops_bf_recent_posts_setting');
delete_transient( __FUNCTION__);
}
}
}
if ( !function_exists( 'raindrops_category_posts' ) ) {
/**
*
* @param array $args
* @return html
* @since 1.246
*/
function raindrops_category_posts( $args = array() ) {
global $raindrops_bf_category_posts_setting, $raindrops_use_transient;
if ( false === ( $val = get_transient( __FUNCTION__ ) ) || get_transient( 'raindrops_bf_category_posts_setting') !== md5(serialize( $raindrops_bf_category_posts_setting ) )) {
$result = raindrops_get_category_posts( $args = array() );
if( $raindrops_use_transient == true ) {
set_transient( 'raindrops_bf_category_posts_setting', md5(serialize( $raindrops_bf_category_posts_setting )));
set_transient( __FUNCTION__, $result);
}
echo $result;
return;
}
echo $val;
if( $raindrops_use_transient == false ) {
delete_transient( 'raindrops_bf_category_posts_setting');
delete_transient( __FUNCTION__);
}
}
}
if ( !function_exists( 'raindrops_tag_posts' ) ) {
/**
*
* @param array $args
* @return html
* @since 1.246
*/
function raindrops_tag_posts( $args = array() ) {
global $raindrops_bf_tag_posts_setting, $raindrops_use_transient;
if ( false === ( $val = get_transient( __FUNCTION__ ) ) || get_transient( 'raindrops_bf_tag_posts_setting' ) !== md5( serialize( $raindrops_bf_tag_posts_setting ) ) ) {
$result = raindrops_get_tag_posts( $args = array() );
if( $raindrops_use_transient == true ) {
set_transient( 'raindrops_bf_tag_posts_setting', md5(serialize( $raindrops_bf_tag_posts_setting )));
set_transient( __FUNCTION__, $result);
}
echo $result;
return;
}
echo $val;
if( $raindrops_use_transient == false) {
delete_transient( 'raindrops_bf_tag_posts_setting');
delete_transient( __FUNCTION__);
}
}
}
/**
* recent post
*
*
*
*
*/
if ( !function_exists( 'raindrops_get_recent_posts' ) ) {
function raindrops_get_recent_posts( $args = array() ) {
global $raindrops_bf_recent_posts_setting, $post, $raindrops_base_font_size, $raindrops_link_unique_text, $template;
$thumbnail_size = apply_filters( 'raindrops_recent_posts_thumb_size', array( 125, 125 ) );
$article_margin = 0;
$thumbnail_width = (int) $thumbnail_size[ 0 ];
$thumbnail_height = (int) $thumbnail_size[ 0 ];
if ( empty( $args ) ) {
if ( !isset( $raindrops_bf_recent_posts_setting ) && basename( $template ) == 'blank-front.php' ) {
return;
}
} else {
$raindrops_bf_recent_posts_setting = wp_parse_args( $args, $raindrops_bf_recent_posts_setting );
}
$default = array(
'title' => esc_html__( 'Recent Post', 'Raindrops' ), 'numberposts' => 10, 'offset' => 0, 'category' => 0, 'orderby' => 'post_date', 'order' => 'DESC', 'include' => '', 'exclude' => '', 'meta_key' => '', 'meta_value' => '', 'post_type' => 'post', 'post_status' => 'publish', 'suppress_filters' => true,
'raindrops_excerpt_length' => 100,
'raindrops_excerpt_more' => '...',
'raindrops_post_thumbnail' => true, 'raindrops_recent_post_thumbnail_default_uri' => '' );
$args = wp_parse_args( $raindrops_bf_recent_posts_setting, $default );
$title = $args[ 'title' ];
unset( $args[ 'title' ] );
$article_margin = '';
if ( array_key_exists( 'raindrops_excerpt_length', $args ) ) {
$raindrops_excerpt_length = $args[ "raindrops_excerpt_length" ];
}
if ( array_key_exists( 'raindrops_excerpt_more', $args ) && $args[ "raindrops_excerpt_length" ] > 0 ) {
$raindrops_excerpt_more = $args[ "raindrops_excerpt_more" ];
} else {
$raindrops_excerpt_more = '';
}
if ( array_key_exists( 'raindrops_recent_post_thumbnail_default_uri', $args ) && !empty( $args[ "raindrops_recent_post_thumbnail_default_uri" ] ) ) {
$raindrops_recent_post_thumbnail_default_uri = $args[ "raindrops_recent_post_thumbnail_default_uri" ];
} elseif ( empty( $args[ "raindrops_recent_post_thumbnail_default_uri" ] ) ) {
$raindrops_recent_post_thumbnail_default_uri = '';
}
$archive_year = get_the_time( 'Y' );
$archive_month = get_the_time( 'm' );
$archive_day = get_the_time( 'd' );
$raindrops_date_format = get_option( 'date_format' ) . ' ' . get_option( 'time_format' );
$day_link = esc_url( get_day_link( $archive_year, $archive_month, $archive_day ) . '#post-' . $post->ID );
$html = '
%10$s<%4$s id="post-%5$s-recentpost" %6$s style="%11$s">
%7$s%8$s
%9$s
%4$s> ';
$html = apply_filters( 'raindrops_recent_posts_li', $html );
$results = wp_get_recent_posts( $args );
$result = sprintf( '
%1$s ', $title, 'title h2' );
$result = apply_filters( 'raindrops_recent_posts_title', $result );
$result .= sprintf( '
', 'raindrops-recent-posts' );
foreach ( $results as $key => $val ) {
$classes = '';
if ( empty( $raindrops_recent_post_thumbnail_default_uri ) && !has_post_thumbnail( $val[ "ID" ] ) ) {
$article_margin = '';
} elseif ( true == $args[ "raindrops_post_thumbnail" ] ) {
$article_margin = (int) $thumbnail_size[ 0 ] + 10;
/* if ( !isset( $raindrops_base_font_size ) || empty( $raindrops_base_font_size ) ) {
$raindrops_base_font_size = 13;
}
$article_margin = $article_margin / $raindrops_base_font_size; */
$article_margin = 'margin-left:' . $article_margin . 'px';
}
if ( array_key_exists( 'raindrops_post_thumbnail', $args ) &&
true == $args[ "raindrops_post_thumbnail" ] && !post_password_required() ) {
$thumbnail = '';
if ( has_post_thumbnail( $val[ "ID" ] ) ) {
if( $raindrops_link_unique_text == false ) {
$thumbnail .= '';
}
$thumbnail .= get_the_post_thumbnail( $val[ "ID" ], $thumbnail_size, array( "style" => "vertical-align:text-bottom;float:left;", "alt" => esc_attr__( 'Recent Post Featured Image', 'Raindrops' ) ) );
if( $raindrops_link_unique_text == false ) {
$thumbnail .= ' ';
}
} elseif ( !empty( $raindrops_recent_post_thumbnail_default_uri ) ) {
if( $raindrops_link_unique_text == false ) {
$thumbnail .= '';
}
$thumbnail .= ' ';
if( $raindrops_link_unique_text == false ) {
$thumbnail .= ' ';
}
}
$thumbnail .= ' ';
} else {
$thumbnail = '';
}
$post_content = strip_shortcodes( $val["post_content"] );
$oembed_replace_array = raindrops_replace_oembed_link_to_icon( $post_content );
$oembed_flag = $oembed_replace_array['icon_html'];
$post_content = $oembed_replace_array['link_removed_content'];
$author = get_the_author_meta( 'display_name', $val[ "post_author" ] );
$list_num_class = 'recent-' . $val['ID'];
$raindrops_now = (int) current_time( 'timestamp' );
$raindrops_publish_time = (int) strtotime( $val[ "post_date" ] );
$raindrops_period = apply_filters( 'raindrops_new_period', 3 );
$raindrops_Period = (int) 60 * 60 * 24 * $raindrops_period;
if ( $raindrops_now < $raindrops_Period + $raindrops_publish_time ) {
$classes = array( 'raindrops-pub-new ' );
$classes = get_post_class( $classes );
} else {
$classes = get_post_class();
}
$classes = 'class="' . join( ' ', $classes ) . '"';
$result .= sprintf( $html, get_permalink( $val[ 'ID' ] ), $val[ 'post_title' ], $list_num_class, raindrops_doctype_elements( 'div', 'article', false ), $val[ 'ID' ], $classes, sprintf( '<%4$s class="entry-date updated" %5$s>%3$s%4$s> ', $day_link, esc_attr( 'archives daily ' . mysql2date( $val[ "post_date" ], $raindrops_date_format ) ), esc_html( mysql2date( $raindrops_date_format, $val[ "post_date" ] ) ), raindrops_doctype_elements( 'span', 'time', false ), raindrops_doctype_elements( '', 'datetime="' . esc_attr( get_the_date( 'c' ) ) . '"', false )
), sprintf( '%3$s ', get_author_posts_url( $val[ "post_author" ] ), sprintf( esc_attr__( 'View all posts by %s', 'Raindrops' ), $author ), $author
), wp_html_excerpt( $post_content, $raindrops_excerpt_length, $raindrops_excerpt_more ). $oembed_flag, $thumbnail, $article_margin
);
}
$result .= sprintf( ' ' );
$result = sprintf( '
%2$s
', 'clearfix', $result, 'raindrops-recent-posts' );
return apply_filters( 'raindrops_recent_posts', $result );
}
}
/**
* category posts
*
*
*
*
*/
if ( !function_exists( 'raindrops_get_category_posts' ) ) {
function raindrops_get_category_posts( $args = '' ) {
global $post, $raindrops_bf_category_posts_setting, $template, $raindrops_link_unique_text;
if ( empty( $args ) ) {
if ( !isset( $raindrops_bf_category_posts_setting ) && basename( $template ) == 'blank-front.php' ) {
return;
}
} else {
$raindrops_bf_category_posts_setting = wp_parse_args( $args, $raindrops_bf_category_posts_setting );
}
$thumbnail_size = apply_filters( 'raindrops_category_posts_thumb_size', array( 125, 125 ) );
$article_margin = 0;
$thumbnail_width = (int) $thumbnail_size[ 0 ];
$thumbnail_height = (int) $thumbnail_size[ 0 ];
$html = '
%10$s<%4$s id="post-%5$s-catpost" %6$s style="%11$s">
%7$s%8$s
%9$s
%4$s> ';
$archive_year = get_the_time( 'Y' );
$archive_month = get_the_time( 'm' );
$archive_day = get_the_time( 'd' );
$raindrops_date_format = get_option( 'date_format' ) . ' ' . get_option( 'time_format' );
$day_link = esc_url( get_day_link( $archive_year, $archive_month, $archive_day ) . '#post-' . $post->ID );
$settings = array( 'title' => esc_html__( 'Categories', 'Raindrops' ),
'numberposts' => 0,
'offset' => 0,
'category' => 0,
'orderby' => 'post_date',
'order' => 'DESC',
'include' => '',
'exclude' => '',
'meta_key' => '',
'meta_value' => '',
'post_type' => 'post',
'post_mime_type' => '',
'post_parent' => '',
'post_status' => 'publish',
'raindrops_excerpt_length' => 100,
'raindrops_excerpt_more' => '...',
'raindrops_post_thumbnail' => true,
'raindrops_category_post_thumbnail_default_uri' => '' );
$settings = wp_parse_args( $raindrops_bf_category_posts_setting, $settings );
$title = $settings[ 'title' ];
unset( $settings[ 'title' ] );
$article_margin = '';
if ( array_key_exists( 'raindrops_excerpt_length', $settings ) ) {
$raindrops_excerpt_length = $settings[ "raindrops_excerpt_length" ];
}
if ( array_key_exists( 'raindrops_excerpt_more', $settings ) && $settings[ "raindrops_excerpt_length" ] > 0 ) {
$raindrops_excerpt_more = $settings[ "raindrops_excerpt_more" ];
} else {
$raindrops_excerpt_more = '';
}
if ( array_key_exists( 'raindrops_category_post_thumbnail_default_uri', $settings ) && !empty( $settings[ "raindrops_category_post_thumbnail_default_uri" ] ) ) {
$raindrops_category_post_thumbnail_default_uri = $settings[ "raindrops_category_post_thumbnail_default_uri" ];
} elseif ( empty( $settings[ "raindrops_category_post_thumbnail_default_uri" ] ) ) {
$raindrops_category_post_thumbnail_default_uri = '';
}
//echo 'test'. $raindrops_category_post_thumbnail_default_uri.'test';
$posts = get_posts( $settings );
if ( $posts ) {
$result = sprintf( '
%1$s ', $title, 'title h2' );
$result .= sprintf( '
' );
foreach ( $posts as $post ) {
setup_postdata( $post );
$classes = '';
if ( empty( $raindrops_category_post_thumbnail_default_uri ) && !has_post_thumbnail( $post->ID ) ) {
$article_margin = '';
} elseif ( true == $settings[ "raindrops_post_thumbnail" ] ) {
$article_margin = (int) $thumbnail_size[ 0 ] + 10;
$article_margin = 'margin-left:' . $article_margin . 'px';
}
if ( array_key_exists( 'raindrops_post_thumbnail', $settings ) &&
true == $settings[ "raindrops_post_thumbnail" ] &&
!post_password_required() ) {
$thumbnail = '';
if ( has_post_thumbnail( $post->ID ) ) {
if( $raindrops_link_unique_text == false ) {
$thumbnail .= '';
}
$thumbnail .= get_the_post_thumbnail( $post->ID, $thumbnail_size, array( "style" => "vertical-align:text-bottom;float:left;", "alt" => esc_attr__( 'Category Post Featured Image', 'Raindrops' ) ) );
if( $raindrops_link_unique_text == false ) {
$thumbnail .= ' ';
}
} elseif ( !empty( $raindrops_category_post_thumbnail_default_uri ) ) {
if( $raindrops_link_unique_text == false ) {
$thumbnail .= '';
}
$thumbnail .= ' ';
if( $raindrops_link_unique_text == false ) {
$thumbnail .= ' ';
}
}
$thumbnail .= ' ';
} else {
$thumbnail = '';
}
$post_content = ''; // wp-includes/post-template.php:265 - Trying to get property of non-object
if ( isset( $post ) ) {
$post_content = strip_shortcodes( get_the_content() );
}
$oembed_replace_array = raindrops_replace_oembed_link_to_icon( $post_content );
$oembed_flag = $oembed_replace_array['icon_html'];
$post_content = $oembed_replace_array['link_removed_content'];
$author = get_the_author_meta( 'display_name', get_the_author() );
$list_num_class = 'recent-' . $post->ID;
$raindrops_now = (int) current_time( 'timestamp' );
$raindrops_publish_time = (int) strtotime( get_the_date() );
$raindrops_period = apply_filters( 'raindrops_new_period', 3 );
$raindrops_Period = (int) 60 * 60 * 24 * $raindrops_period;
if ( $raindrops_now < $raindrops_Period + $raindrops_publish_time ) {
$classes = array( 'raindrops-pub-new ' );
$classes = get_post_class( $classes );
} else {
$classes = get_post_class();
}
$classes = 'class="' . join( ' ', $classes ) . '"';
$result .= sprintf( $html, get_permalink( $post->ID ), get_the_title(), $list_num_class, raindrops_doctype_elements( 'div', 'article', false ), $post->ID, $classes, sprintf( '<%4$s class="entry-date updated" %5$s>%3$s%4$s> ', $day_link, esc_attr( 'archives daily ' . mysql2date( get_the_date(), $raindrops_date_format ) ), esc_html( mysql2date( $raindrops_date_format, get_the_date() ) ), raindrops_doctype_elements( 'span', 'time', false ), raindrops_doctype_elements( '', 'datetime="' . esc_attr( get_the_date( 'c' ) ) . '"', false )
), sprintf( '%3$s ', get_author_posts_url( get_the_author() ), sprintf( esc_attr__( 'View all posts by %s', 'Raindrops' ), get_the_author() ), get_the_author()
), wp_html_excerpt( $post_content, $raindrops_excerpt_length, $raindrops_excerpt_more ). $oembed_flag, $thumbnail, $article_margin
);
}
$result .= sprintf( ' ' );
}
$result = sprintf( '
%2$s
', 'raindrops-category-posts clearfix', $result );
wp_reset_postdata();
return apply_filters( 'raindrops_category_posts', $result );
}
}
/**
* tag posts
*
*
*
*
*/
if ( !function_exists( 'raindrops_get_tag_posts' ) ) {
function raindrops_get_tag_posts( $args = '' ) {
global $post, $raindrops_bf_tag_posts_setting, $raindrops_link_unique_text, $template;
if ( empty( $args ) ) {
if ( !isset( $raindrops_bf_tag_posts_setting ) && basename( $template ) == 'blank-front.php' ) {
return;
}
} else {
$raindrops_bf_tag_posts_setting = wp_parse_args( $args, $raindrops_bf_tag_posts_setting );
}
$thumbnail_size = apply_filters( 'raindrops_tag_posts_thumb_size', array( 125, 125 ) );
$article_margin = 0;
$thumbnail_width = (int) $thumbnail_size[ 0 ];
$thumbnail_height = (int) $thumbnail_size[ 0 ];
$html = '
%10$s<%4$s id="post-%5$s-tagpost" %6$s style="%11$s">
%7$s%8$s
%9$s
%4$s> ';
$archive_year = get_the_time( 'Y' );
$archive_month = get_the_time( 'm' );
$archive_day = get_the_time( 'd' );
$raindrops_date_format = get_option( 'date_format' ) . ' ' . get_option( 'time_format' );
$day_link = esc_url( get_day_link( $archive_year, $archive_month, $archive_day ) . '#post-' . $post->ID );
$settings = array(
'title' => esc_html__( 'Tags', 'Raindrops' ),
'numberposts' => 0,
'offset' => 0,
'category' => 0,
'orderby' => 'post_date',
'order' => 'DESC',
'include' => '',
'exclude' => '',
'meta_key' => '',
'meta_value' => '',
'post_type' => 'post',
'post_mime_type' => '',
'post_parent' => '',
'post_status' => 'publish',
'raindrops_excerpt_length' => 100,
'raindrops_excerpt_more' => '...',
'raindrops_post_thumbnail' => true,
'raindrops_tag_post_thumbnail_default_uri' => ''
);
$settings = wp_parse_args( $raindrops_bf_tag_posts_setting, $settings );
$title = $settings[ 'title' ];
unset( $settings[ 'title' ] );
$article_margin = 'margin-left:' . $article_margin . 'px!important';
if ( array_key_exists( 'raindrops_excerpt_length', $settings ) ) {
$raindrops_excerpt_length = $settings[ "raindrops_excerpt_length" ];
}
if ( array_key_exists( 'raindrops_excerpt_more', $settings ) && $settings[ "raindrops_excerpt_length" ] > 0 ) {
$raindrops_excerpt_more = $settings[ "raindrops_excerpt_more" ];
} else {
$raindrops_excerpt_more = '';
}
if ( array_key_exists( 'raindrops_tag_post_thumbnail_default_uri', $settings ) && !empty( $settings[ "raindrops_tag_post_thumbnail_default_uri" ] ) ) {
$raindrops_tag_post_thumbnail_default_uri = $settings[ "raindrops_tag_post_thumbnail_default_uri" ];
} elseif ( empty( $settings[ "raindrops_tag_post_thumbnail_default_uri" ] ) ) {
$raindrops_tag_post_thumbnail_default_uri = '';
}
$posts = get_posts( $settings );
if ( $posts ) {
$result = sprintf( '
%1$s ', $title, 'title h2' );
$result .= sprintf( '
', 'list' );
foreach ( $posts as $post ) {
setup_postdata( $post );
$classes = '';
if ( empty( $raindrops_tag_post_thumbnail_default_uri ) && !has_post_thumbnail( $post->ID ) ) {
$article_margin = '';
} elseif ( true == $settings[ "raindrops_post_thumbnail" ] ) {
$article_margin = (int) $thumbnail_size[ 0 ] + 10;
$article_margin = 'margin-left:' . $article_margin . 'px';
}
if ( array_key_exists( 'raindrops_post_thumbnail', $settings ) &&
true == $settings[ "raindrops_post_thumbnail" ] &&
!post_password_required() ) {
$thumbnail = '';
if ( has_post_thumbnail( $post->ID ) ) {
if ( $raindrops_link_unique_text == false ) {
$thumbnail .= '';
}
$thumbnail .= get_the_post_thumbnail( $post->ID, $thumbnail_size, array( "style" => "vertical-align:text-bottom;float:left;", "alt" => esc_attr__( 'tag Post Featured Image', 'Raindrops' ) ) );
if ( $raindrops_link_unique_text == false ) {
$thumbnail .= ' ';
}
} elseif ( !empty( $raindrops_tag_post_thumbnail_default_uri ) ) {
if ( $raindrops_link_unique_text == false ) {
$thumbnail .= '';
}
$thumbnail .= ' ';
if ( $raindrops_link_unique_text == false ) {
$thumbnail .= ' ';
}
}
$thumbnail .= ' ';
} else {
$thumbnail = '';
}
$post_content = ''; // wp-includes/post-template.php:265 - Trying to get property of non-object
if ( isset( $post ) ) {
$post_content = strip_shortcodes( get_the_content() );
}
$oembed_replace_array = raindrops_replace_oembed_link_to_icon( $post_content );
$oembed_flag = $oembed_replace_array[ 'icon_html' ];
$post_content = $oembed_replace_array[ 'link_removed_content' ];
$author = get_the_author_meta( 'display_name', get_the_author() );
$list_num_class = 'recent-' . $post->ID;
$raindrops_now = (int) current_time( 'timestamp' );
$raindrops_publish_time = (int) strtotime( get_the_date() );
$raindrops_period = apply_filters( 'raindrops_new_period', 3 );
$raindrops_Period = (int) 60 * 60 * 24 * $raindrops_period;
if ( $raindrops_now < $raindrops_Period + $raindrops_publish_time ) {
$classes = array( 'raindrops-pub-new ' );
$classes = get_post_class( $classes );
} else {
$classes = get_post_class();
}
$classes = 'class="' . join( ' ', $classes ) . '"';
$result .= sprintf( $html, get_permalink( $post->ID ), get_the_title(), $list_num_class, raindrops_doctype_elements( 'div', 'article', false ), $post->ID, $classes, sprintf( '<%4$s class="entry-date updated" %5$s>%3$s%4$s> ', $day_link, esc_attr( 'archives daily ' . mysql2date( get_the_date(), $raindrops_date_format ) ), esc_html( mysql2date( $raindrops_date_format, get_the_date() ) ), raindrops_doctype_elements( 'span', 'time', false ), raindrops_doctype_elements( '', 'datetime="' . esc_attr( get_the_date( 'c' ) ) . '"', false )
), sprintf( '%3$s ', get_author_posts_url( get_the_author() ), sprintf( esc_attr__( 'View all posts by %s', 'Raindrops' ), get_the_author() ), get_the_author()
), wp_html_excerpt( $post_content, $raindrops_excerpt_length, $raindrops_excerpt_more ) . $oembed_flag, $thumbnail, $article_margin
);
}
$result .= sprintf( ' ' );
}
$result = sprintf( '
%2$s
', 'raindrops-tag-posts clearfix', $result );
wp_reset_postdata();
return apply_filters( 'raindrops_tag_posts', $result );
}
}
/**
*
*
*
*
*/
if ( !function_exists( 'raindrops_monthly_archive_prev_next_navigation' ) ) {
function raindrops_monthly_archive_prev_next_navigation() {
global $wpdb, $wp_query;
if ( is_month() ) {
$thisyear = mysql2date( 'Y', $wp_query->posts[ 0 ]->post_date );
$thismonth = mysql2date( 'm', $wp_query->posts[ 0 ]->post_date );
$unixmonth = mktime( 0, 0, 0, $thismonth, 1, $thisyear );
$last_day = date( 't', $unixmonth );
$calendar_output = '';
$previous = $wpdb->get_row( "SELECT MONTH(post_date) AS month, YEAR(post_date) AS year
FROM $wpdb->posts
WHERE post_date < '$thisyear-$thismonth-01'
AND post_type = 'post' AND post_status = 'publish'
ORDER BY post_date DESC
LIMIT 1" );
$next = $wpdb->get_row( "SELECT MONTH(post_date) AS month, YEAR(post_date) AS year
FROM $wpdb->posts
WHERE post_date > '$thisyear-$thismonth-{$last_day} 23:59:59'
AND post_type = 'post' AND post_status = 'publish'
ORDER BY post_date ASC
LIMIT 1" );
$html = '
%2$s ';
if ( $previous ) {
$calendar_output = sprintf( $html, get_month_link( $previous->year, $previous->month ), sprintf( esc_html__( 'Prev Month( %sth )', 'Raindrops' ), $previous->month ), 'alignleft' );
}
$calendar_output .= "\t";
if ( $next ) {
$calendar_output .= sprintf( $html, get_month_link( $next->year, $next->month ), sprintf( esc_html__( 'Next Month( %sth )', 'Raindrops' ), $next->month ), 'alignright' );
}
$html = '
%2$s
';
$calendar_output = sprintf( $html, 'raindrops-monthly-archive-prev-next-avigation', $calendar_output );
echo apply_filters( 'raindrops_monthly_archive_prev_next_navigation', $calendar_output );
}
}
}
/**
*
*
*
*
*
*/
if ( !function_exists( 'raindrops_customize_controls_print_styles' ) ) {
function raindrops_customize_controls_print_styles() {
?>
';
}
}
}
/**
*
*
*
*
*/
if ( !function_exists( 'raindrops_doctype_elements' ) ) {
function raindrops_doctype_elements( $xhtml, $html5, $echo = true ) {
global $raindrops_document_type;
if ( true == $echo ) {
echo $$raindrops_document_type;
} else {
return $$raindrops_document_type;
}
}
}
/**
* Switch elements from div to figure when doctype html5
*
*
* @since 1.003
*/
if ( !function_exists( 'raindrops_img_caption_shortcode_filter' ) ) {
function raindrops_img_caption_shortcode_filter( $val, $attr, $content = null ) {
global $raindrops_document_type;
extract( shortcode_atts( array( 'id' => '', 'align' => '', 'width' => '', 'caption' => '' ), $attr ) );
if ( 'html5' == $raindrops_document_type ) {
if ( 1 > (int) $width && empty( $caption ) )
return $val;
$capid = '';
if ( $id ) {
$id = esc_attr( $id );
$capid = 'id="figcaption_' . $id . '" ';
$id = 'id="' . $id . '" aria-labelledby="figcaption_' . $id . '" ';
}
$html = '
%4$s%6$s ';
return sprintf( $html, $id, esc_attr( $align ), ( 10 + (int) $width ), do_shortcode( $content ), $capid, $caption );
}
return $val;
}
}
/**
*
*
*
* @since 1.002
*/
if ( !function_exists( 'raindrops_featured_image' ) ) {
function raindrops_featured_image() {
global $post, $is_IE, $raindrops_featured_image_full_size;
if ( post_password_required() || !has_post_thumbnail() ) {
return;
}
/**
* Show featured image
*
*
*
*
*/
if ( true == $raindrops_featured_image_full_size ) {
$thumb = get_the_post_thumbnail( $post->ID, 'full' );
} else {
$thumb = get_the_post_thumbnail( $post->ID, 'single-post-thumbnail' );
}
if ( has_post_thumbnail() && isset( $thumb ) && $is_IE ) {
/* IE8 img element has width height attribute. and style max-width and height auto makes conflict expand height */
$thumbnailsrc = wp_get_attachment_image_src( get_post_thumbnail_id(), 'single-post-thumbnail' );
$thumbnailuri = esc_url( $thumbnailsrc[ 0 ] );
$thumbnailwidth = $thumbnailsrc[ 1 ];
if ( $thumbnailwidth > $content_width ) {
$thumbnailheight = $thumbnailsrc[ 2 ];
$ratio = round( RAINDROPS_SINGLE_POST_THUMBNAIL_HEIGHT / RAINDROPS_SINGLE_POST_THUMBNAIL_WIDTH, 2 );
$ie_height = round( $content_width * $ratio );
$thumbnail_title = basename( $thumbnailsrc[ 0 ] );
$thumbnail_title = esc_attr( $thumbnail_title );
$size_attribute = image_hwstring( $content_width, $ie_height );
echo '
';
echo '
';
echo '
';
} else {
echo '
';
echo $thumb;
echo '
';
}
} else {
$raindrops_post_thumbnail_src = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full', false, '' );
$flag = true;
if ( 'w3standard' == raindrops_warehouse( 'raindrops_style_type' ) || false == RAINDROPS_USE_FEATURED_IMAGE_LIGHT_BOX ) {
//Sorry w3standard css can not use CSS3 then remove light box
$flag = false;
}
if ( !empty( $thumb ) ) {
echo '
';
/* for light box */
if ( $flag ) {
echo '
';
echo '
Close ';
echo '
';
echo '
';
}
}
}
/**
* Add navigation link for post thumbnail
*
*
*
*
*/
if ( has_post_thumbnail() && true == RAINDROPS_USE_FEATURED_IMAGE_LIGHT_BOX ) {
$raindrops_html_piece = '
%2$s
';
printf( $raindrops_html_piece, get_attachment_link( get_post_thumbnail_id() ), esc_html__( 'Go to Attachment page', 'Raindrops' ) );
}
}
}
/**
* raindrops loop class
*
*
*
*
* ver 1.001
*/
if ( !function_exists( 'raindrops_loop_class' ) ) {
function raindrops_loop_class( $raindrops_loop_number, $raindrops_tile_post_id = '', $add_class = '' ) {
if ( is_front_page() || is_home() ) {
$id = get_option( 'page_on_front' );
$template_name = basename( get_page_template_slug( $id ), '.php' );
} elseif ( is_page() ) {
global $template;
$template_name = basename( $template, '.php' );
} else {
$template_name = '';
}
$str_class = '';
$raindrops_background = '';
if ( is_array( $add_class ) ) {
foreach ( $add_class as $class ) {
$str_class = ' ' . $class;
}
} else {
$str_class = ' ' . $add_class;
}
$post_formats = get_post_format_slugs();
foreach ( $post_formats as $key => $val ) {
if ( has_post_format( $val ) ) {
$str_class .= ' loop-post-format-' . $val;
}
}
$raindrops_loop_five = $str_class;
// if ( 'front-portfolio' == $template_name ) {
if ( 12 == $raindrops_loop_number ) {
$raindrops_loop_number = 0;
} elseif ( 0 == $raindrops_loop_number % 5 ) {
$raindrops_loop_five .= ' loop-five';
}
if ( !empty( $raindrops_tile_post_id ) ) {
$post_thumbnail_id = get_post_thumbnail_id( $raindrops_tile_post_id );
$raindrops_background = wp_get_attachment_image_src( $post_thumbnail_id, 'medium' );
list( $raindrops_background, $width, $height ) = $raindrops_background;
} else {
$raindrops_background = false;
}
if ( !$raindrops_background ) {
$raindrops_loop_five .= ' loop-item-show-allways';
} else {
$raindrops_background = 'style="background:url( ' . $raindrops_background . ' );background-size:cover;"';
}
// }
return array( $raindrops_loop_number, $raindrops_loop_five, $raindrops_background );
}
}
/**
*
*
*
* @since 1.103
*/
add_action( 'set_current_user', 'raindrops_postmeta_cap' );
if ( !function_exists( 'raindrops_postmeta_cap' ) ) {
function raindrops_postmeta_cap() {
if ( current_user_can( 'edit_pages' ) && RAINDROPS_CUSTOM_FIELD_CSS == true ) {
add_filter( 'auth_post_meta_css', '__return_true', 5 );
} else {
add_filter( 'auth_post_meta_css', '__return_false', 5 );
}
if ( current_user_can( 'edit_pages' ) && RAINDROPS_CUSTOM_FIELD_SCRIPT == true ) {
add_filter( 'auth_post_meta_javascript', '__return_true', 5 );
} else {
add_filter( 'auth_post_meta_javascript', '__return_false', 5 );
}
if ( current_user_can( 'edit_pages' ) && RAINDROPS_CUSTOM_FIELD_META == true ) {
add_filter( 'auth_post_meta_meta', '__return_true', 5 );
} else {
add_filter( 'auth_post_meta_meta', '__return_false', 5 );
}
}
}
/**
*
*
*
*
* @since 1.111
*/
if ( !class_exists( 'raindrops_unique_identifier_walker_nav_menu' ) ) {
class raindrops_unique_identifier_walker_nav_menu extends Walker_Nav_Menu {
function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
global $wp_query;
$classes = empty( $item->classes ) ? array() : (array) $item->classes;
$class_names = esc_attr( implode( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) ) );
// build html
$output .= '