Title: is_front_page problem
Last modified: August 21, 2016

---

# is_front_page problem

 *  [Philljc](https://wordpress.org/support/users/philljc/)
 * (@philljc)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/is_front_page-problem/)
 * Either of these two conditions work by themselves, but when I put them in this
   if/else statement, I always receive an error:
 * **Parse error: syntax error, unexpected ‘}’ in /public_html/timeline/wp-content/
   themes/timeline/index.php on line 65**
 * The conditional is:
 *     ```
       <?php if (is_front_page()) { ?>
           <?php
               $current_year = date('Y');
               $args = array('category_name' => $current_year);
               $category_posts = new WP_Query($args);
   
               if($category_posts->have_posts()) :
                   while($category_posts->have_posts()) :
                       $category_posts->the_post();
           ?>
       <?php } else { ?>
           <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
       <?php } ?>
       ```
   
 * Is it because I’m putting PHP tags in PHP? I can’t make sense of it.
 * Thanks

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/is_front_page-problem/#post-3644536)
 * the nesting of the conditional statements does not work the way you are trying;
 * you will need to use a full loop for the `$category_posts`
 *  Thread Starter [Philljc](https://wordpress.org/support/users/philljc/)
 * (@philljc)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/is_front_page-problem/#post-3644571)
 * Can you elaborate on why that wont work?
 * As I said, if I use either piece of code on its own, it’s fine, why would it 
   break in a conditional statement?
 * _[Bump deleted]_
 *  [Vaib](https://wordpress.org/support/users/vaibhavg/)
 * (@vaibhavg)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/is_front_page-problem/#post-3644704)
 * hi,
    Please Paste your full code then I will try to find the problem.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘is_front_page problem’ is closed to new replies.

## Tags

 * [conditional](https://wordpress.org/support/topic-tag/conditional/)
 * [posts](https://wordpress.org/support/topic-tag/posts/)
 * [query](https://wordpress.org/support/topic-tag/query/)

 * 3 replies
 * 3 participants
 * Last reply from: [Vaib](https://wordpress.org/support/users/vaibhavg/)
 * Last activity: [13 years, 1 month ago](https://wordpress.org/support/topic/is_front_page-problem/#post-3644704)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
