Support » How-To and Troubleshooting » blog function not working

blog function not working

  • hi ive built my own theme from scratch and the blog function isnt working.
    my blog page doesn’t pull all my posts in excerpt snippets the page just remains blank. does any1 know the the php code or loop to amend this.
    thanks in advance

Viewing 5 replies - 1 through 5 (of 5 total)
  • http://codex.wordpress.org/The_Loop

    It’s hard to be more specific without knowing what you’ve done so far…

    ive cretated a seperate template for the blog roll. ive use this code so far but it doesnt display the post execerpts.

    [please mark any posted code – see http://codex.wordpress.org/Forum_Welcome#Posting_Code ]

    <?php get_header(); ?>
    <?php if (have_posts()) : ?>
      <?php if (($wp_query->post_count) > 1) : ?>
         <?php while (have_posts()) : the_post(); ?>
           <!-- Do your post header stuff here for excerpts-->
              <?php the_excerpt() ?>
           <!-- Do your post footer stuff here for excerpts-->
         <?php endwhile; ?>
      <?php else : ?>
         <?php while (have_posts()) : the_post(); ?>
           <!-- Do your post header stuff here for single post-->
              <?php the_content() ?>
           <!-- Do your post footer stuff here for single post-->
         <?php endwhile; ?>
      <?php endif; ?>
    <?php else : ?>
         <!-- Stuff to do if there are no posts-->
    <?php endif; ?>
    <?php get_footer(); ?>

    Is that your index.php? Are you using the default setup for your blog, as in it is the main page, or do you have another page set to be your blog page, with a static front page?

    It is important to understand your setup, and file naming to be able to troubleshoot.

    the blog page has its own blog.php page
    my index.php is my frontpage its static and has is_frontpage(); code in it


    Are you sure the proper template is loading?

    I’m pretty sure blog.php isn’t in the naming conventions

    WP doesn’t look for a file named blog.php, so it’s probably trying to use index.php to display your blog posts

    I’m not 100%, but front-page.php would probably be a good choice for a static front page, and will always load for it, then index.php would be utilized for blog posts.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘blog function not working’ is closed to new replies.