質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
WordPress

WordPressは、PHPで開発されているオープンソースのブログソフトウェアです。データベース管理システムにはMySQLを用いています。フリーのブログソフトウェアの中では最も人気が高く、PHPとHTMLを使って簡単にテンプレートをカスタマイズすることができます。

Q&A

解決済

1回答

3301閲覧

MH Magazine liteというワードプレスのテンプレートのカスタマイズ

webweb

総合スコア18

WordPress

WordPressは、PHPで開発されているオープンソースのブログソフトウェアです。データベース管理システムにはMySQLを用いています。フリーのブログソフトウェアの中では最も人気が高く、PHPとHTMLを使って簡単にテンプレートをカスタマイズすることができます。

0グッド

0クリップ

投稿2017/04/02 02:47

編集2017/04/02 06:56

現在、下記サイトの添付画像の箇所を消そうとしています。
リンク内容

イメージ説明

その際にファイルのコードをみてみると下記のあたりが怪しいとあてをつけたのですがどこを消せばよいかわかりません。。。

こちらご教示いただけますと幸いです。

もしくはMH Magazine liteの設定方法で消す方法があったり、
そもそもあてが外れているなどもご教示いただけますと幸いです。

php

1<?php 2 3/***** MH Posts Stacked [lite] *****/ 4 5class mh_magazine_lite_posts_stacked extends WP_Widget { 6 function __construct() { 7 parent::__construct( 8 'mh_magazine_lite_posts_stacked', esc_html_x('MH Posts Stacked [lite]', 'widget name', 'mh-magazine-lite'), 9 array( 10 'classname' => 'mh_magazine_lite_posts_stacked', 11 'description' => esc_html__('MH Posts Stacked widget to display 5 stacked posts nicely including thumbnail, title and meta data.', 'mh-magazine-lite'), 12 'customize_selective_refresh' => true 13 ) 14 ); 15 } 16 17 function widget($args, $instance) { 18 $defaults = array('title' => '', 'category' => 0, 'tags' => '', 'postcount' => 5, 'offset' => 0, 'sticky' => 1); 19 $instance = wp_parse_args($instance, $defaults); 20 $query_args = array(); 21 $query_args['posts_per_page'] = $instance['postcount']; 22 $query_args['ignore_sticky_posts'] = $instance['sticky']; 23 if (0 !== $instance['category']) { 24 $query_args['cat'] = $instance['category']; 25 } 26 if (!empty($instance['tags'])) { 27 $tag_slugs = explode(',', $instance['tags']); 28 $tag_slugs = array_map('trim', $tag_slugs); 29 $query_args['tag_slug__in'] = $tag_slugs; 30 } 31 if (0 !== $instance['offset']) { 32 $query_args['offset'] = $instance['offset']; 33 } 34 $widget_posts = new WP_Query($query_args); 35 $max_posts = $widget_posts->post_count; 36 echo $args['before_widget']; 37 if ($widget_posts->have_posts()) : 38 $counter = 1; 39 $stacked_border = ''; 40 if (!empty($instance['title'])) { 41 echo $args['before_title']; 42 if ($instance['category'] != 0) { 43 echo '<a href="' . esc_url(get_category_link($instance['category'])) . '" class="mh-widget-title-link">'; 44 } 45 echo esc_html(apply_filters('widget_title', $instance['title'])); 46 if ($instance['category'] != 0) { 47 echo '</a>'; 48 } 49 echo $args['after_title']; 50 } 51 52 echo '<div class="mh-posts-stacked-widget clearfix">' . "\n"; 53 while ($widget_posts->have_posts()) : $widget_posts->the_post(); 54 if ($counter === 1) { ?> 55 <div class="mh-posts-stacked-wrap mh-posts-stacked-large"> 56 <div class="post-<?php the_ID(); ?> mh-posts-stacked-content"> 57 <div class="mh-posts-stacked-thumb mh-posts-stacked-thumb-large"> 58 <a class="mh-posts-stacked-overlay mh-posts-stacked-overlay-large" href="<?php the_permalink(); ?>"></a><?php 59 if (has_post_thumbnail()) { 60 the_post_thumbnail('mh-magazine-lite-large'); 61 } else { 62 echo '<img class="mh-image-placeholder" src="' . get_template_directory_uri() . '/images/placeholder-large.png' . '" alt="' . esc_html__('No Picture', 'mh-magazine-lite') . '" />'; 63 } ?> 64 65 <article class="mh-posts-stacked-item"> 66 <h3 class="mh-posts-stacked-title mh-posts-stacked-title-large"> 67 <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" rel="bookmark"> 68 <?php the_title(); ?> 69 </a> 70 </h3> 71 <div class="mh-posts-stacked-meta mh-posts-stacked-meta-large"> 72 <?php mh_magazine_lite_loop_meta(); ?> 73 </div> 74 </article> 75 </div> 76 </div> 77 </div><?php 78 } 79 if ($counter === 2) { 80 echo '<div class="mh-posts-stacked-wrap mh-posts-stacked-columns clearfix">' . "\n"; 81 } 82 if ($counter === 4 || $counter === 5) { 83 $stacked_border = ' mh-posts-stacked-overlay-last'; 84 } 85 if ($counter >= 2) { ?> 86 <div class="mh-posts-stacked-wrap mh-posts-stacked-small"> 87 <div class="post-<?php the_ID(); ?> mh-posts-stacked-content"> 88 <div class="mh-posts-stacked-thumb mh-posts-stacked-thumb-small"> 89 <a class="mh-posts-stacked-overlay mh-posts-stacked-overlay-small<?php echo esc_attr($stacked_border); ?>" href="<?php the_permalink(); ?>"></a><?php 90 if (has_post_thumbnail()) { 91 the_post_thumbnail('mh-magazine-lite-medium'); 92 } else { 93 echo '<img class="mh-image-placeholder" src="' . get_template_directory_uri() . '/images/placeholder-medium.png' . '" alt="' . esc_html__('No Picture', 'mh-magazine-lite') . '" />'; 94 } ?> 95 <article class="mh-posts-stacked-item"> 96 <h3 class="mh-posts-stacked-title mh-posts-stacked-title-small"> 97 <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" rel="bookmark"> 98 <?php the_title(); ?> 99 </a> 100 </h3> 101 <div class="mh-posts-stacked-meta mh-posts-stacked-meta-small"> 102 <?php mh_magazine_lite_loop_meta(); ?> 103 </div> 104 </article> 105 </div> 106 </div> 107 </div><?php 108 } 109 if ($counter > 1 && $counter === $max_posts) { 110 echo '</div>' . "\n"; 111 } 112 $counter++; 113 endwhile; 114 wp_reset_postdata(); 115 echo '</div>' . "\n"; 116 endif; 117 echo $args['after_widget']; 118 } 119 120 function update($new_instance, $old_instance) { 121 $instance = array(); 122 if (!empty($new_instance['title'])) { 123 $instance['title'] = sanitize_text_field($new_instance['title']); 124 } 125 if (0 !== absint($new_instance['category'])) { 126 $instance['category'] = absint($new_instance['category']); 127 } 128 if (!empty($new_instance['tags'])) { 129 $tag_slugs = explode(',', $new_instance['tags']); 130 $tag_slugs = array_map('sanitize_title', $tag_slugs); 131 $instance['tags'] = implode(', ', $tag_slugs); 132 } 133 if (0 !== absint($new_instance['offset'])) { 134 if (absint($new_instance['offset']) > 50) { 135 $instance['offset'] = 50; 136 } else { 137 $instance['offset'] = absint($new_instance['offset']); 138 } 139 } 140 return $instance; 141 } 142 function form($instance) { 143 $defaults = array('title' => '', 'category' => 0, 'tags' => '', 'offset' => 0, 'sticky' => 1); 144 $instance = wp_parse_args($instance, $defaults); ?> 145 <p> 146 <label for="<?php echo esc_attr($this->get_field_id('title')); ?>"><?php esc_html_e('Title:', 'mh-magazine-lite'); ?></label> 147 <input class="widefat" type="text" value="<?php echo esc_attr($instance['title']); ?>" name="<?php echo esc_attr($this->get_field_name('title')); ?>" id="<?php echo esc_attr($this->get_field_id('title')); ?>" /> 148 </p> 149 <p> 150 <label for="<?php echo esc_attr($this->get_field_id('category')); ?>"><?php esc_html_e('Select a Category:', 'mh-magazine-lite'); ?></label> 151 <select id="<?php echo esc_attr($this->get_field_id('category')); ?>" class="widefat" name="<?php echo esc_attr($this->get_field_name('category')); ?>"> 152 <option value="0" <?php selected(0, $instance['category']); ?>><?php esc_html_e('All', 'mh-magazine-lite'); ?></option><?php 153 $categories = get_categories(); 154 foreach ($categories as $cat) { ?> 155 <option value="<?php echo absint($cat->cat_ID); ?>" <?php selected($cat->cat_ID, $instance['category']); ?>><?php echo esc_html($cat->cat_name) . ' (' . absint($cat->category_count) . ')'; ?></option><?php 156 } ?> 157 </select> 158 <small><?php _e('Select a category to display posts from.', 'mh-magazine-lite'); ?></small> 159 </p> 160 <p> 161 <label for="<?php echo esc_attr($this->get_field_id('tags')); ?>"><?php esc_html_e('Filter Posts by Tags (e.g. lifestyle):', 'mh-magazine-lite'); ?></label> 162 <input class="widefat" type="text" value="<?php echo esc_attr($instance['tags']); ?>" name="<?php echo esc_attr($this->get_field_name('tags')); ?>" id="<?php echo esc_attr($this->get_field_id('tags')); ?>" /> 163 </p> 164 <p> 165 <label for="<?php echo esc_attr($this->get_field_id('offset')); ?>"><?php esc_html_e('Skip Posts (max. 50):', 'mh-magazine-lite'); ?></label> 166 <input class="widefat" type="text" value="<?php echo absint($instance['offset']); ?>" name="<?php echo esc_attr($this->get_field_name('offset')); ?>" id="<?php echo esc_attr($this->get_field_id('offset')); ?>" /> 167 </p> 168 <p> 169 <strong><?php esc_html_e('Info:', 'mh-magazine-lite'); ?></strong> <?php esc_html_e('This is the lite version of this widget with basic features. More features and options are available in the premium version of MH Magazine.', 'mh-magazine-lite'); ?> 170 </p><?php 171 } 172} 173 174?>

PS:追記 下記取得したテンプレートになります。
https://www.mhthemes.com/themes/mh/magazine-lite/

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

退会済みユーザー

退会済みユーザー

2017/04/02 04:32

黒背景白文字と赤背景白文字の部分をボックスごと消したいということですか。背景の画像も消したいのでしょうか。
webweb

2017/04/02 04:40

上記画像、文字、リンクすべて消したいです。
kei344

2017/04/02 06:06

WordPressテーマはテーマ名だけではなく取得したURLを質問文に追記ください。(URLにはリンクを張ることができます)
guest

回答1

0

ベストアンサー

ウィジェットなら管理画面から消せるはずですよ。

【WordPress ウィジェットの追加と編集方法】
https://bazubu.com/how-to-manage-wp-wideget-23394.html

【ウィジェットの設定 - WordPressの使い方】
https://www.adminweb.jp/wordpress/theme/index5.html

投稿2017/04/02 08:09

kei344

総合スコア69400

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問