Error while pulling category post in static page
-
I’m editing the cute-seasons theme… It’s been established that the coding is horrific… And I’m getting all these wacky errors… Let me start at the beginning…
The first issue was no margins with the p tag… The twist here is that the margins only work with the following code:
<?php if (have_posts()) : ?> <?php $x = 0; ?> <?php while (have_posts()) : the_post(); ?> <?php if($x = 0){ ?> <?php $x++; ?> <?php }else{ ?> <div class="post">
Then the regular title/author stuff… then
`</div>
<?php } ?>
<?php endwhile; ?>`
Without the x=0, x++ etc no p margins… I don’t understand it, but that’s the case…Now, I’m trying to pull in a category post the entire post… So my code looks like the following…
<?php if (have_posts()) : ?> <?php $x = 0; ?> <?php while (have_posts()) : the_post(); ?> <?php if($x = 0){ ?> <?php $x++; ?> <?php }else{ ?> <div class="post"> <?php $my_query = "showposts=1&cat=3"; $my_query = new WP_Query($my_query); ?> <?php if ($my_query->have_posts()) : while ($my_query->have_posts()) : $my_query->the_post(); ?> <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <small>Posted by <?php the_author(); ?> on <?php the_time('j F, Y'); ?></small> <?php the_content('More...'); ?> </div> <?php } ?> <?php endwhile; ?> <?php endif; //end of loop ?>
And it throws an error… unexpected } on line 31 which is the section right above the endwhile…
Any coders have the answer for this?
Thanks,
J
- The topic ‘Error while pulling category post in static page’ is closed to new replies.