• I have the following for my home/index page template.

    <?php /* Template Name: Home Page */ ?>
    
    <?php get_header(); the_post(); ?>
    
    <?php get_sidebar(); ?>
    
    <h1><?php echo get_post_meta($post->ID, 'title_for_bodytext', true); ?></h1>
    <?php the_content(); ?>
    
    <?php get_footer(); ?>

    If I go directly to my blog, it does not work. So myDomain.com does not work. If I go to myDomain.com/home, then it works. what do I have to do, to make it work from myDomain.com directly?

    Thanks a lot for any help!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You need to incorporate the Loop into your template.

    Thread Starter brian914

    (@brian914)

    Just so I understand this, how come I have to do that? The way I understood this, is that I have the current page’s content via the the_post() up at:
    <?php get_header(); the_post(); ?>

    And I thought that then I can get the meta for this post via the get_post_meta().

    And this seems to work when go to the specified permalink for this page. But once this is the index page for this blog it no longer gets that info. So does it have to do with the location of the page?

    Thank you so much for the help!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Home page post not working’ is closed to new replies.