CSS}}if (! function_exists('eco_product_categories_shortcode')){function eco_product_categories_shortcode($atts){$d=eco_cat_render_defaults();$atts=shortcode_atts(array('mode'=>'auto',// auto|cards|select 'cards_per_cat'=>(string)$d['cards_per_cat'],'select_per_cat'=>(string)$d['select_per_cat'],'orderby_cards'=>(string)$d['orderby_cards'],'order_cards'=>(string)$d['order_cards'],'use_yomi'=>(string)$d['use_yomi'],),$atts,'eco_product_categories');$mode=strtolower(trim($atts['mode']));if ($mode==='auto'){$mode=is_page('product') ? 'cards':'select'}if ($mode !=='cards' && $mode !=='select') return '';$flush=eco_flush_requested();$paged=eco_current_paged();$args=$d;$args['cards_per_cat']=max(1, (int)$atts['cards_per_cat']);$args['select_per_cat']=max(1, (int)$atts['select_per_cat']);$args['orderby_cards']=sanitize_key($atts['orderby_cards']);$args['order_cards']=strtoupper($atts['order_cards'])==='ASC' ? 'ASC' :'DESC';$args['use_yomi']=((string)$atts['use_yomi']==='1') ? 1 :0;$cat_ids=eco_get_category_ids_cached($args,$flush);if (empty($cat_ids)) return '

カテゴリが見つかりません。

';$ver=ECO_CAT_RENDER_VER;$out='';if ($mode==='cards'){$out .=eco_cards_css();$out .='
';foreach ($cat_ids as $term_id){$category=get_category((int)$term_id);if (!$category || is_wp_error($category)) continue;$cache_key='eco_cards_' . $ver . '_' . (int)$category->term_id . '_p' . (int)$paged . '_' . md5(serialize(array($args['cards_per_cat'],$args['orderby_cards'],$args['order_cards'])));if ($flush) delete_transient($cache_key);$html=get_transient($cache_key);if (false===$html){$q=new WP_Query(array('posts_per_page'=>$args['cards_per_cat'],'cat'=>(int)$category->term_id,'paged'=>(int)$paged,'orderby'=>$args['orderby_cards'],'order'=>$args['order_cards'],'no_found_rows'=>true,'ignore_sticky_posts'=>true,));ob_start();if ($q->have_posts()):?>
name);?>
have_posts()):$q->the_post();?>
';return $out}foreach ($cat_ids as $term_id){$category=get_category((int)$term_id);if (!$category || is_wp_error($category)) continue;$cache_key='eco_select_' . $ver . '_' . (int)$category->term_id . '_' . md5(serialize(array($args['select_per_cat'],$args['use_yomi'],$args['post_type'])));if ($flush) delete_transient($cache_key);$html=get_transient($cache_key);if (false===$html){$query_args=array('post_type'=>$args['post_type'],'posts_per_page'=>(int)$args['select_per_cat'],'cat'=>(int)$category->term_id,'orderby'=>'title',// 実際のSQL orderbyは eco_yomi_posts_clauses が差し替える 'order'=>'ASC','no_found_rows'=>true,'ignore_sticky_posts'=>true,'update_post_meta_cache'=>false,'update_post_term_cache'=>false,'eco_yomi_sort'=>$args['use_yomi'] ? 1:0,);if ($args['use_yomi']) add_filter('posts_clauses','eco_yomi_posts_clauses',10,2);$q=new WP_Query($query_args);if ($args['use_yomi']) remove_filter('posts_clauses','eco_yomi_posts_clauses',10);ob_start();?>
name);?>

'name','order'=>'ASC','hide_empty'=>1,'hierarchical'=>1,'exclude'=>$d['exclude_categories'],'taxonomy'=>'category',));set_transient($cat_key,$categories,(int)$d['ttl'])}if (empty($categories)) return '

カテゴリが見つかりません。

