The text of the page does not appear in page.php

0

Good morning,

I have the following code in page.php

    <?php the_post_thumbnail('thumbnail') ?>


<section class="cuadricula_equipo">
  <div class="cuadricula_fotos">
    <div class="foto_1"></div>
    <div class="foto_2"></div>
    <div class="foto_3"></div>
    <div class="foto_4"></div>
  </div>

  <article class="equipo_descripcion">
   <div><?php the_content(); ?></div>
  </article>
</section>  

In the backooffice, I have a page that is called a team and inside a description. The problem that I have, that I see the images but through the template tag the_content I do not see it.

Is it possible that the_content is only for entries and not valid for pages? What would it be for pages if it is wrong?

Thank you!

    
asked by Raúl 30.08.2017 в 18:01
source

1 answer

0

The problem is that the_content works in the Wordpress loop. That is:

<section class="cuadricula_equipo">
  <div class="cuadricula_fotos">
    <div class="foto_1"></div>
    <div class="foto_2"></div>
    <div class="foto_3"></div>
    <div class="foto_4"></div>
  </div>

  <article class="equipo_descripcion">

  <?php while ( have_posts() ) : the_post(); ?> 
    <div>
        <?php the_content(); ?> 
    </div>
  <?php endwhile; ?>

  </article>
</section>  

In some cases, if you want to use it outside the loop, you can do:

echo $post->post_content;

This option I'm not sure works on the pages.

    
answered by 30.08.2017 / 21:35
source