This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_shortcode('skin', function (){ | |
$skin = isset($_GET['theme-switch']) ? esc_html($_GET['theme-switch']) : null; | |
if (empty($skin) && isset($_COOKIE['theme-switch'])) { | |
$skin = esc_html($_COOKIE['theme-switch']); | |
} | |
$url = get_permalink().'?'; | |
ob_start(); | |
?> | |
<select id="theme-switch" class="theme-switch-dropdown" onchange="document.cookie = this.options[this.selectedIndex].value;window.document.location.href='<?php echo $url; ?>'+this.options[this.selectedIndex].value;"> | |
<option value="theme-switch=reset" <?php the_option_selected($skin, null); ?>>▼デザインスキンを選択</option> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php //商品追加ショートコード | |
$before = '[rakuten search="商品名" kw="商品名" title="商品名"]'; | |
$after = ''; | |
?> | |
shortcodes[18] = new Array(); | |
shortcodes[18].title = '<?php echo __( '楽天商品リンク(独自追加)', THEME_NAME ); ?>'; | |
shortcodes[18].tag = '<?php echo $before.$msg.$after; ?>'; | |
shortcodes[18].before = '<?php echo $before; ?>'; | |
shortcodes[18].after = '<?php echo $after; ?>'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function get_rating_star_tag($rate, $max = 5, $number = false){ | |
$rate = floatval($rate); | |
$max = intval($max); | |
//数字じゃない場合 | |
if (!is_numeric($rate) || !is_numeric($max)) { | |
return $rate; | |
} | |
//レーティングが100より多い場合は多すぎるので処理しない | |
if ($rate > 100 && $max > 100) { | |
return $rate; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* RSS2 Feed Template for displaying RSS2 Posts feed. | |
* | |
* @package SmartNews | |
*/ | |
/** | |
* 寝ログ | |
* @author: yhira |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//本文中から移動しないスクリプトコード条件を追記する | |
add_filter('cocoon_exclude_script_movement_from_content', function($is_exclude, $script){ | |
return $is_exclude || includes_string($script, 'tradingview_embed_options'); | |
}, 10, 2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($){ | |
var siteTitle = $('#header .site-name-text').text(); | |
siteTitle = siteTitle.replace("Cocoonデモサイト", "Cocoon<br>デモサイト"); | |
$('#header .site-name-text').html(siteTitle); | |
})(jQuery); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php //アピールエリア | |
/** | |
* Cocoon WordPress Theme | |
* @author: yhira | |
* @link: https://wp-cocoon.com/ | |
* @license: http://www.gnu.org/licenses/gpl-2.0.html GPL v2 or later | |
*/ ?> | |
<?php //アピールエリアを表示するか | |
if (is_appeal_area_visible() && !is_amp()): ?> | |
<a href="<?php echo get_appeal_area_button_url(); ?>" class="appeal-wrap"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'get_toc_tag', get_toc_tag_custom, 10, 3 ); | |
if ( !function_exists( 'get_toc_tag_custom' ) ): | |
function get_toc_tag_custom($html, &$harray, $is_widget){ | |
if ($is_widget) { | |
return $html; | |
} | |
ob_start();?> | |
<div class="column-wrap column-2"> | |
<div class="column-left"> | |
<?php echo $html; ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" ?> | |
<ItemLookupResponse | |
xmlns="http://webservices.amazon.com/AWSECommerceService/2011-08-01"> | |
<OperationRequest> | |
<RequestId>187476be-951c-4d4f-a2b0-933d0ecb6220</RequestId> | |
<Arguments> | |
<Argument Name="AWSAccessKeyId" Value="XXXXXXXXXXXXXXXXXXXXXX"></Argument> | |
<Argument Name="AssociateTag" Value="XXXXXXX-22"></Argument> | |
<Argument Name="ItemId" Value="B00BJRU9IG"></Argument> | |
<Argument Name="Operation" Value="ItemLookup"></Argument> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function title_parts_custom( $title ){ | |
$site_name = trim( get_bloginfo('name') ); | |
$title['tagline'] = ''; | |
if(is_front_page()){ //フロントページ | |
//自由形式タイトルの場合 | |
if (is_free_front_page_title()) { | |
$title['title'] = esc_html( get_free_front_page_title() ); | |
} else {//自由形式でないとき | |
$title['title'] = $site_name; |