';//=====現在表示中のカテゴリを推定(カテゴリページならそのterm、違うなら先頭) $selected_cat=0;if (is_category()){$selected_cat=(int) get_queried_object_id()}if ($selected_cat <=0){$selected_cat=(int) $categories[0]->term_id}//=====現在カテゴリ名(確実版) $current_cat=get_term($selected_cat,'category');$current_cat_name=(!is_wp_error($current_cat) && $current_cat && !empty($current_cat->name)) ? $current_cat->name :'';//=====投稿候補(カテゴリ内)を取得(キャッシュ) $post_key="eco_cpdo_posts_{$selected_cat}_{$ver}";if ($flush) delete_transient($post_key);$post_options=get_transient($post_key);if (false===$post_options){$q_args=array('posts_per_page'=>(int)$d['max_post_options'],'cat'=>(int)$selected_cat,'orderby'=>'title',// SQLは eco_yomi_posts_clauses が差し替え 'order'=>'ASC','no_found_rows'=>true,'ignore_sticky_posts'=>true,'fields'=>'ids','eco_yomi_sort'=>1,// yomiを有効化);add_filter('posts_clauses','eco_yomi_posts_clauses',10,2);$q=new WP_Query($q_args);remove_filter('posts_clauses','eco_yomi_posts_clauses',10);$post_options=array();if (! empty($q->posts)){foreach($q->posts as $pid){$post_options[]=array('id'=>(int)$pid,'title'=>get_the_title($pid),'link'=>get_permalink($pid),)}}set_transient($post_key,$post_options,(int)$d['ttl'])}//=====UI出力 ob_start();?>
30,// 0なら投稿一覧は出さない。例:5 で5件出す],$atts);$target_page_id=10608;// 固定ページAのIDに置換 $category_ids=[7811];// [10,20,30]表示したいカテゴリIDに置換 $show=false;if (is_page($target_page_id)) $show=true;if (is_single()){$post_id=get_the_ID();foreach ($category_ids as $cid){if (has_category($cid,$post_id)){$show=true;break}}}if (!$show) return '';$out='
';return $out});if (! function_exists('eco_profile_follow_buttons_shortcode')){function eco_profile_follow_buttons_shortcode($atts=array()){$atts=shortcode_atts(array('x'=>'https://x.com/eco_imagine_com','instagram'=>'https://www.instagram.com/eco_imagine/','facebook'=>'https://www.facebook.com/eco.imagine/','line'=>'https://lin.ee/xr49ATr','pinterest'=>'https://jp.pinterest.com/eco_imagine_com/','hatena'=>'https://ameblo.jp/eco-imagine-com/','amazon'=>'https://www.eco-imagine.com/amazon/','class'=>'',),$atts,'profile_follow_buttons');$buttons=array();if (! empty($atts['x'])){$buttons[]=array('class'=>'eco-follow-x','url'=>esc_url(https://www.eco-imagine.com/product/wp-content/themes/cocoon-child-master/$atts['x']),'label'=>'X','icon'=>'X','aria'=>'Xをフォロー',)}if (! empty($atts['instagram'])){$buttons[]=array('class'=>'eco-follow-instagram','url'=>esc_url(https://www.eco-imagine.com/product/wp-content/themes/cocoon-child-master/$atts['instagram']),'label'=>'Instagram','icon'=>'IG','aria'=>'Instagramを見る',)}if (! empty($atts['facebook'])){$buttons[]=array('class'=>'eco-follow-facebook','url'=>esc_url(https://www.eco-imagine.com/product/wp-content/themes/cocoon-child-master/$atts['facebook']),'label'=>'Facebook','icon'=>'f','aria'=>'Facebookを見る',)}if (! empty($atts['line'])){$buttons[]=array('class'=>'eco-follow-line','url'=>esc_url(https://www.eco-imagine.com/product/wp-content/themes/cocoon-child-master/$atts['line']),'label'=>'LINE公式','icon'=>'LINE','aria'=>'LINE公式アカウントを見る',)}if (! empty($atts['pinterest'])){$buttons[]=array('class'=>'eco-follow-pinterest','url'=>esc_url(https://www.eco-imagine.com/product/wp-content/themes/cocoon-child-master/$atts['pinterest']),'label'=>'Pinterest','icon'=>'P','aria'=>'Pinterestを見る',)}if (! empty($atts['hatena'])){$buttons[]=array('class'=>'eco-follow-hatena','url'=>esc_url(https://www.eco-imagine.com/product/wp-content/themes/cocoon-child-master/$atts['hatena']),'label'=>'ブログ','icon'=>'B!','aria'=>'ブログを見る',)}if (! empty($atts['amazon'])){$buttons[]=array('class'=>'eco-follow-amazon','url'=>esc_url(https://www.eco-imagine.com/product/wp-content/themes/cocoon-child-master/$atts['amazon']),'label'=>'Amazon','icon'=>'A','aria'=>'Amazonページを見る',)}if (empty($buttons)){return ''}$wrap_class='eco-follow-links';if (! empty($atts['class'])){$wrap_class .=' ' . sanitize_html_class($atts['class'])}ob_start();?>

NOT FOUND

投稿が見つかりませんでした。