• 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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Without the x=0, x++ etc no p margins… I don’t understand it, but that’s the case…

    What’s not to understand? “Without the x=0, x++ etc”, everything you output falls within <div class="post">. So it’s possible that the theme’s stype sheet has diferent style definitions for p (generic paragraph) and .post p (a paragraph within a class=post tag)…

    Thread Starter jwesseldyke

    (@jwesseldyke)

    Thanks for your response…

    I added the definitions for .post p and p… So the initial thing was trying to figure that out… Thanks for explaining it…

    So how does that impact my pulling the category post instead of, say, the text on a page (write -> page)?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Error while pulling category post in static page’ is closed to new replies.