author.php
inc.php
- raindrops_indv_css
-
$css .= apply_filters( "raindrops_indv_css", $raindrops_indv_css );
add_filter( 'raindrops_indv_css', 'extend_raindrops_indv_css' ); function extend_raindrops_indv_css( $css ) { return $css.'#site-title span{color:yellow}'; }
- raindrops_embed_meta_pre
-
$must_first_css= apply_filters( 'raindrops_embed_meta_pre','');
add_filter( 'raindrops_indv_css', 'extend_raindrops_indv_css' ); function extend_raindrops_indv_css( $css ) { return $css.'#site-title span{font-family: \'Lobster\', cursive;color:red;}'; } add_filter( 'raindrops_embed_meta_pre', 'extend_raindrops_embed_meta_pre' ); function extend_raindrops_embed_meta_pre( $return_value ) { return '@import url(https://fonts.googleapis.com/css?family=Lobster);'; }
@import ルール等、スタイルの最初になければならない場合に使います。
- raindrops_embed_meta_css
-
$css= apply_filters( 'raindrops_embed_meta_css', $css );
date.php
- raindrops_month_list_post_count
-
$post_per_page = apply_filters( 'raindrops_month_list_post_count', $post_per_page_pre );
add_filter( 'raindrops_month_list_post_count', 'extend_raindrops_month_list_post_count', 99 ); function extend_raindrops_month_list_post_count( $number ) { return 10; }
月次アーカイブの、投稿の表示件数を変更します。
functions.php
- raindrops_load_text_domain
-
load_theme_textdomain( 'raindrops', apply_filters( 'raindrops_load_text_domain', get_template_directory() . '/languages' ) );
- raindrops_header_image_width
-
$raindrops_custom_header_width = apply_filters( 'raindrops_header_image_width', absint( raindrops_detect_header_image_size_clone( 'width' ) ) );
- raindrops_header_image_height
-
$raindrops_custom_header_height= apply_filters( 'raindrops_header_image_height', absint( raindrops_detect_header_image_size_clone( 'height' ) ) );
- raindrops_wp-head-callback
-
'wp-head-callback' => apply_filters( 'raindrops_wp-head-callback', 'raindrops_embed_meta' ),
- raindrops_custom_header_args
-
add_theme_support( 'custom-header', apply_filters( 'raindrops_custom_header_args', $raindrops_custom_header_args ) );
add_filter( 'raindrops_custom_header_args', 'extend_raindrops_custom_header_args' ); function extend_raindrops_custom_header_args( $args ) { $args['default-image']= '%1$s/images/wp3.jpg'; return $args; }
- raindrops_current_url
-
if ( ! function_exists( 'raindrops_current_url' ) ) { function raindrops_current_url() { $url= 'http'; $server_https= filter_input(INPUT_SERVER, 'HTTPS'); if ( ! is_null( $server_https ) && "on"== $server_https ) { $url= "https"; } $url .= "://"; $server_port= filter_input(INPUT_ENV,"SERVER_PORT", FILTER_VALIDATE_INT ); $server_name= filter_input(INPUT_ENV,"SERVER_NAME"); $request_uri= filter_input(INPUT_ENV,"REQUEST_URI"); if ( ! is_null( $server_port ) && 80 !== $server_port ) { $url .= $server_name . ":" . $server_port . $request_uri; } else { $url .= $server_name . $request_uri; } $url= esc_url( $url ); return apply_filters( 'raindrops_current_url', $url ); } }
- raindrops_post_formats_args
-
$raindrops_post_formats_args= apply_filters( 'raindrops_post_formats_args', array( 'aside', 'gallery', 'chat', 'link', 'image', 'status', 'quote', 'video' ) );
このフィルタは、うまく動作しないかもしれません。(1.344)
チャイルドテーマなどで、Raindropsの投稿フォーマットのサポートを変更する必要がある場合は、チャイルドテーマのfunctions.php以下のように記述してください。
$raindrops_post_formats_args= array( 'aside', 'video' ); add_theme_support('post-formats', $raindrops_post_formats_args );
- raindrops_custom_background_args
-
$raindrops_custom_background_args= apply_filters( 'raindrops_custom_background_args', array(
このフィルタは、うまく動作しないかもしれません。(1.344)
チャイルドテーマなどで、Raindropsの投稿フォーマットのサポートを変更する必要がある場合は、チャイルドテーマのfunctions.php以下のように記述してください。
$raindrops_custom_background_args= array( 'default-color' => '#ffffff', 'default-image' => '', ) ; add_theme_support( 'custom-background', $raindrops_custom_background_args );
- raindrops_post_thumbnails_args
-
add_theme_support( 'post-thumbnails', apply_filters( 'raindrops_post_thumbnails_args', $raindrops_post_thumbnails_args ) );
このフィルタは、うまく動作しないかもしれません。(1.344)
チャイルドテーマなどで、Raindropsの投稿フォーマットのサポートを変更する必要がある場合は、チャイルドテーマのfunctions.php以下のように記述してください。
$raindrops_post_thumbnails_args= array( 'post', 'page' ); add_theme_support( 'post-thumbnails', apply_filters( 'raindrops_post_thumbnails_args', $raindrops_post_thumbnails_args ) );
- raindrops_content_width
-
$content_width= apply_filters( 'raindrops_content_width', raindrops_content_width_clone() );
このフィルタは、うまく動作しないかもしれません。(1.344)
チャイルドテーマなどで、$content_widthを指定する場合は、
チャイルドテーマの,functions.phpに
$content_width= 400;
を指定してください。
- raindrops_add_body_class
-
return apply_filters( "raindrops_add_body_class", $classes );
add_filter( 'raindrops_add_body_class', 'extend_raindrops_add_body_class' ); function extend_raindrops_add_body_class( $classes ) { $classes[]= 'hello-world'; return $classes; }
- raindrops_posted_in_category
-
$exclude_category_conditionals= apply_filters( 'raindrops_posted_in_category',array( 'is_category'=> 'raindrops_post_category_relation' ) );
- raindrops_posted_in_tag
-
$exclude_tag_conditional = apply_filters( 'raindrops_posted_in_tag',array( 'is_tag'=> '' ) );
- raindrops_posted_in
-
echo apply_filters( "raindrops_posted_in", $result );
- raindrops_comments_link
-
return apply_filters( 'raindrops_comments_link', $result, get_comments_link(), $raindrops_comment_number, $raindrops_comment_string );
- raindrops_post_date
-
$entry_date_html= apply_filters( 'raindrops_post_date', $entry_date_html, $date_text, absint( $post->ID ) );
- raindrops_posted_on_result
-
$result= apply_filters('raindrops_posted_on_result', $result );
- raindrops_warehouse
-
return apply_filters( "raindrops_warehouse", raindrops_warehouse_clone( $name , $property, $fallback ) );
- raindrops_upload_image_parser_hd
-
return apply_filters( 'raindrops_upload_image_parser_hd', 'background:url( ' . get_stylesheet_directory_uri() . '/images/' . $filename . ' );background-repeat:repeat-x;' );
- raindrops_upload_image_parser_ft
-
return apply_filters( 'raindrops_upload_image_parser_ft', 'background:url( ' . get_stylesheet_directory_uri() . '/images/' . $filename . ' );background-repeat:repeat-x;' );
- raindrops_upload_image_parser_prop
-
return apply_filters( 'raindrops_upload_image_parser_prop', 'background:url( ' . $uri . ' );background-repeat:' . $style . ';background-position:' . $left . 'px ' . $top . 'px;min-height:' . $height . 'px;' );
- raindrops_gradient_single
-
return apply_filters( "raindrops_gradient_single", raindrops_gradient_single_clone( $i, $order ) );
- raindrops_gradient
-
return apply_filters( "raindrops_gradient", raindrops_gradient_clone( $selector ) );
- raindrops_comment_form
-
return apply_filters( "raindrops_comment_form", $form );
- raindrops_emoji_collection
-
return apply_filters( 'raindrops_emoji_collection', $emoji_code, $condition );
- raindrops_embed_css_pre
-
$css= apply_filters('raindrops_embed_css_pre', '' );
- raindrops_custom_link_color_val
-
$color= apply_filters( 'raindrops_custom_link_color_val', $color );
- raindrops_custom_link_color
-
return apply_filters( "raindrops_custom_link_color", $css );
- raindrops_embed_meta_echo
-
echo apply_filters( 'raindrops_embed_meta_echo', $result );
- raindrops_esc_custom_field_meta
-
return apply_filters( 'raindrops_esc_custom_field_meta', $meta, $meta_input );
- raindrops_esc_custom_field_meta_helper
-
return apply_filters( 'raindrops_esc_custom_field_meta_helper', $content );
- raindrops_esc_custom_field_javascript
-
return apply_filters( 'raindrops_esc_custom_field_javascript', $javascript, $script );
Raindropsテーマで、カスタムフィールド フィールド名「javascript」に入力したスクリプトは、デフォルトでは利用できません。
必要な場合は、functions.php の冒頭で
define( 'RAINDROPS_CUSTOM_FIELD_SCRIPT', true );
を指定する必要があります。
- raindrops_next_prev_excluded_categories
-
$exclude_category = apply_filters( 'raindrops_next_prev_excluded_categories', '' );
- raindrops_prev_next_post
-
echo apply_filters( "raindrops_prev_next_post", $html );
- raindrops_archive_year_label
-
$year_label = apply_filters( 'raindrops_archive_year_label', $year );
- raindrops_archive_month_label
-
$month_label= apply_filters( 'raindrops_archive_month_label', $mon );
- raindrops_archive_day_label
-
$day_label= apply_filters( 'raindrops_archive_day_label', $day );
- raindrops_month_list_post_count
-
$post_per_page = apply_filters( 'raindrops_month_list_post_count', $post_per_page );
- raindrops_month_list_year_name
-
$year_name= apply_filters( 'raindrops_month_list_year_name', $y );
- raindrops_loop_title_page_title
-
$page_title= apply_filters( 'raindrops_loop_title_page_title', $page_title );
- raindrops_archive_name
-
printf( '
- %1$s %2$s ', apply_filters( 'raindrops_archive_name', $page_title ), apply_filters( 'raind...
- raindrops_yui_class_modify
-
return apply_filters( 'raindrops_yui_class_modify', $yui_inner_layout );
3カラム表示の場合の、エキストラサイドバー(.rsidebar)の幅のコントロール用のフィルタ
カテゴリアーカイブ(3col)の場合 サイドバー幅を50%に変更する
add_filter( 'raindrops_yui_class_modify', 'extend_raindrops_yui_class_modify' ); function extend_raindrops_yui_class_modify( $options ) { if ( is_category() ) { return 'yui-g'; } return $options; }
エキストラサイドバーの幅設定クラス
- raindrops_post_thumbnail_size_main_query
-
$raindrops_post_thumbnail_size= apply_filters( 'raindrops_post_thumbnail_size_main_query', array( 48, 48 ), $id, get_post_class( '', $id ) );
Example
アイキャッチ画像サイズの変更 Theme Support
- raindrops_title_thumbnail
-
$thumbnail= apply_filters('raindrops_title_thumbnail', $thumbnail ,'', '');
このフィルタは、アイキャッチ画像が設定されていない投稿に、アイキャッチ画像を追加します。
投稿アーカイブや、カテゴリーアーカイブなどで表示します。必要な場合は、チャイルドテーマのfunctions.php等に以下のPHPコードを追加します。
add_filter( 'raindrops_title_thumbnail', 'extend_raindrops_title_thumbnail', 10, 3 ); function extend_raindrops_title_thumbnail( $thumbnail, $before_html, $after_html ) { if ( in_the_loop() ) { return $before_html . '<img src="http://example.com/images/example.jpg" width="48" height="48" />' . $after_html; } return $thumbnail; }
- raindrops_entry_title_text_elements_allow
-
$raindrops_entry_title_text_allow= apply_filters( 'raindrops_entry_title_text_elements_allow', true );
- raindrops_fallback_title
-
return apply_filters( 'raindrops_fallback_title', $title );
- raindrops_header_image_width
-
$raindrops_header_image_width = apply_filters( 'raindrops_header_image_width', raindrops_detect_header_image_size( 'width' ) );
- raindrops_header_image_description_attr
-
$text_attr = apply_filters( 'raindrops_header_image_description_attr', $text_attr );
- raindrops_header_image
-
return apply_filters( "raindrops_header_image", $html );
- raindrops_header_image_background_image
-
apply_filters( 'raindrops_header_image_background_image', $background_property ),
- raindrops_header_image_background_style
-
apply_filters( 'raindrops_header_image_background_style', esc_html( $style ) ),
- raindrops_header_image_css
-
return apply_filters( "raindrops_header_image_css", $css );
- raindrops_header_image_contents
-
$elements = '
' . apply_filters( 'raindrops_header_image_contents', '' ) . '';%2$s
使用例
ヘッダー画像内にリンクなどを埋め込む方法
- raindrops_header_image_elements
-
return apply_filters( "raindrops_header_image_elements", $elements );
- raindrops_header_image_home_url
-
return apply_filters( "raindrops_header_image_home_url", $elements );
- raindrops_site_description
-
return apply_filters( "raindrops_site_description", $html );
- raindrops_site_title_class
-
apply_filters( 'raindrops_site_title_class', 'h1' )
- raindrops_site_title
-
return apply_filters( "raindrops_site_title", $html );
- raindrops_column_controller
-
$filter_column= apply_filters( 'raindrops_column_controller', '', $post->ID );
- raindrops_color_type_custom
-
$filter_custom_color= apply_filters( 'raindrops_color_type_custom', '', $post->ID );
- raindrops_header_image_ratio
-
'ratio'=> apply_filters( 'raindrops_header_image_ratio', $ratio ),
- raindrops_custom_width
-
return apply_filters( "raindrops_custom_width", $custom_content_width );
- raindrops_is_fluid
-
return apply_filters( "raindrops_is_fluid", $fluid_width );
- raindrops_base_font_size
-
$raindrops_base_font_size= apply_filters( 'raindrops_base_font_size', $raindrops_base_font_size ); //px size
- raindrops_is_fixed
-
return apply_filters( "raindrops_is_fixed", $custom_fixed_width );
- raindrops_gallerys_css
-
return apply_filters( "raindrops_gallerys_css", $raindrops_gallerys );
- raindrops_entry_title
-
echo apply_filters( 'raindrops_entry_title', $html );
- raindrops_entry_title_class
-
$html= sprintf( $html, apply_filters('raindrops_entry_title_class', 'h2 entry-title'), the_title( '', '', false ), $raindrops_unique_label, $thumbnail );
- raindrops_maybe_multibyte
-
$filter_value= apply_filters( 'raindrops_maybe_multibyte', 0 , $text );
- raindrops_html_excerpt_with_elements_length
-
$length = apply_filters( 'raindrops_html_excerpt_with_elements_length', $length );
- raindrops_html_excerpt_with_elements_allow_html
-
$allow_html = apply_filters( 'raindrops_html_excerpt_with_elements_allow_html', $allow_html );
-
return apply_filters('the_excerpt', get_the_excerpt() );
- raindrops_html_excerpt_with_elements
-
return apply_filters( 'raindrops_html_excerpt_with_elements', $truncate, __FUNCTION__ );
- raindrops_the_excerpt
-
$excerpt= apply_filters( 'raindrops_the_excerpt', $excerpt, __FUNCTION__ );
- raindrops_entry_content
-
echo apply_filters( 'raindrops_entry_content', $excerpt );
- raindrops_next_prev_links
-
echo apply_filters( 'raindrops_next_prev_links', $html, $position );
- raindrops_replace_oembed_link_to_icon_icon
-
$icon_html .= apply_filters( 'raindrops_replace_oembed_link_to_icon_icon', $icon_html_1 );
- raindrops_replace_oembed_link_to_icon_replace
-
$replaced_content = apply_filters( 'raindrops_replace_oembed_link_to_icon_replace', $replaced_content, $icon_html );
- raindrops_replace_oembed_link_to_icon_removed
-
$link_removed_content = apply_filters( 'raindrops_replace_oembed_link_to_icon_removed', $link_removed_content, $icon_html );
- raindrops_recent_posts_thumb_size
-
$thumbnail_size = apply_filters( 'raindrops_recent_posts_thumb_size', array( 125, 125 ) );
- raindrops_recent_posts_li
-
$html = apply_filters( 'raindrops_recent_posts_li', $html );
- raindrops_recent_posts_title
-
$result = apply_filters( 'raindrops_recent_posts_title', $result );
- raindrops_recent_post_thumbnail_default_uri
-
$thumbnail .= '
- raindrops_new_period
-
$raindrops_period = apply_filters( 'raindrops_new_period', 3 );
- raindrops_recent_posts
-
return apply_filters( 'raindrops_recent_posts', $result );
- raindrops_category_posts_thumb_size
-
$thumbnail_size = apply_filters( 'raindrops_category_posts_thumb_size', array( 125, 125 ) );
- raindrops_category_post_thumbnail_default_uri
-
$thumbnail .= '
- raindrops_category_posts
-
return apply_filters( 'raindrops_category_posts', $result );
- raindrops_tag_posts_thumb_size
-
$thumbnail_size = apply_filters( 'raindrops_tag_posts_thumb_size', array( 125, 125 ) );
- raindrops_tag_post_thumbnail_default_uri
-
$thumbnail .= '
- raindrops_tag_posts
-
return apply_filters( 'raindrops_tag_posts', $result );
- raindrops_archive_year_label
-
$year_label = apply_filters( 'raindrops_archive_year_label', esc_html( $thisyear ) );
- raindrops_featured_image_enable
-
$raindrops_featured_image_enable= apply_filters( 'raindrops_featured_image_enable', true );
- raindrops_chat_filter
-
return apply_filters( 'raindrops_chat_filter', sprintf( '
- %1$s
', $result ) );
- raindrops_link_unique
-
return apply_filters( 'raindrops_link_unique', $html, $text, $id, $class );
- raindrops_tile_title_more
-
$title = wp_html_excerpt( $title, apply_filters( 'raindrops_tile_title_length', 40 ), apply_filters( 'raindrops_tile_title_more', '...' ) );
- raindrops_add_more_before
-
$pre = apply_filters( 'raindrops_add_more_before', '' );
- raindrops_add_more_after
-
$after = apply_filters( 'raindrops_add_more_after', '' );
- raindrops_add_more
-
return apply_filters( 'raindrops_add_more', $content, $more );
- raindrops_status_bar_top
-
echo apply_filters( 'raindrops_status_bar_top', $link_to_top );
- the_permalink
-
$permalink = apply_filters( 'the_permalink', get_permalink( $child->ID ) );
- raindrops_page_auto_include_template
-
$page_page_auto_include_template= apply_filters( 'raindrops_page_auto_include_template', 'front-page.php' );
- raindrops_add_complementary_color
-
$raindrops_css = apply_filters( 'raindrops_add_complementary_color', $raindrops_css, $raindrops_link_color, $raindrops_complementary_color );
- raindrops_color_type_style_buffer
-
$style= apply_filters('raindrops_color_type_style_buffer',raindrops_embed_css());
- raindrops_copyright_text
-
$raindrops_copyright_text= sprintf( apply_filters( 'raindrops_copyright_text' , '©%1$s '. $raindrops_current_theme_name. ' ') , date( "Y" ) );
- raindrops_editor_styles_callback
-
echo apply_filters( 'raindrops_editor_styles_callback', $result );
- raindrops_archive_description_length
-
$raindrops_archive_description_length= apply_filters( 'raindrops_archive_description_length', 115 );
- raindrops_add_header_archive_description
-
echo apply_filters( 'raindrops_add_header_archive_description', $result );
- raindrops_post_category_relation
-
return apply_filters( 'raindrops_post_category_relation', rtrim( $result, ' » ' ) );
- raindrops_article_wrapper_class
-
return apply_filters( 'raindrops_article_wrapper_class', $result, $class );
- google_fonts_endpoint_url
-
$url = apply_filters( 'google_fonts_endpoint_url', '//fonts.googleapis.com/css' );
- raindrops_site_title_in_header_image_css
-
$style= apply_filters( 'raindrops_site_title_in_header_image_css','', '#header-image #site-title, #raindrops_metaslider #site-title' );
- raindrops_post_password_form_html5
-
$output= apply_filters( 'raindrops_post_password_form_html5', $output );
- raindrops_color_pallet_tagcloud
-
return $css . apply_filters( 'raindrops_color_pallet_tagcloud', $result );