[Resolved] is_home() or is_front_page() and the loop
I have been doing some looking around, and experimenting with code from others on the forum, but I haven’t found anything yet that applies to my particular situation.
I have my home page set to the blog, and the rest of my website done using static Pages (wordpress pages). I want the loop to show only on the blog (home page), and not on my static pages. I have been trying various tricks with the is_home() and the is_front_page() functions, but I’m really not much with php (yet!).
It seems to me that I should be able to use a conditional with one of those two, and just put it around the loop code. But everything I try has failed.
Could someone help me out?
Here is my loop code (nothing fancy):
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<?php the_date(”,'<h2>’,'</h2>’); ?>
<div <?php post_class() ?> id=”post-<?php the_ID(); ?>”>
<h3 class=”storytitle”>” rel=”bookmark”><?php the_title(); ?></h3>
<div class=”meta”><?php _e(“Filed under:”); ?> <?php the_category(‘,’) ?> — <?php the_tags(__(‘Tags: ‘), ‘, ‘, ‘ — ‘); ?> <?php the_author() ?> @ <?php the_time() ?> <?php edit_post_link(__(‘Edit This’)); ?></div>
<?php wp_link_pages(); ?>
<?php comments_popup_link(__(‘Comments (0)’), __(‘Comments (1)’), __(‘Comments (%)’)); ?>
<div class=”post” id=”post-<?php the_ID(); ?>”>
<?php the_content(‘Read More »’); ?>
<?php endwhile; ?>
- The topic ‘[Resolved] is_home() or is_front_page() and the loop’ is closed to new replies.