A
A
Alexey Chernov2015-09-24 12:34:49
PHP
Alexey Chernov, 2015-09-24 12:34:49

Why doesn't the_content( ); in single.php?

<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <div <?php post_class() ?> id="post-<?php the_ID(); ?>">
        <h2><?php the_title(); ?></h2>
        <?php the_content();?>
      </div>
    <?php endwhile; else: ?>
      <?php _e('Извините, по вашему запросу ничего не найдено'); ?>
    <?php endif; ?>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim E, 2015-09-24
@creativeworm

<?php post_class() ?> - ;
Displays the rest? Is there one cycle per page?

A
Alexey Chernov, 2015-09-24
@Limme

Here is the full page code

<?php
    /*
Template Name: Копилка
*/
?>

  
<?php get_header('projects'); ?>
    <link rel="stylesheet" type="text/css" href="<?php bloginfo("template_directory");?>/css/Blog-single.css">
   

    <div class="PostHeader">
    	<div class="row">
          <p class="PostDate"><?php the_date(); ?></p>
          <a href="<?php echo get_permalink(); ?>"><h2 class="titlepost"><?php the_title();?></h2></a>

          <div class="LineBot"></div>
          <div class="RowTags RowTagsBlog">
            <ul class="Tags">
              <li class="ContainerTags">
                <?php echo get_the_tag_list($before = '<div class="Tag"></div>', $sep = ' <div class="Tag"></div> ', $after = '' );?>
              </li>
            </ul>
          </div>
    </div>
  </div>
    
    <div class="row content">
    
      <div class="container">
      <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <div <?php post_class() ?> id="post-<?php the_ID(); ?>">
        <h2><?php the_title(); ?></h2>
        <?php the_content();?>
      </div>
    <?php endwhile; else: ?>
      <?php _e('Извините, по вашему запросу ничего не найдено'); ?>
    <?php endif; ?>
    </div>
  
  <div class="page"></div> 
  
    <div class="Features">
      <div class="row FTRS">
      <?php  

    $args = array(
                   'post_type' => 'kopilka',
                   'publish' => true,
                   'posts_per_page' => -1,
                   'cat' => '62',
               );
            
            query_posts($args);

     if (have_posts()) : 

       while (have_posts()) : the_post(); 
   		?>
<?php $imagefeatures = get_field(back_post_features); ?>
        <div class="FeaturesBlocks Back1" style="background-image: url(<?php echo $imagefeatures['url']; ?>)" alt="<?php echo $imagefeatures['alt']; ?>);">
          <div class="frame">
            <div class="RowLabel">
            <h1><?php the_title(); ?></h1>
            </div>
            <div class="RowParagrath">
            <p class="Date"><?php the_date(); ?></p>
            <div class="MiniLine"></div>
            </div>
          </div>
        </div>
<?php endwhile; ?>              
      <?php else : ?>             
      <?php endif; ?> 				
        
      </div>
    </div>

  

<?php get_footer('projects');?>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question