Commit 6475e1de by Orine Matsui

セミナー一覧・書籍一覧追加

parent fbe23a4a
......@@ -146,6 +146,11 @@ h2.heading-main-archive {font-size: 1.8rem;margin-bottom: 16px;}
.widget.widget_tag_cloud a {border: none!important;font-size: 1.4rem!important;border-radius: 0;background-color: #eee;font-family: YakuHanMPs,"ヒラギノ明朝 ProN","Hiragino Mincho ProN",YuMincho,"Yu Mincho","游明朝体","Sawarabi Mincho",sans-serif!important;font-weight: 600;}
.widget.widget_tag_cloud a::before {display: none!important;}
.widget.xili_tdtc_widget a {display: inline-block;border: none!important;font-size: 1.4rem!important;border-radius: 0;background-color: #eee;font-family: YakuHanMPs,"ヒラギノ明朝 ProN","Hiragino Mincho ProN",YuMincho,"Yu Mincho","游明朝体","Sawarabi Mincho",sans-serif!important;font-weight: 600;padding: 10px;margin: 0 5px 5px 0;transition: .15s;line-height: 1.35;}
.widget.xili_tdtc_widget a::before {display: none!important;}
@media only screen and (max-width: 767px) {
.pickup3__box {flex-direction: column;}
.pickup3__box .pickup3__item {display: flex;flex-direction: row;width: 100%;}
......@@ -254,15 +259,100 @@ single.php
/* afRank */
.content .afRank li:before,
.content .afTagBox__star {display: none;}
.content .afRank .afTagBox__header, .widgetAfRank .widgetAfTag__header {padding-left: 0;}
/* balloon */
.content .balloon .balloon__text.balloon__blue {background-color: #eaf6fe;}
.content .balloon .balloon__text-right.balloon__blue:before {border-right-color: #eaf6fe;}
.content .balloon .balloon__text-left.balloon__blue:before {border-left-color: #eaf6fe;}
.content .balloon .balloon__text {padding: 2rem;}
@media only screen and (max-width: 767px) {
.content .balloon .balloon__img {float: inherit; margin-left: 0; margin-right: 0;margin-bottom: 30px;}
.content .balloon .balloon__text, .content .gallery-item {float: inherit;}
.content .balloon .balloon__text {max-width: 100%;}
.content .balloon .balloon__img.balloon__img-right {float: right;}
.content .balloon .balloon__text-right::before,
.content .balloon-boder .balloon__text-right:after {transform: rotate(90deg);}
.content .balloon .balloon__text-left::before,
.content .balloon-boder .balloon__text-left:after {transform: rotate(-90deg);}
.content .balloon .balloon__text::before{top: -20px;}
.content .balloon-boder .balloon__text:after{top: -19px;}
.content .balloon .balloon__text-right::before {left: 20px;}
.content .balloon-boder .balloon__text-right:after {left: 20px;}
.content .balloon .balloon__text-left::before {right: 20px;}
.content .balloon-boder .balloon__text-left:after {right: 20px;}
}
/* afRank */
.content .afRank li:before,
.widgetAfRank li:before,
.afTagBox__star,
.afTagBox__number:before,
.afTagBox__number:after {display: none!important;}
.content .afRank .afTagBox__header, .widgetAfRank .widgetAfTag__header {padding-left: 0;}
.widgetAfTag__contentBox {display: block;margin-bottom: 10px;}
.widget_fit_tagrank_class .heading-widgetsimple {
font-size: 2.4rem!important;
border-bottom: 1px solid #191919;
padding-bottom: 6px!important;
margin-bottom: 32px!important;
}
.afTagBox,
.afTagBox__contentBox {display: block!important;border: none!important;}
.widgetAfRank {display: flex;flex-direction: row;}
.widgetAfRank li {width: 32%;margin: 0 2% 0 0;}
.widgetAfRank li:nth-child(3n) {margin-right: 0;}
.widgetAfRank .widgetAfTag__banner {width: 100%;}
.seminarList h2.heading-secondary,
.bookList h2.heading-secondary {color: #191919;border-color: #191919;}
.seminarList .afTagBox,
.bookList .afTagBox {position: relative;border: none;background: #FFF;padding: 0;}
.seminarList__list,
.bookList__list {display: flex;}
.seminarList__list .afTagBox {width: 32%;margin: 0 2% 0 0;}
.seminarList__list .afTagBox:nth-child(4n) {margin-right: 0;}
.bookList__list .afTagBox {width: 23.5%;margin: 0 2% 0 0;}
.bookList__list .afTagBox:nth-child(5n) {margin-right: 0;}
.seminarList__list .afTagBox__title,
.bookList__list .afTagBox__title,
.widgetAfRank .widgetAfTag__title {margin: 10px 0 0 0;font-size: 1.5rem;text-align: left;}
.seminarList__list .afTagBox__text,
.bookList__list .afTagBox__text,
.widgetAfRank .widgetAfTag__text {margin: 10px 0 0 0;width: 100%;font-size: 1.4rem;}
<?php
////////////////////////////////////////////////////////
//タグ管理をShortcode化
////////////////////////////////////////////////////////
function afTag_Scode($atts) {
// ショートコードの属性
extract(shortcode_atts(array(
'id' => '',
'name' => '',
'class' => 'afTagBox',
), $atts));
// WP_Query のパラメータ
$args = array(
'p' => $id,
'name' => $name,
'post_type' => 'afTag',
);
$the_query = new WP_Query( $args );
while ( $the_query->have_posts() ) {
$the_query->the_post();
$title = get_the_title();
$content = apply_filters( 'the_content', get_the_content() );
$style = get_post_meta($id, 'afTagFormat_style', true);
$star = get_post_meta($id, 'afTagFormat_star', true);
$number = get_post_meta($id, 'afTagFormat_number', true);
$banner = apply_filters('the_content', get_post_meta($id, 'afTagFormat_banner', true));
$text = apply_filters('the_content', get_post_meta($id, 'afTagFormat_text', true));
$d_id = get_post_meta($id, 'afTagFormat_d_id', true);
$d_title = get_post_meta($id, 'afTagFormat_d_title', true);
$a_url = get_post_meta($id, 'afTagFormat_a_url', true);
$a_title = get_post_meta($id, 'afTagFormat_a_title', true);
$d_btn = '';
if(!empty($d_id) && !empty($d_title) && is_single($d_id) != $d_id){$d_btn = '<a class="afTagBox__btnDetail" href="'.get_permalink($d_id).'">'.$d_title.'</a>';}
$a_btn = '';
if(!empty($a_url) && !empty($a_title)){$a_btn = '<a class="afTagBox__btnAf" href="'.$a_url.'" target="_blank">'.$a_title.'</a>';}
$ori_item1 = apply_filters('the_content', get_post_meta($id, 'afTagFormat_ori_item1', true));
$ori_item2 = apply_filters('the_content', get_post_meta($id, 'afTagFormat_ori_item2', true));
$ori_item3 = apply_filters('the_content', get_post_meta($id, 'afTagFormat_ori_item3', true));
$ori_item4 = apply_filters('the_content', get_post_meta($id, 'afTagFormat_ori_item4', true));
$ori_item5 = apply_filters('the_content', get_post_meta($id, 'afTagFormat_ori_item5', true));
$ori_item6 = apply_filters('the_content', get_post_meta($id, 'afTagFormat_ori_item6', true));
$ori_head1 = '見出し1';
if(get_option('fit_bsAfTag_Headline1')){$ori_head1 = get_option('fit_bsAfTag_Headline1');}
$ori_head2 = '見出し2';
if(get_option('fit_bsAfTag_Headline2')){$ori_head2 = get_option('fit_bsAfTag_Headline2');}
$ori_head3 = '見出し3';
if(get_option('fit_bsAfTag_Headline3')){$ori_head3 = get_option('fit_bsAfTag_Headline3');}
$ori_head4 = '見出し4';
if(get_option('fit_bsAfTag_Headline4')){$ori_head4 = get_option('fit_bsAfTag_Headline4');}
$ori_head5 = '見出し5';
if(get_option('fit_bsAfTag_Headline5')){$ori_head5 = get_option('fit_bsAfTag_Headline5');}
$ori_head6 = '見出し6';
if(get_option('fit_bsAfTag_Headline6')){$ori_head6 = get_option('fit_bsAfTag_Headline6');}
$ori_table1 = '';
if(!empty($ori_item1)){$ori_table1 = '<tr><th width="33.3%">'.$ori_head1.'</th><td>'.$ori_item1.'</td></tr>';}
$ori_table2 = '';
if(!empty($ori_item2)){$ori_table2 = '<tr><th>'.$ori_head2.'</th><td>'.$ori_item2.'</td></tr>';}
$ori_table3 = '';
if(!empty($ori_item3)){$ori_table3 = '<tr><th>'.$ori_head3.'</th><td>'.$ori_item3.'</td></tr>';}
$ori_table4 = '';
if(!empty($ori_item4)){$ori_table4 = '<tr><th>'.$ori_head4.'</th><td>'.$ori_item4.'</td></tr>';}
$ori_table5 = '';
if(!empty($ori_item5)){$ori_table5 = '<tr><th>'.$ori_head5.'</th><td>'.$ori_item5.'</td></tr>';}
$ori_table6 = '';
if(!empty($ori_item6)){$ori_table6 = '<tr><th>'.$ori_head6.'</th><td>'.$ori_item6.'</td></tr>';}
$counter = '';
$jquery = '';
if(!is_user_logged_in() && !is_bot()){
$counter = set_post_views($id) ;
$jquery = post_ajax_send($id);
}
}
wp_reset_postdata();
if($style == '_0' || empty($style)){
return '
<div class="'.$class.' afTag-'.$id.'">
<div class="afTagBox__content">'.$content.'</div>
'.$jquery.''.$counter.'
</div>
';
}else if($style == '_1'){
return '
<div class="'.$class.' afTag-'.$id.'">
<div class="afTagBox__header">
<div class="afTagBox__title">'.$title.'</div>
<div class="afTagBox__star afTagBox__star-number_'.$star.'"><span class="afTagBox__number">'.$number.'</span></div>
</div>
<div class="afTagBox__contentBox">
<div class="afTagBox__banner">'.$banner.'</div>
<div class="afTagBox__text">'.$text.'</div>
</div>
<table class="afTagBox__table">
'.$ori_table1.'
'.$ori_table2.'
'.$ori_table3.'
'.$ori_table4.'
'.$ori_table5.'
'.$ori_table6.'
</table>
<div class="afTagBox__content">'.$content.'</div>
<div class="afTagBox__btnList">
'.$d_btn.'
'.$a_btn.'
</div>
'.$jquery.''.$counter.'
</div>
';
}else if($style == '_2'){
return '
<div class="'.$class.' afTag-'.$id.'">
<div class="afTagBox__header">
<div class="afTagBox__title">'.$title.'</div>
<div class="afTagBox__star afTagBox__star-number_'.$star.'"><span class="afTagBox__number">'.$number.'</span></div>
</div>
<div class="afTagBox__contentBox">
<div class="afTagBox__banner">'.$banner.'</div>
<div class="afTagBox__text">'.$text.'</div>
</div>
<div class="afTagBox__btnList">
'.$d_btn.'
'.$a_btn.'
</div>
'.$jquery.''.$counter.'
</div>
';
}
}
add_shortcode( 'afTag', 'afTag_Scode', true );
<?php
////////////////////////////////////////////////////////
//タグ管理をShortcode化
////////////////////////////////////////////////////////
function afTag_Scode($atts) {
// ショートコードの属性
extract(shortcode_atts(array(
'id' => '',
'name' => '',
'class' => 'afTagBox',
), $atts));
// WP_Query のパラメータ
$args = array(
'p' => $id,
'name' => $name,
'post_type' => 'afTag',
);
$the_query = new WP_Query( $args );
while ( $the_query->have_posts() ) {
$the_query->the_post();
$title = get_the_title();
$content = apply_filters( 'the_content', get_the_content() );
$style = get_post_meta($id, 'afTagFormat_style', true);
$star = get_post_meta($id, 'afTagFormat_star', true);
$number = get_post_meta($id, 'afTagFormat_number', true);
$banner = apply_filters('the_content', get_post_meta($id, 'afTagFormat_banner', true));
$text = apply_filters('the_content', get_post_meta($id, 'afTagFormat_text', true));
$d_id = get_post_meta($id, 'afTagFormat_d_id', true);
$d_title = get_post_meta($id, 'afTagFormat_d_title', true);
$a_url = get_post_meta($id, 'afTagFormat_a_url', true);
$a_title = get_post_meta($id, 'afTagFormat_a_title', true);
$d_btn = '';
if(!empty($d_id) && !empty($d_title) && is_single($d_id) != $d_id){$d_btn = '<a class="afTagBox__btnDetail" href="'.get_permalink($d_id).'">'.$d_title.'</a>';}
$a_btn = '';
if(!empty($a_url) && !empty($a_title)){$a_btn = '<a class="afTagBox__btnAf" href="'.$a_url.'" target="_blank">'.$a_title.'</a>';}
$link_banner = '';
if(!empty($a_url)){$link_banner = '<a class="afTagBox__bannerAf" href="'.$a_url.'" target="_blank">'.$banner.'</a>';}
$ori_item1 = apply_filters('the_content', get_post_meta($id, 'afTagFormat_ori_item1', true));
$ori_item2 = apply_filters('the_content', get_post_meta($id, 'afTagFormat_ori_item2', true));
$ori_item3 = apply_filters('the_content', get_post_meta($id, 'afTagFormat_ori_item3', true));
$ori_item4 = apply_filters('the_content', get_post_meta($id, 'afTagFormat_ori_item4', true));
$ori_item5 = apply_filters('the_content', get_post_meta($id, 'afTagFormat_ori_item5', true));
$ori_item6 = apply_filters('the_content', get_post_meta($id, 'afTagFormat_ori_item6', true));
$ori_head1 = '見出し1';
if(get_option('fit_bsAfTag_Headline1')){$ori_head1 = get_option('fit_bsAfTag_Headline1');}
$ori_head2 = '見出し2';
if(get_option('fit_bsAfTag_Headline2')){$ori_head2 = get_option('fit_bsAfTag_Headline2');}
$ori_head3 = '見出し3';
if(get_option('fit_bsAfTag_Headline3')){$ori_head3 = get_option('fit_bsAfTag_Headline3');}
$ori_head4 = '見出し4';
if(get_option('fit_bsAfTag_Headline4')){$ori_head4 = get_option('fit_bsAfTag_Headline4');}
$ori_head5 = '見出し5';
if(get_option('fit_bsAfTag_Headline5')){$ori_head5 = get_option('fit_bsAfTag_Headline5');}
$ori_head6 = '見出し6';
if(get_option('fit_bsAfTag_Headline6')){$ori_head6 = get_option('fit_bsAfTag_Headline6');}
$ori_table1 = '';
if(!empty($ori_item1)){$ori_table1 = '<tr><th width="33.3%">'.$ori_head1.'</th><td>'.$ori_item1.'</td></tr>';}
$ori_table2 = '';
if(!empty($ori_item2)){$ori_table2 = '<tr><th>'.$ori_head2.'</th><td>'.$ori_item2.'</td></tr>';}
$ori_table3 = '';
if(!empty($ori_item3)){$ori_table3 = '<tr><th>'.$ori_head3.'</th><td>'.$ori_item3.'</td></tr>';}
$ori_table4 = '';
if(!empty($ori_item4)){$ori_table4 = '<tr><th>'.$ori_head4.'</th><td>'.$ori_item4.'</td></tr>';}
$ori_table5 = '';
if(!empty($ori_item5)){$ori_table5 = '<tr><th>'.$ori_head5.'</th><td>'.$ori_item5.'</td></tr>';}
$ori_table6 = '';
if(!empty($ori_item6)){$ori_table6 = '<tr><th>'.$ori_head6.'</th><td>'.$ori_item6.'</td></tr>';}
$counter = '';
$jquery = '';
if(!is_user_logged_in() && !is_bot()){
$counter = set_post_views($id) ;
$jquery = post_ajax_send($id);
}
}
wp_reset_postdata();
if($style == '_0' || empty($style)){
return '
<div class="'.$class.' afTag-'.$id.'">
<div class="afTagBox__content">'.$content.'</div>
'.$jquery.''.$counter.'
</div>
';
}else if($style == '_1'){
return '
<div class="'.$class.' afTag-'.$id.'">
<div class="afTagBox__contentBox">
<div class="afTagBox__banner">'.$link_banner.'</div>
<div class="afTagBox__title">'.$title.'</div>
<div class="afTagBox__text">'.$text.'</div>
</div>
<table class="afTagBox__table">
'.$ori_table1.'
'.$ori_table2.'
'.$ori_table3.'
'.$ori_table4.'
'.$ori_table5.'
'.$ori_table6.'
</table>
<div class="afTagBox__content">'.$content.'</div>
<div class="afTagBox__btnList">
'.$d_btn.'
'.$a_btn.'
</div>
'.$jquery.''.$counter.'
</div>
';
}else if($style == '_2'){
return '
<div class="'.$class.' afTag-'.$id.'">
<div class="afTagBox__contentBox">
<div class="afTagBox__banner">'.$link_banner.'</div>
<div class="afTagBox__title">'.$title.'</div>
<div class="afTagBox__text">'.$text.'</div>
</div>
<div class="afTagBox__btnList">
'.$d_btn.'
'.$a_btn.'
</div>
'.$jquery.''.$counter.'
</div>
';
}
}
add_shortcode( 'afTag', 'afTag_Scode', true );
<?php
////////////////////////////////////////////////////////
//タグランキングをShortcode化
////////////////////////////////////////////////////////
function afRanking_Scode($atts) {
// ショートコードの属性
extract(shortcode_atts(array(
'id' => '',
'name' => '',
'class' => 'afRank',
), $atts));
$tag_id = get_post_meta($id , 'afRanking_post' ,true);
$crown = get_post_meta($id , 'afRanking_crown', true);
$style = get_post_meta($id , 'afRanking_style' ,true);
$ul_start = '<ul class="'.$class.' afRank__crown'.$crown.'">';
$ul_end = '</ul>';
$return = '';
if( isset($tag_id)) {
foreach($tag_id as $id){
$post = get_post($id);
$title = get_the_title($id);
$content = apply_filters( 'the_content', $post->post_content );
$star = get_post_meta($id, 'afTagFormat_star', true);
$number = get_post_meta($id, 'afTagFormat_number', true);
$banner = apply_filters('the_content', get_post_meta($id, 'afTagFormat_banner', true));
$text = apply_filters('the_content', get_post_meta($id, 'afTagFormat_text', true));
$d_id = get_post_meta($id, 'afTagFormat_d_id', true);
$d_title = get_post_meta($id, 'afTagFormat_d_title', true);
$a_url = get_post_meta($id, 'afTagFormat_a_url', true);
$a_title = get_post_meta($id, 'afTagFormat_a_title', true);
$d_btn = '';
if(!empty($d_id) && !empty($d_title) && is_single($d_id) != $d_id){$d_btn = '<a class="afTagBox__btnDetail" href="'.get_permalink($d_id).'">'.$d_title.'</a>';}
$a_btn = '';
if(!empty($a_url) && !empty($a_title)){$a_btn = '<a class="afTagBox__btnAf" href="'.$a_url.'" target="_blank">'.$a_title.'</a>';}
$ori_item1 = apply_filters('the_content', get_post_meta($id, 'afTagFormat_ori_item1', true));
$ori_item2 = apply_filters('the_content', get_post_meta($id, 'afTagFormat_ori_item2', true));
$ori_item3 = apply_filters('the_content', get_post_meta($id, 'afTagFormat_ori_item3', true));
$ori_item4 = apply_filters('the_content', get_post_meta($id, 'afTagFormat_ori_item4', true));
$ori_item5 = apply_filters('the_content', get_post_meta($id, 'afTagFormat_ori_item5', true));
$ori_item6 = apply_filters('the_content', get_post_meta($id, 'afTagFormat_ori_item6', true));
$ori_head1 = '見出し1';
if(get_option('fit_bsAfTag_Headline1')){$ori_head1 = get_option('fit_bsAfTag_Headline1');}
$ori_head2 = '見出し2';
if(get_option('fit_bsAfTag_Headline2')){$ori_head2 = get_option('fit_bsAfTag_Headline2');}
$ori_head3 = '見出し3';
if(get_option('fit_bsAfTag_Headline3')){$ori_head3 = get_option('fit_bsAfTag_Headline3');}
$ori_head4 = '見出し4';
if(get_option('fit_bsAfTag_Headline4')){$ori_head4 = get_option('fit_bsAfTag_Headline4');}
$ori_head5 = '見出し5';
if(get_option('fit_bsAfTag_Headline5')){$ori_head5 = get_option('fit_bsAfTag_Headline5');}
$ori_head6 = '見出し6';
if(get_option('fit_bsAfTag_Headline6')){$ori_head6 = get_option('fit_bsAfTag_Headline6');}
$ori_table1 = '';
if(!empty($ori_item1)){$ori_table1 = '<tr><th width="33.3%">'.$ori_head1.'</th><td>'.$ori_item1.'</td></tr>';}
$ori_table2 = '';
if(!empty($ori_item2)){$ori_table2 = '<tr><th>'.$ori_head2.'</th><td>'.$ori_item2.'</td></tr>';}
$ori_table3 = '';
if(!empty($ori_item3)){$ori_table3 = '<tr><th>'.$ori_head3.'</th><td>'.$ori_item3.'</td></tr>';}
$ori_table4 = '';
if(!empty($ori_item4)){$ori_table4 = '<tr><th>'.$ori_head4.'</th><td>'.$ori_item4.'</td></tr>';}
$ori_table5 = '';
if(!empty($ori_item5)){$ori_table5 = '<tr><th>'.$ori_head5.'</th><td>'.$ori_item5.'</td></tr>';}
$ori_table6 = '';
if(!empty($ori_item6)){$ori_table6 = '<tr><th>'.$ori_head6.'</th><td>'.$ori_item6.'</td></tr>';}
$counter = '';
$jquery = '';
if(!is_user_logged_in() && !is_bot()){
$counter = set_post_views($id);
$jquery = post_ajax_send($id);
}
if($style == '_0' || empty($style)){
$return .= '
<li>
<div class="afTagBox afTagBox-noFormat afTag-'.$id.'">
<div class="afTagBox__content">'.$content.'</div>
'.$jquery.''.$counter.'
</div>
</li>
';
}else if($style == '_1'){
$return .= '
<li>
<div class="afTagBox afTag-'.$id.'">
<div class="afTagBox__header">
<div class="afTagBox__title">'.$title.'</div>
<div class="afTagBox__star afTagBox__star-number_'.$star.'"><span class="afTagBox__number">'.$number.'</span></div>
</div>
<div class="afTagBox__contentBox">
<div class="afTagBox__banner">'.$banner.'</div>
<div class="afTagBox__text">'.$text.'</div>
</div>
<table class="afTagBox__table">
'.$ori_table1.'
'.$ori_table2.'
'.$ori_table3.'
'.$ori_table4.'
'.$ori_table5.'
'.$ori_table6.'
</table>
<div class="afTagBox__content">'.$content.'</div>
<div class="afTagBox__btnList">
'.$d_btn.'
'.$a_btn.'
</div>
'.$jquery.''.$counter.'
</div>
</li>
';
}else if($style == '_2'){
$return .= '
<li>
<div class="afTagBox afTag-'.$id.'">
<div class="afTagBox__header">
<div class="afTagBox__title">'.$title.'</div>
<div class="afTagBox__star afTagBox__star-number_'.$star.'"><span class="afTagBox__number">'.$number.'</span></div>
</div>
<div class="afTagBox__contentBox">
<div class="afTagBox__banner">'.$banner.'</div>
<div class="afTagBox__text">'.$text.'</div>
</div>
<div class="afTagBox__btnList">
'.$d_btn.'
'.$a_btn.'
</div>
'.$jquery.''.$counter.'
</div>
</li>
';
}
}
}
return $ul_start .$return .$ul_end;
}
add_shortcode( 'afRanking', 'afRanking_Scode', true );
<?php
////////////////////////////////////////////////////////
//タグランキングをShortcode化
////////////////////////////////////////////////////////
function afRanking_Scode($atts) {
// ショートコードの属性
extract(shortcode_atts(array(
'id' => '',
'name' => '',
'class' => 'afRank',
), $atts));
$tag_id = get_post_meta($id , 'afRanking_post' ,true);
$crown = get_post_meta($id , 'afRanking_crown', true);
$style = get_post_meta($id , 'afRanking_style' ,true);
$ul_start = '<ul class="'.$class.' afRank__crown'.$crown.'">';
$ul_end = '</ul>';
$return = '';
if( isset($tag_id)) {
foreach($tag_id as $id){
$post = get_post($id);
$title = get_the_title($id);
$content = apply_filters( 'the_content', $post->post_content );
$star = get_post_meta($id, 'afTagFormat_star', true);
$number = get_post_meta($id, 'afTagFormat_number', true);
$banner = apply_filters('the_content', get_post_meta($id, 'afTagFormat_banner', true));
$text = apply_filters('the_content', get_post_meta($id, 'afTagFormat_text', true));
$d_id = get_post_meta($id, 'afTagFormat_d_id', true);
$d_title = get_post_meta($id, 'afTagFormat_d_title', true);
$a_url = get_post_meta($id, 'afTagFormat_a_url', true);
$a_title = get_post_meta($id, 'afTagFormat_a_title', true);
$d_btn = '';
if(!empty($d_id) && !empty($d_title) && is_single($d_id) != $d_id){$d_btn = '<a class="afTagBox__btnDetail" href="'.get_permalink($d_id).'">'.$d_title.'</a>';}
$a_btn = '';
if(!empty($a_url) && !empty($a_title)){$a_btn = '<a class="afTagBox__btnAf" href="'.$a_url.'" target="_blank">'.$a_title.'</a>';}
$ori_item1 = apply_filters('the_content', get_post_meta($id, 'afTagFormat_ori_item1', true));
$ori_item2 = apply_filters('the_content', get_post_meta($id, 'afTagFormat_ori_item2', true));
$ori_item3 = apply_filters('the_content', get_post_meta($id, 'afTagFormat_ori_item3', true));
$ori_item4 = apply_filters('the_content', get_post_meta($id, 'afTagFormat_ori_item4', true));
$ori_item5 = apply_filters('the_content', get_post_meta($id, 'afTagFormat_ori_item5', true));
$ori_item6 = apply_filters('the_content', get_post_meta($id, 'afTagFormat_ori_item6', true));
$ori_head1 = '見出し1';
if(get_option('fit_bsAfTag_Headline1')){$ori_head1 = get_option('fit_bsAfTag_Headline1');}
$ori_head2 = '見出し2';
if(get_option('fit_bsAfTag_Headline2')){$ori_head2 = get_option('fit_bsAfTag_Headline2');}
$ori_head3 = '見出し3';
if(get_option('fit_bsAfTag_Headline3')){$ori_head3 = get_option('fit_bsAfTag_Headline3');}
$ori_head4 = '見出し4';
if(get_option('fit_bsAfTag_Headline4')){$ori_head4 = get_option('fit_bsAfTag_Headline4');}
$ori_head5 = '見出し5';
if(get_option('fit_bsAfTag_Headline5')){$ori_head5 = get_option('fit_bsAfTag_Headline5');}
$ori_head6 = '見出し6';
if(get_option('fit_bsAfTag_Headline6')){$ori_head6 = get_option('fit_bsAfTag_Headline6');}
$ori_table1 = '';
if(!empty($ori_item1)){$ori_table1 = '<tr><th width="33.3%">'.$ori_head1.'</th><td>'.$ori_item1.'</td></tr>';}
$ori_table2 = '';
if(!empty($ori_item2)){$ori_table2 = '<tr><th>'.$ori_head2.'</th><td>'.$ori_item2.'</td></tr>';}
$ori_table3 = '';
if(!empty($ori_item3)){$ori_table3 = '<tr><th>'.$ori_head3.'</th><td>'.$ori_item3.'</td></tr>';}
$ori_table4 = '';
if(!empty($ori_item4)){$ori_table4 = '<tr><th>'.$ori_head4.'</th><td>'.$ori_item4.'</td></tr>';}
$ori_table5 = '';
if(!empty($ori_item5)){$ori_table5 = '<tr><th>'.$ori_head5.'</th><td>'.$ori_item5.'</td></tr>';}
$ori_table6 = '';
if(!empty($ori_item6)){$ori_table6 = '<tr><th>'.$ori_head6.'</th><td>'.$ori_item6.'</td></tr>';}
$counter = '';
$jquery = '';
if(!is_user_logged_in() && !is_bot()){
$counter = set_post_views($id);
$jquery = post_ajax_send($id);
}
if($style == '_0' || empty($style)){
$return .= '
<li>
<div class="afTagBox afTagBox-noFormat afTag-'.$id.'">
<div class="afTagBox__content">'.$content.'</div>
'.$jquery.''.$counter.'
</div>
</li>
';
}else if($style == '_1'){
$return .= '
<li>
<div class="afTagBox afTag-'.$id.'">
<div class="afTagBox__header">
<div class="afTagBox__title">'.$title.'</div>
<div class="afTagBox__star afTagBox__star-number_'.$star.'"><span class="afTagBox__number">'.$number.'</span></div>
</div>
<div class="afTagBox__contentBox">
<div class="afTagBox__banner">'.$banner.'</div>
<div class="afTagBox__text">'.$text.'</div>
</div>
<table class="afTagBox__table">
'.$ori_table1.'
'.$ori_table2.'
'.$ori_table3.'
'.$ori_table4.'
'.$ori_table5.'
'.$ori_table6.'
</table>
<div class="afTagBox__content">'.$content.'</div>
<div class="afTagBox__btnList">
'.$d_btn.'
'.$a_btn.'
</div>
'.$jquery.''.$counter.'
</div>
</li>
';
}else if($style == '_2'){
$return .= '
<li>
<div class="afTagBox afTag-'.$id.'">
<div class="afTagBox__header">
<div class="afTagBox__title">'.$title.'</div>
<div class="afTagBox__star afTagBox__star-number_'.$star.'"><span class="afTagBox__number">'.$number.'</span></div>
</div>
<div class="afTagBox__contentBox">
<div class="afTagBox__banner">'.$banner.'</div>
<div class="afTagBox__text">'.$text.'</div>
</div>
<div class="afTagBox__btnList">
'.$d_btn.'
'.$a_btn.'
</div>
'.$jquery.''.$counter.'
</div>
</li>
';
}
}
}
return $ul_start .$return .$ul_end;
}
add_shortcode( 'afRanking', 'afRanking_Scode', true );
<?php
////////////////////////////////////////////////////////
//タグランキングウィジェットアイテム
////////////////////////////////////////////////////////
class fit_tagrank_class extends WP_Widget {
function __construct() {
$widget_option = array('description' => 'タグランキングを表示');
parent::__construct( false, $name = '[THE]タグランキング', $widget_option );
}
// 設定フォームを出力するメソッド
function form( $instance ) {
?>
<p>
<label for="<?php echo $this->get_field_id('title'); ?>">タイトル:</label>
<input type="text" class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo esc_attr( @$instance['title'] ); ?>">
</p>
<p>
<?php
$args = array( 'post_type' => 'afRanking', 'posts_per_page' => -1 );
$ranklist = get_posts( $args );
echo '<label for="'.$this->get_field_name("tagrank").'">タグランキングID:</label>';
echo '<select class="widefat" id="'.$this->get_field_name("tagrank").'" name="'.$this->get_field_name("tagrank").'">';
foreach($ranklist as $rank):
$rankId = $rank->ID;
$rankData = get_userdata($rankId);
$selected = '';
if( @$instance['tagrank'] == $rankId ){
$selected = 'selected';
}
echo '<option '.$selected.' value="'.$rankId.'">'.$rank->post_title.'</option>';
endforeach;
echo '</select>';
?>
</p>
<?php
}
// 設定を表示するメソッド
function widget( $args, $instance ) {
extract( $args );
echo $before_widget;
// タイトルを取得
$title = NULL;
if(!empty($instance['title'])) {
$title = apply_filters('widget_title', $instance['title'] );
}
// タイトルを表示
if ($title) {
echo $before_title . $title . $after_title;
}
// タグランキングIDを取得
$id = NULL;
if(!empty($instance['tagrank'])) {
$id = $instance['tagrank'];
}
// タグランキング情報を取得
$tag_id = get_post_meta($id , 'afRanking_post' ,true);
$crown = get_post_meta($id , 'afRanking_crown', true);
echo '<ul class="widgetAfRank widgetAfRank__crown'.$crown.'">';
if( isset($tag_id)) {
foreach($tag_id as $tid){
$post = get_post($tid);
$title = get_the_title($tid);
$content = $post->post_content;
$banner = apply_filters('the_content', get_post_meta($tid, 'afTagFormat_banner', true));
$text = apply_filters('the_content', get_post_meta($tid, 'afTagFormat_text', true));
$d_id = get_post_meta($tid, 'afTagFormat_d_id', true);
$d_title = get_post_meta($tid, 'afTagFormat_d_title', true);
$a_url = get_post_meta($tid, 'afTagFormat_a_url', true);
$a_title = get_post_meta($tid, 'afTagFormat_a_title', true);
$counter = '';
$jquery = '';
if(!is_user_logged_in() && !is_bot()){
$counter = set_post_views($tid);
$jquery = post_ajax_send($tid);
}
?>
<li>
<div class="widgetAfTag afTag-<?php echo $tid ?>">
<div class="widgetAfTag__header">
<div class="widgetAfTag__title"><?php echo $title ?></div>
</div>
<div class="widgetAfTag__contentBox">
<div class="widgetAfTag__banner"><?php echo $banner ?></div>
<div class="widgetAfTag__text"><?php echo $text ?></div>
</div>
<div class="widgetAfTag__btnList">
<?php if(!empty($d_id) && !empty($d_title)){echo '<a class="widgetAfTag__btnDetail" href="'.get_permalink($d_id).'">'.$d_title.'</a>';} ?>
<?php if(!empty($a_url) && !empty($a_title)){echo '<a class="widgetAfTag__btnAf" href="'.$a_url.'" target="_blank">'.$a_title.'</a>';} ?>
</div>
<?php echo $jquery ?><?php echo $counter ?>
</div>
</li>
<?php
}
}
echo '</ul>';
echo $after_widget;
}
// 設定を保存するメソッド
function update( $new_instance, $old_instance ) {
return $new_instance;
}
}
add_action( 'widgets_init', function(){register_widget('fit_tagrank_class' );});
<?php
////////////////////////////////////////////////////////
//タグランキングウィジェットアイテム
////////////////////////////////////////////////////////
class fit_tagrank_class extends WP_Widget {
function __construct() {
$widget_option = array('description' => 'タグランキングを表示');
parent::__construct( false, $name = '[THE]タグランキング', $widget_option );
}
// 設定フォームを出力するメソッド
function form( $instance ) {
?>
<p>
<label for="<?php echo $this->get_field_id('title'); ?>">タイトル:</label>
<input type="text" class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo esc_attr( @$instance['title'] ); ?>">
</p>
<p>
<?php
$args = array( 'post_type' => 'afRanking', 'posts_per_page' => -1 );
$ranklist = get_posts( $args );
echo '<label for="'.$this->get_field_name("tagrank").'">タグランキングID:</label>';
echo '<select class="widefat" id="'.$this->get_field_name("tagrank").'" name="'.$this->get_field_name("tagrank").'">';
foreach($ranklist as $rank):
$rankId = $rank->ID;
$rankData = get_userdata($rankId);
$selected = '';
if( @$instance['tagrank'] == $rankId ){
$selected = 'selected';
}
echo '<option '.$selected.' value="'.$rankId.'">'.$rank->post_title.'</option>';
endforeach;
echo '</select>';
?>
</p>
<?php
}
// 設定を表示するメソッド
function widget( $args, $instance ) {
extract( $args );
echo $before_widget;
// タイトルを取得
$title = NULL;
if(!empty($instance['title'])) {
$title = apply_filters('widget_title', $instance['title'] );
}
// タイトルを表示
if ($title) {
echo $before_title . $title . $after_title;
}
// タグランキングIDを取得
$id = NULL;
if(!empty($instance['tagrank'])) {
$id = $instance['tagrank'];
}
// タグランキング情報を取得
$tag_id = get_post_meta($id , 'afRanking_post' ,true);
$crown = get_post_meta($id , 'afRanking_crown', true);
echo '<ul class="widgetAfRank widgetAfRank__crown'.$crown.'">';
if( isset($tag_id)) {
foreach($tag_id as $tid){
$post = get_post($tid);
$title = get_the_title($tid);
$content = $post->post_content;
$banner = apply_filters('the_content', get_post_meta($tid, 'afTagFormat_banner', true));
$text = apply_filters('the_content', get_post_meta($tid, 'afTagFormat_text', true));
$d_id = get_post_meta($tid, 'afTagFormat_d_id', true);
$d_title = get_post_meta($tid, 'afTagFormat_d_title', true);
$a_url = get_post_meta($tid, 'afTagFormat_a_url', true);
$a_title = get_post_meta($tid, 'afTagFormat_a_title', true);
$counter = '';
$jquery = '';
if(!is_user_logged_in() && !is_bot()){
$counter = set_post_views($tid);
$jquery = post_ajax_send($tid);
}
?>
<li>
<div class="widgetAfTag afTag-<?php echo $tid ?>">
<div class="widgetAfTag__contentBox">
<div class="widgetAfTag__banner"><a href="<?php echo $a_url ?>" target="_blank"><?php echo $banner ?></a></div>
<div class="widgetAfTag__textBox">
<div class="widgetAfTag__title"><?php echo $title ?></div>
<div class="widgetAfTag__text"><?php echo $text ?></div>
<div class="widgetAfTag__btnList">
<?php if(!empty($d_id) && !empty($d_title)){echo '<a class="widgetAfTag__btnDetail" href="'.get_permalink($d_id).'">'.$d_title.'</a>';} ?>
<?php if(!empty($a_url) && !empty($a_title)){echo '<a class="widgetAfTag__btnAf" href="'.$a_url.'" target="_blank">'.$a_title.'</a>';} ?>
</div>
</div>
</div>
<?php echo $jquery ?><?php echo $counter ?>
</div>
</li>
<?php
}
}
echo '</ul>';
echo $after_widget;
}
// 設定を保存するメソッド
function update( $new_instance, $old_instance ) {
return $new_instance;
}
}
add_action( 'widgets_init', function(){register_widget('fit_tagrank_class' );});
......@@ -125,6 +125,20 @@
<?php the_content(); ?>
<?php if( get_field('seminar-list') ) { ?>
<div class="seminarList">
<h2 class="heading heading-secondary heading-main-archive">セミナー一覧</h2>
<div class="seminarList__list"><?php the_field('seminar-list'); ?></div>
</div>
<?php } ?>
<?php if( get_field('book-list') ) { ?>
<div class="bookList">
<h2 class="heading heading-secondary heading-main-archive">書籍一覧</h2>
<div class="bookList__list"><?php the_field('book-list'); ?></div>
</div>
<?php } ?>
</section>
<?php endwhile; endif; ?>
......@@ -132,7 +146,6 @@
<?php if (get_option('fit_pageShare_bottom') == 'on') : ?>
<aside class="social-bottom"><?php fit_share_btn(); ?></aside>
......
......@@ -391,6 +391,20 @@
<?php the_content(); ?>
<?php if( get_field('seminar-list') ) { ?>
<div class="seminarList">
<h2 class="heading heading-secondary heading-main-archive">セミナー一覧</h2>
<div class="seminarList__list"><?php the_field('seminar-list'); ?></div>
</div>
<?php } ?>
<?php if( get_field('book-list') ) { ?>
<div class="bookList">
<h2 class="heading heading-secondary heading-main-archive">書籍一覧</h2>
<div class="bookList__list"><?php the_field('book-list'); ?></div>
</div>
<?php } ?>
</section>
<?php
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment