0
<?php

/* Template Name : Home
*/
?>
get_header(); ?>

 <?php get_footer(); ?>

When I type anything on content editor of the page it doesn't show any thing.

How do I make it working?

1
  • How do I make it working?. By adding a loop ;-) Dec 1 '15 at 8:55
0

you need to add the loop before and after and add the function the_content()

something like this:

<?php
/**
** Template Name : Home
**/
get_header(); ?>

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

    <?php the_content(); ?>

<?php endwhile; // end of the loop. ?>


<?php get_footer(); ?>
0

By adding a loop you can query all your posts, which you entered in the back end . just do it like this

    <?php 
    /**
     *    Template Name: Home 
     **/
     get_header();  

     //Here i added a loop to explain you.
      if ( have_posts() ) {
           while ( have_posts() ) {

           the_title();    // Post title

            the_content();  // Post Content here

         } // end while
     } // end if

 get_footer();   ?>

From the above code I added a loop and within the loop two functions. which will get you the posts and its content, the_content function will get you editor content.

2
  • Your post was flagged as very low quality. Please file an edit and add proper explanation to what your code does, how it works, etc. Dumping code is considered as low/bad quality answers. I'm not going to cast a vote to delete this right now, but please, rectify your problems Dec 1 '15 at 9:37
  • 1
    I added some explanations now. is it enough for the answer?
    – Kvvaradha
    Dec 1 '15 at 9:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.