Installation of the template to a specific Wordpress page



  • I'm trying to connect to the name page. http://localhost/site/page-contacts/ new template. That's what I wrote in the file. page-contacts.php next code

    <?php get_header(); ?>
    
    &lt;div class="container"&gt;
        &lt;div class="row"&gt;&lt;br&gt;
            &lt;?php
                $post = get_post($post_id = 7); // Записываем все данные записи 7 в объект $post
                echo '&lt;p&gt;'.$post-&gt;post_content.'&lt;/p&gt;'; // Выводим контент записи;
            ?&gt;
        &lt;/div&gt;
    &lt;/div&gt;
    

    <?php get_footer(); ?>

    But it only turns out the contents of the futher and the hider, which should be added to remove the tape from such an aide? (I checked, there's a record on the database with that idy)



  • <div class="container">
        <div class="row"><br>
            <?php
                $post = get_post(7); // Просто 7
                echo wpautop($post->post_content); // Позвольте Wordpress самому разобраться с форматированием текста, с помощью функции wpautop
            ?>
        </div>
    </div>
    



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2