2017-01-12 9 views
0

私は5ページあり、最後の2ページの異なるレイアウトを作成しました。そのレイアウトにはinfoDivクラスのdivがあり、divにはちょうど手動でソースコードに入れて、私はそれをwordpressで変更することはできません。クライアントがコードを変更する必要がないように、どうすればダッシュボードで利用できるのですか?wordpressの特定のページの特別なテンプレートのテキストを印刷する方法

  <?php 

     /* 
     Template Name: Special Layout  
     */ 

     get_header(); 

     if (have_posts()) { 

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

       <article class="borderClass"> 
        <h2> <?php the_title(); ?> </h2> 

        <div class="infoDiv"> 
         <h4>This is info div</h4> 
         <p>this is the text I want to edit or add 
          using dashboard.</p> 

        </div> 


        <?php the_content(); ?> 
       </article> 

       <?php 
      } 
     } else { 
      echo "<p>No content found</p>"; 
     } 

     get_footer(); 

答えて

0

だけ

<article class="borderClass"> 

    <?php the_title('<h2>', '</h2>'); ?> 

    <div class="infoDiv"> 

    <?php the_content(); ?> <!-- Entered content --> 

    </div> 

</article> 
以下のような <?php the_content(); ?>を移動
関連する問題