2026-05-25

Newpost Catchのアプデで表示が崩れてしまった場合の修正(自分用備忘録)ver.1.3.23

うちのサイトの一番上で、最新の記事を表示するのに使用しているプラグイン「Newpost Catch」について、以前アプデで表示が崩れてしまった場合の対処法をエントリに上げました。

その際の情報が古くなってしまったので、再度自分の備忘のため、修正方法を残しておきます。
「プラグイン > プラグインエディター > Newpost Catch > class.php」の355行目と357行目を

					$post_title = apply_filters( 'npc_sc_post_title', '<span class="title">' . esc_html( get_the_title() ) . '</span>', $post_id );
					$post_permalink = apply_filters( 'npc_sc_post_permalink', esc_url( get_permalink() ), $post_id );
					$post_date = ( $date == true ) ? '<span class="date">' . esc_html( get_the_time( get_option('date_format') ) ) . '</span>' : '';

から

					$post_title = apply_filters( 'npc_sc_post_title', '<span class="title">' . esc_html( get_the_title() ) . '', $post_id );
					$post_permalink = apply_filters( 'npc_sc_post_permalink', esc_url( get_permalink() ), $post_id );
					$post_date = ( $date == true ) ? '<span class="date">' . esc_html( get_the_time( get_option('date_format') ) ) . '</span></span>' : '';

に修正します。spanの閉じタグの位置を変更するだけです。
これでtitleクラスタグにdateクラスがくるまれるようになったので、従前と同じ表示に戻すことが出来ました。

トラックバック URL

コメント & トラックバック

コメントはありません。

コメントフィード

コメント

皆さまのコメントが励みになっています。ありがとうございます。