サポート » その他 » カスタム投稿のプラグインを使っていますが、何故か真っ白になってしまいます

  • 下記のコードでは、真っ白にならない
    1.「流れ」
    2.「カテゴリー」

    
    <section>
    <h3>流れ</h3>
    <ul class="clearfix">
    	<?php
    		$args = array(
    			'numberposts'	=> -1,
    			'post_type'		=> 'service_slug', // カスタム投稿タイプを指定
    			'category_name'	=> 'business-flow',
    			'tax_query' => array(
    				array(
    					'taxonomy'	=> 'service',
    					'field'		=> 'slug',
    					'terms'		=> $term
    				)
    			)
    		);
    		$Custom = get_posts($args);
    		if($Custom) : foreach( $Custom as $post ) : setup_postdata( $post );
    	?>
    	<li>
    		<?php $flow_01 = get_field('flow01_img'); ?><figure><img src="<?php echo $flow_01['url']; ?>" alt="<?php echo post_custom('flow01_ttl'); ?>"></figure>
    		<div class="detail">
    			<h4><?php echo post_custom('flow01_ttl'); ?></h4>
    			<p class="txt"><?php echo post_custom('flow01_txt'); ?></p>
    		</div>
    	</li>
    	<li>
    		<?php $flow_02 = get_field('flow02_img'); ?><figure><img src="<?php echo $flow_02['url']; ?>" alt="<?php echo post_custom('flow02_ttl'); ?>"></figure>
    		<div class="detail">
    			<h4><?php echo post_custom('flow02_ttl'); ?></h4>
    			<p class="txt"><?php echo post_custom('flow02_txt'); ?></p>
    		</div>
    	</li>
    	<li>
    		<?php $flow_03 = get_field('flow03_img'); ?><figure><img src="<?php echo $flow_03['url']; ?>" alt="<?php echo post_custom('flow03_ttl'); ?>"></figure>
    		<div class="detail">
    			<h4><?php echo post_custom('flow03_ttl'); ?></h4>
    			<p class="txt"><?php echo post_custom('flow03_txt'); ?></p>
    		</div>
    	</li>
    	<?php endforeach; endif;?>
    </ul>
    </section>
    
    <section>
    <h3>カテゴリー</h3>
    <div class="page-nav">
    	<?php
    		$taxonomy = 'case_type';
    		$args02 = array( 'hide_empty' => false );
    		$terms_list = get_terms( $taxonomy , $args02 );
    		$term_id = get_queried_object_id();
    		if ( count( $terms_list ) != 0 ) {
    			echo '<ul class="sort-nav">';
    			foreach ( $terms_list as $term_list ) {
    				$term_list = sanitize_term( $term_list, $taxonomy );
    				echo '<li class="btnCat' .$term_list->term_id. '">' . $term_list->name . '</li>';
    			}
    			echo '<li class="btnall" id="active">全て</li></ul>';
    		}
    	?>
    	<form role="search" method="get" id="searchform" action="<?php echo home_url( '/' ); ?>" >
    		<input type="text" value="" name="s" class="s" size="30" maxlength="255">
    		<input type="hidden" value="<?php echo get_post_type(); ?>" name="post_type" id="post_type">
    		<input type="hidden" name="cat" value="24">
    		<input type="image" class="searchsubmit" name="submit" src="<?php echo get_template_directory_uri(); ?>/img/common/ico_search_blue.svg" alt="検索">
    	</form>
    </div>
    <ul class="articles">
    <?php
    	$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
    	$args = array(
    		'posts_per_page' => 10, // 投稿する表示数
    		'post_type' => 'service_slug', // カスタム投稿タイプを指定
    		'category_name'	=> 'production-case',
    		'paged' => $paged,
    		'tax_query' => array(
    			array(
    				'taxonomy' => 'service',
    				'field'    => 'slug',
    				'terms' => $term
    			)
    		)
    	);
    	$the_query = new WP_Query( $args );
    ?>
    <?php if ( $the_query -> have_posts() ) : ?>
    <?php while ( $the_query -> have_posts() ) : $the_query -> the_post(); ?>
    	<li class="more-loop cat<?php $term = get_field('production-case_type'); if( $term ): ?><?php echo $term -> term_id; ?><?php endif; ?>">
    		<div class="photos">
    			<a href="<?php the_permalink(); ?>">
    				<?php $case_photo01 = get_field('img01-case_type'); if( !empty($case_photo01) ): ?><figure><img src="<?php echo $case_photo01['url']; ?>" alt="<?php the_title(); ?>"></figure><?php endif; ?>
    			</a>
    		</div>
    		<div class="detail">
    			<h4><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4>
    			<div class="sub">
    				<p class="date"><?php echo $term->name; ?></p>
    				<p class="btn"><a href="<?php the_permalink(); ?>">more…</a></p>
    			</div>
    		</div>
    	</li>
    
    <?php endwhile; ?>
    <?php wp_reset_postdata(); ?>
    <?php else: ?>
    	<li class="none white">記事はありません。</li>
    <?php endif; ?>
    </ul>
    
    <?php if( $paged < $the_query -> max_num_pages ){ ?>
    <div class="moreread btn02" id="next">
    	<a href="<?php echo next_posts( $the_query -> max_num_pages, false); ?>">続きを見る</a>
    </div>
    <?php }; ?>
    </section>
    
    

    順番を並び替えたところ、真っ白になってしまいます。
    1.「カテゴリー」(ちゃんと表示出来てる)
    2.「流れ」(タイトル部分だけ表示出来てあとのコンテンツが真っ白)

    使用プラグイン
    ・カスタムフィールド
    ・カスタムポスト

    上記の2点は自作ではありません。

    プラグインを中心に使用しております。

    ご教授お願い致します。

1件の返信を表示中 - 1 - 1件目 (全1件中)
  • モデレーター のむらけい (Kei Nomura)

    (@mypacecreator)

    真っ白だと原因を探りにくいので、まずは具体的なエラーが出るようにしましょう。
    wp-config.php ファイル内で

    define( 'WP_DEBUG', false );
    という行があると思うので、false → true に変えてみてください。
    まずは、真っ白ではなくエラーメッセージが出てくるようになりましたでしょうか。
    それがヒントになります。そのエラーメッセージを添えていただくと解決への近道になります。

    参考:WordPressでのデバック – WordPress Codex 日本語版

1件の返信を表示中 - 1 - 1件目 (全1件中)
  • トピック「カスタム投稿のプラグインを使っていますが、何故か真っ白になってしまいます」には新たに返信することはできません。