フォーラムへの返信
-
投稿者投稿
-
お手数おかけします。
すみません、説明不足の部分があったと思いますので、より具体的に書きました。
V6betaで①②の該当ファイルのカスタマイズ部分を差し替えようと思ったのですが、②中のカスタマイズ部分<div class="c-entry-summary__body form0_layaout1">
<div class="c-entry-summary__content form0_text1">
を入れる部分が分からず、form0_layaout1
form0_text1
というクラスの追加ができていません。それでレイアウトが崩れたと思います。
子テーマ>templates>view>①search-form0.php(archive.phpから作成)
子テーマ>template-parts>loop>②entry-summary-contribution.php(entry-summary-post.phpから作成)
以下は現状(v5.7.6)で使用しているファイルです。
▼①search-form0.php<?php /** * @package snow-monkey * @author inc2734 * @license GPL-2.0+ */ use Framework\Helper; ?> <div class="c-entry"> <header class="c-entry__header"> <h1 class="c-entry__title"><?php echo esc_html( Helper::get_page_title_from_breadcrumbs() ); ?></h1> </header> <div style="text-align : center"><strong><?php echo $wp_query->found_posts; ?>件の記事が該当しました。</strong></div></br> <?php // 検索結果ソート if(function_exists('feas_sort_menu') and $_GET['fe_form_no'] == '0'){ ?> <div class="return_link_sp"><a href="https://ohitorisama.site/members-contribution/">検索画面へ</a> </div> <div class="container_form0"> <div class="item1_form0"><div id="feas-sort-menu"> <?php feas_sort_menu(); ?></div> </div> <div class="item2_form0"><a href="https://ohitorisama.site/members-contribution/">検索画面へ</a> </div> </div></br> <?php } ?> <div class="c-entry__body"> <div class="c-entry__content p-entry-content"> <div class="p-archive"> <ul class="c-entries c-entries--<?php echo esc_attr( get_theme_mod( 'archive-layout' ) ); ?>"> <?php while ( have_posts() ) : ?> <?php the_post(); ?> <li class="c-entries__item"> <?php Helper::get_template_part( 'template-parts/loop/entry-summary-contribution', get_post_type() ); ?> </li> <?php endwhile; ?> </ul> </div> </div> <?php Helper::get_template_part( 'template-parts/archive/pagination' ); ?> </div> </div>
▼②entry-summary-contribution.php
<?php /** * @package snow-monkey * @author inc2734 * @license GPL-2.0+ */ use Framework\Helper; $terms = get_the_terms( get_the_ID(), 'category' ); $_term = null; if ( $terms && ! is_wp_error( $terms ) ) { $_term = $terms[0]; } // When loaded by widget, $widget_layout is exist. if ( isset( $widget_layout ) ) { $layout = $widget_layout; } else { $layout = get_theme_mod( 'archive-layout' ); } ?> <a href="<?php the_permalink(); ?>"> <section class="c-entry-summary c-entry-summary--category-<?php echo esc_attr( $_term ? $_term->term_id : 0 ); ?>"> <div class="c-entry-summary__body form0_layaout1"> <header class="c-entry-summary__header"> <h2 class="c-entry-summary__title"> <?php if ( 'rich-media' === $layout ) { Helper::the_title_trimed(); } else { the_title(); } ?> </h2> </header> <div class="c-entry-summary__content form0_text1"> <?php ob_start(); the_excerpt(); echo esc_html( wp_strip_all_tags( ob_get_clean() ) ); ?> </div> </div> </section> </a>
▼CSS
@media (min-width: 768px) { .form0_text1{ font-size:18px !important; color: #696969 !important;} .form0_layaout1{ width: 800px !important; margin-left:auto; margin-right:auto;} }
♥ 0了解しました!アップデートを待ちます。
♥ 0検索結果で消すことができました!
CSSだけでできるのですね。ありがとうございました。♥ 0textaeraのcssを分けて修正したら直りました!
的確なご指摘ありがとうございました。♥ 0textareaのCSSで、修正できました!
早速の対応、ありがとうございました。♥ 0追加です。
CSSでは、テーブルのth部分はwidth:30%と幅指定しています。♥ 0早速のお返事ありがとうございます。
カスタマイズでの表示の位置設定が上になっていて、サイト下部を確認していたので、見えていなかっただけでした。表示できました。
よく確認せずに質問してしまい、申し訳ございませんでした。トピックを閉じさせていただきます。♥ 0v5.4.5で修正されました! 早速のご対応ありがとうございました。
トピック閉じさせていただきます。♥ 0Controller::render( 'archive', 'search' );
の場合です。Controller::render( 'search-form0' );
は独自のレイアウトなので、大丈夫です。♥ 0ありがとうございます。調整できました!
トピック閉じさせていただきます。♥ 0すみません、試した方法が間違っていたようです。
先にお教えいただいたコードでうまくいきました。
ありがとうございました。トピックを閉じさせていただきます。♥ 0ありがとうございます。
すみません、管理者が複数いて、別のPCから編集する場合があるのですが、ログインした管理者全てに編集ボタン表示。woocommerce利用の一般ユーザーには見えないようにするのは難しいでしょうか。♥ 0ありがとうございます。うまくいきました!
今後は、これを参考にしたいと思います。
トピック閉じさせていただきます。♥ 0注意点、ご教示ありがとうございました。
①の場合、function custom_override_checkout_fields( $fields ) {
というのがあって、plugins_loadedでの囲い方がよく分かりません。お手数ですが、教えていただけませんでしょうか。♥ 0申し訳ございません。、function.phpの記載を外していませんでした。外したらエラー消えました。
この関連でお聞きしたいのですが、ウーコマース関連のカスタマイズで、順番によってエラーになる時があります。
①//WooCommerce 請求先情報 項目削除 add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' ); function custom_override_checkout_fields( $fields ) { unset($fields['billing']['billing_company']); unset($fields['billing']['billing_address_1']); unset($fields['billing']['billing_address_2']); unset($fields['billing']['billing_city']); unset($fields['billing']['billing_postcode']); unset($fields['billing']['billing_country']); unset($fields['billing']['billing_state']); unset($fields['billing']['billing_phone']); return $fields; }
②
//WooCommerce 関連商品削除 remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 ); add_action( 'plugins_loaded', function() { add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' ); } );
①、②の順ならよいのですが、②、①の順だとエラーが出ます。
function.phpではどちらでも大丈夫なようですが、この辺はどういった点を気を付けたらよいでしょうか。
MWFORM関連でも、同じフィルターフックでも下記で囲わないとエラーになる場合と、そのままでも大丈夫な場合があります。add_action( 'plugins_loaded', function() { -----内容------ } );
♥ 0 -
投稿者投稿