Q.トップページのアイキャッチを削除したい
トップページのアイキャッチを削除したいのですが方法はありますか。
A.該当ファイルを編集してください
編集するファイル: 固定フロントページ (front-page.php)
<?php // blog content ********************************************************************************** if($options['show_index_blog_content'] == 1) { $sub_headline = $options['index_blog_headline']; $sub_font_size = $options['index_blog_headline_font_size']; $post_num = $options['index_blog_num']; $show_link = $options['show_index_blog_button']; $link_label = $options['index_blog_button']; ?> <div id="index_blog" class="animation_element"> <?php if($sub_headline) { ?><h3 id="index_blog_headline" class="headline rich_font color_headline" style="font-size:<?php echo esc_html($sub_font_size); ?>px;"><?php echo esc_html($sub_headline); ?></h3><?php }; ?> <?php $args = array('post_type' => 'post', 'ignore_sticky_posts' => 1, 'orderby' => 'date', 'order' => 'DESC', 'posts_per_page' => $post_num); $post_list = get_posts($args); if ($post_list) { ?> <ol class="clearfix" id="index_blog_list"> <?php foreach ($post_list as $post) : setup_postdata ($post); ?> <li class="clearfix"> <a class="image" href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php if(has_post_thumbnail()) { the_post_thumbnail('size2'); } else { ?><img src="<?php echo bloginfo('template_url'); ?>/img/common/no_image2.gif" title="" alt="" /><?php }; ?></a> <ul class="meta clearfix"> <?php if($options['show_date'] && $options['show_category']) : ?> <li class="date"><time class="entry-date updated" datetime="<?php the_modified_time('c'); ?>"><?php the_time('Y.n.j'); ?></time></li><li class="category_sp"><?php show_one_category(); ?></li> <?php elseif($options['show_date']) : ?> <li class="date"><time class="entry-date updated" datetime="<?php the_modified_time('c'); ?>"><?php the_time('Y.n.j'); ?></time></li> <?php elseif($options['show_category']) : ?> <li class="category"><?php show_one_category(); ?></li> <?php endif; ?> </ul> <a class="title" href="<?php the_permalink() ?>"><?php trim_title(45); ?></a> </li> <?php endforeach; wp_reset_query(); ?> </ol> <?php if($show_link == 1) { ?><div class="index_archive_link"><a href="<?php echo get_permalink( get_option('page_for_posts') ); ?>"><?php echo esc_html($link_label); ?></a></div><?php }; ?> <?php }; ?> </div><!-- END #index_blog --> <?php }; ?>
下記ソースを削除します。
<a class="image" href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php if(has_post_thumbnail()) { the_post_thumbnail('size2'); } else { ?><img src="<?php echo bloginfo('template_url'); ?>/img/common/no_image2.gif" title="" alt="" /><?php }; ?></a>
変更後のファイルはこちらになります。
<?php // blog content ********************************************************************************** if($options['show_index_blog_content'] == 1) { $sub_headline = $options['index_blog_headline']; $sub_font_size = $options['index_blog_headline_font_size']; $post_num = $options['index_blog_num']; $show_link = $options['show_index_blog_button']; $link_label = $options['index_blog_button']; ?> <div id="index_blog" class="animation_element"> <?php if($sub_headline) { ?><h3 id="index_blog_headline" class="headline rich_font color_headline" style="font-size:<?php echo esc_html($sub_font_size); ?>px;"><?php echo esc_html($sub_headline); ?></h3><?php }; ?> <?php $args = array('post_type' => 'post', 'ignore_sticky_posts' => 1, 'orderby' => 'date', 'order' => 'DESC', 'posts_per_page' => $post_num); $post_list = get_posts($args); if ($post_list) { ?> <ol class="clearfix" id="index_blog_list"> <?php foreach ($post_list as $post) : setup_postdata ($post); ?> <li class="clearfix"> <ul class="meta clearfix"> <?php if($options['show_date'] && $options['show_category']) : ?> <li class="date"><time class="entry-date updated" datetime="<?php the_modified_time('c'); ?>"><?php the_time('Y.n.j'); ?></time></li><li class="category_sp"><?php show_one_category(); ?></li> <?php elseif($options['show_date']) : ?> <li class="date"><time class="entry-date updated" datetime="<?php the_modified_time('c'); ?>"><?php the_time('Y.n.j'); ?></time></li> <?php elseif($options['show_category']) : ?> <li class="category"><?php show_one_category(); ?></li> <?php endif; ?> </ul> <a class="title" href="<?php the_permalink() ?>"><?php trim_title(45); ?></a> </li> <?php endforeach; wp_reset_query(); ?> </ol> <?php if($show_link == 1) { ?><div class="index_archive_link"><a href="<?php echo get_permalink( get_option('page_for_posts') ); ?>"><?php echo esc_html($link_label); ?></a></div><?php }; ?> <?php }; ?> </div><!-- END #index_blog --> <?php }; ?>
この記事は役に立ちましたか?
もし参考になりましたら、下のボタンで教えてください。
今後の記事作成の参考とさせて頂きます!