2017-06-20 12 views
1

私のWordpress 4.7.8 localhostカスタムテーマのWebページに問題があります。どこ私は可能性のあるアイデアを ...and image the view in wordpressページのタイトルと内容が間違っている(wordpress/bootstrap/php)

: は同様にハード私がしようとして、私は、コンテンツがあるべき「タイトル」取得し、ここでタイトル Here is an image の場所でコンテンツが、それはwordpressの管理ダッシュボードにどのように見えるかあり続けます間違っている?

答えて

1

このコードを試してください。

Search bar in duplicate (wordpress/php/bootstrap)

以前の質問から取らこのコード。

このコードは、タイトル<?php the_title(); ?>とこのコード表示内容<?php the_content(); ?>を表示するためのコードです。どこでもこのコードを置き換えることができます。

<?php get_header(); ?> 

    <div class="row"> 

     <div class="col-xs-12 col-sm-8"> 

      <div class="row text-center no-margin"> 

      <?php 
      $currentPage = (get_query_var('paged')) ? get_query_var('paged') : 1; 
      $args = array('posts_per_page' => 3,'post_type'=>'post', 'paged' => $currentPage); 
      new WP_Query($args); 
      if(have_posts()): $i = 0; 

       while(have_posts()): the_post(); ?> 

        <?php 
         if($i==0): $column = 12; $class = ''; 
         elseif($i > 0 && $i <= 2): $column = 6; $class = ' second-row-padding'; 
         elseif($i > 2): $column = 4; $class = ' third-row-padding'; 
         endif; 

        ?> 


         <div class="col-xs-<?php echo $column; echo $class; ?> blog-item"> 
          <?php if(has_post_thumbnail()): 
           $urlImg = wp_get_attachment_url(get_post_thumbnail_id(get_the_ID())); 
          endif; ?> 
          <div class="blog-element" style="background-image: url(<?php echo $urlImg; ?>);"> 

           <!--<?php the_title(sprintf('<h1 class="entry-title"><a href="%s">', esc_url(get_permalink())),'</a></h1>'); ?> --> 
           <h1 class="entry-title"><?php the_title(); ?></h1> 

           <?php the_content(); ?> 

           <small><?php the_category(' '); ?></small> 
          </div> 
         </div> 

       <?php $i++; endwhile; ?> 

       <div class="col-xs-6 text-left"> 
        <?php next_posts_link('« Older Posts'); ?> 
       </div> 
       <div class="col-xs-6 text-right"> 
        <?php previous_posts_link('Newer Posts »'); ?> 
       </div> 

      <?php endif; 
        wp_reset_query(); 
      ?> 
      </div> 

     </div> 

     <div class="col-xs-12 col-sm-4"> 
      <?php get_sidebar(); ?> 
     </div> 

    </div> 
+0

おかげで多くのことを示しています!これはタイトルとページの内容が間違っているという問題を解決しました。今私はちょうど私のダブルポストの問題を解決する必要があります:) –

+0

あなたを助けるためにうれしい.. :) – vel

0

投稿コンテンツの順序を変更するには、content-single.phpファイルを編集する必要があります。あなたの投稿のコンテンツは、投稿のタイトルの前に最初に読み込まれています。

チェックすると、

the_content() or get_the_content() 

は、前

get_the_title() or the_title() 
関連する問題