芝麻web文件管理V1.00
编辑当前文件:/home/r5772835/public_html/rigato.ycreate.site/wp-content/themes/jstork/library/shortcode.php
[' => '[', ']' => ']', ']
' => ']' ); $content = strtr($content, $array); return $content; } add_filter('the_content', 'shortcode_empty_paragraph_fix'); // 関連記事を呼び出す function kanrenFunc($atts , $content = null) { $postid = (isset($atts['postid'])) ? esc_attr($atts['postid']) : null; $pageid = (isset($atts['pageid'])) ? esc_attr($atts['pageid']) : null; if($postid || $pageid) { $postids = (explode(',',$postid)); $datenone = (isset($atts['date'])) ? esc_attr($atts['date']) : null; $order = (isset($atts['order'])) ? esc_attr($atts['order']) : "DESC"; $orderby = (isset($atts['orderby'])) ? esc_attr($atts['orderby']) : "post_date"; $labelclass = isset($atts['label']) ? ' labelnone' : ""; $target = isset($atts['target']) ? ' target="_blank"' : ""; $echo =""; $args = array( "post_type" => array('post','page'), 'posts_per_page' => -1, 'post__in' => $postids, 'page_id' => $pageid, 'orderby' => $orderby, 'order' => $order, 'post_status' => 'publish', 'suppress_filters' => true, 'ignore_sticky_posts' => true, 'no_found_rows' => true ); $the_query = new WP_Query( $args ); if ( $the_query->have_posts() ) { while ( $the_query->have_posts() ) { $the_query->the_post(); $post_id =""; $url = esc_url(get_permalink()); if(has_post_thumbnail()){ $postimg = '
' .get_the_post_thumbnail($post_id, 'home-thum'). '
';} else { $postimg = ""; } if(!$datenone && !$pageid){ $postdate = '
' . get_the_date() . '
';} else { $postdate = null; } $postttl = '
' . esc_attr(get_the_title()) . '
'; $echo .= '
' .$postimg. '
' . $postttl . $postdate . '
'; } // LOOP END wp_reset_postdata(); } return $echo; } else { return null; } } add_shortcode('kanren','kanrenFunc'); // 関連記事を呼び出す(ラベル無し) function kanren2Func($atts , $content = null) { $postid = (isset($atts['postid'])) ? esc_attr($atts['postid']) : null; $pageid = (isset($atts['pageid'])) ? esc_attr($atts['pageid']) : null; if($postid || $pageid) { $postids = (explode(',',$postid)); $datenone = (isset($atts['date'])) ? esc_attr($atts['date']) : null; $order = (isset($atts['order'])) ? esc_attr($atts['order']) : "DESC"; $orderby = (isset($atts['orderby'])) ? esc_attr($atts['orderby']) : "post_date"; $target = isset($atts['target']) ? ' target="_blank"' : ""; $echo =""; $args = array( "post_type" => array('post','page'), 'posts_per_page' => -1, 'post__in' => $postids, 'page_id' => $pageid, 'orderby' => $orderby, 'order' => $order, 'post_status' => 'publish', 'suppress_filters' => true, 'ignore_sticky_posts' => true, 'no_found_rows' => true ); $the_query = new WP_Query( $args ); if ( $the_query->have_posts() ) { while ( $the_query->have_posts() ) { $the_query->the_post(); $post_id =""; $url = esc_url(get_permalink()); if(has_post_thumbnail()){ $postimg = '
' .get_the_post_thumbnail($post_id, 'home-thum'). '
';} else { $postimg = ""; } if(!$datenone && !$pageid){ $postdate = '
' . get_the_date() . '
';} else { $postdate = null; } $postttl = '
' . esc_attr(get_the_title()) . '
'; $echo .= '
' .$postimg. '
' . $postttl . $postdate . '
'; } // LOOP END wp_reset_postdata(); } return $echo; } else { return null; } } add_shortcode('kanren2','kanren2Func'); //グリッド wrap function colwrapFunc( $atts, $content = null ) { $class = (isset($atts['class'])) ? esc_attr($atts['class']) : null; return '
' . do_shortcode($content) . '
'; } add_shortcode('colwrap', 'colwrapFunc'); //グリッド デスクトップ・ダブレット2カラム 以下1カラム function col2Func( $atts, $content = null ) { extract( shortcode_atts( array( 'class' => '', ), $atts ) ); return '
' . do_shortcode($content) . '
'; } add_shortcode('col2', 'col2Func'); //グリッド デスクトップ・タブレット3カラム 以下1カラム function col3Func( $atts, $content = null ) { return '
' . do_shortcode($content) . '
'; } add_shortcode('col3', 'col3Func'); // CTA function ctainnerFunc( $atts, $content = null ) { return '
' . do_shortcode($content) . '
'; } add_shortcode('cta_in', 'ctainnerFunc'); //CTA COPYWRITING function ctacopyFunc( $atts, $content = null ) { extract( shortcode_atts( array( 'class' => '', ), $atts ) ); return '
' . $content . '
'; } add_shortcode('cta_ttl', 'ctacopyFunc'); // CTAボタン function ctabtnFunc( $atts, $content = null ) { extract( shortcode_atts( array( 'link' => '', ), $atts ) ); return '
' . $content . '
'; } add_shortcode('cta_btn', 'ctabtnFunc'); // 補足説明・注意 function asideFunc( $atts, $content = null ) { $type = (isset($atts['type'])) ? esc_attr($atts['type']) : null; return '
' . do_shortcode($content) . '
'; } add_shortcode('aside', 'asideFunc'); // ボタン function btnFunc( $atts, $content = null ) { $class = (isset($atts['class'])) ? esc_attr($atts['class']) : null; return '
' . $content . '
'; } add_shortcode('btn', 'btnFunc'); //吹き出し function voiceFunc( $atts, $content = null ) { $icon = (isset($atts['icon'])) ? esc_attr($atts['icon']) : null; $type = (isset($atts['type'])) ? esc_attr($atts['type']) : null; $name = (isset($atts['name'])) ? esc_attr($atts['name']) : null; return '
' . $name . '
' . do_shortcode($content) . '
'; } add_shortcode('voice', 'voiceFunc'); // コンテンツボックス function contentboxFunc($atts , $content = null) { if($atts && $content) { $class = (isset($atts['class'])) ? esc_attr($atts['class']) : null; $title = (isset($atts['title'])) ? esc_attr($atts['title']) : null; if(!$title && $class) { return '
' . do_shortcode($content) . '
'; } elseif($title && $class) { return '
' . $title . '
'. do_shortcode($content) .'
'; } } } add_shortcode('box','contentboxFunc');