Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Help with Category page WordPress

I have yet another simple question I believe...and I hope.

I'm just trying to rearrange some code without necessarily redoing everything.

Here's the code to my category page:


<?php get_header(); ?>

<div class="mainFrame noMarginTopWithContent">

<div class="leaderboard">
<?php if (function_exists('oiopub_banner_zone')) oiopub_banner_zone(1, 'center'); ?>
</div>
<div class="clear"></div>
<ol class="mainFrameModule breadCrumbs">
<?php if ( function_exists('yoast_breadcrumb') ) {
yoast_breadcrumb('<p id="breadcrumbs">','</p>');
} ?>
</ol>
<div class="mainFrameModule last">
<div class="leftColumn">

<!-- Start Feature Module-->
<div class="featuredModule" id="layout_14">
<?php
query_posts(array(
'tag' => 'featured',
'posts_per_page' => 1
));
while (have_posts()) : the_post(); $i++; ?>

<div class="CentralFeatured dropShadowBottomCurved <?php if ($i == 2) echo 'last'; ?>">
<a class="gradientCover" href="<?php the_permalink(); ?>"></a>
<a href="<?php the_permalink(); ?>">
<?php if (has_post_thumbnail()) { ?>
<?php the_post_thumbnail('main-category'); ?>
<?php } ?>
</a>
<div class="metaInfo">
<h3>
<a href="<?php the_permalink(); ?>" title=""><?php the_title(); ?></a>
</h3>
<span>By <?php the_author(); ?></span>
</div>

</div>
<?php endwhile; ?>
<?php
query_posts(array(
'tag' => 'featured',
'posts_per_page' => 4,
'offset' => 2
));
while (have_posts()) : the_post(); ?>
<div class="smallFeatured dropShadowBottomCurved <?php if ($i == 4) echo 'last'; ?>">
<a class="gradientCover" href="<?php the_permalink(); ?>"></a>
<a href="<?php the_permalink(); ?>">
<?php if (has_post_thumbnail()) { ?>
<?php the_post_thumbnail('main-feature-small'); ?>
<?php } ?>
</a>
<div class="metaInfo">
<h3><a href="<?php the_permalink(); ?>" title=""><?php the_title(); ?></a></h3>
<span>By <?php the_author(); ?></span>
</div>
</div>
<?php endwhile; ?>
</div>
<!-- End Feature Module-->

<div id="ArticleList">
<?php wp_reset_query(); ?>
<div style="padding-bottom: 5px;
border-bottom: 2px solid #e7e6e4;
height: 25px;
margin: 10px 0px 15px;width:650px;float:left;">
<h2><?php single_cat_title(); ?> Archive</h2>
</div>
<?php wp_reset_query(); while (have_posts()) : the_post() ; $post_count++; ?>

<div class="cb ChList ">
<a class="flt" href="<?php the_permalink(); ?>">
<?php the_post_thumbnail(array(157, 185)); ?>
</a>
<div class="cont">
<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
<h6><?php the_time(); ?> by <?php the_author(); ?></h6>
<?php the_excerpt(); ?>

</div>
</div>

<?php if ($post_count == 5) :?>
<div class="cb ChList SReport">
<h3 class="sectionbar">Special Reports</h3>

<div class="cb">

<?php $my_query = new WP_Query(array(
'tag' => 'featured',
'posts_per_page' => 2,
'offset' => 2
));

while ($my_query->have_posts()) : $my_query->the_post(); ?>
<div class="flt col2">
<div class="SRgradient"><?php the_post_thumbnail(array(325, 170)); ?></div>
<div class="SRblock SRdkblue">
<div class="SRname orangebg">
<div class="h10b title">Finding The Right Business</div>
</div>
<div class="SRtitleholder">
<h5><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h5>
<div class="deck"><a href="<?php the_permalink(); ?>"><?php the_excerpt(); ?></a></div>

</div>
</div>
</div>
<?php endwhile; ?>
</div>

</div>
<?php endif; ?>


<?php endwhile; ?>




<?php wp_pagenavi(); ?>


</div>

</div>
<div class="rightColumn">
<?php get_sidebar(); ?>
</div>
<div class="clear"></div>
</div>
<?php get_footer(); ?>
</div>



At the top of the page, there's a feature box that uses the tag "featured" and then below these featured posts is the archive for the categories.

I was wondering if there was a way that I could remove the feature tag and have all of my most recent category posts fill out the page with the five most recent posts occupying these featured boxes and then everything else files out normally.

Here's a link to one of my category pages: http://theurbantwist.com/category/features/interviews/

Thanks!

Answers (2)

2013-12-06

Balanean Corneliu answers:

Maybe this link can help you to fix that : http://yoast.com/wordpress-archive-pages/


And i have tested your page in firefox and its something wrong theare i atach a printscreen.
Now i need to go to sleep maybe some other expert can write a fixed code for you.
good luck.


Brennen Jones comments:

Thanks for the info on Firefox...I usually use Chrome and Internet Explorer and didn't notice that. I'll have to add that to the list of problems, lol.


Balanean Corneliu comments:

To solve that problem change in your code the div style with this one :

<div style="border-bottom: 1px solid #D6DBE1; font-size: 13px; margin-bottom: 15px; padding: 0 5px 10px 0; width: 640px;">

2013-12-06

Arnav Joy answers:

what is "Special Reports" reports ?


Brennen Jones comments:

That's a section in the page where it has a different query for different category to show. I'm actually removing that.


Arnav Joy comments:

try this

<?php get_header(); ?>



<div class="mainFrame noMarginTopWithContent">



<div class="leaderboard">

<?php if (function_exists('oiopub_banner_zone')) oiopub_banner_zone(1, 'center'); ?>

</div>

<div class="clear"></div>

<ol class="mainFrameModule breadCrumbs">

<?php if ( function_exists('yoast_breadcrumb') ) {

yoast_breadcrumb('<p id="breadcrumbs">','</p>');

} ?>

</ol>

<div class="mainFrameModule last">

<div class="leftColumn">

<?php
$count = 0;

while (have_posts()) : the_post(); $i++;

if( $count == 0 ) {
?>

<!-- Start Feature Module-->



<div class="featuredModule" id="layout_14">



<?php if( $count == 0 ) { ?>

<div class="CentralFeatured dropShadowBottomCurved <?php if ($i == 2) echo 'last'; ?>">

<a class="gradientCover" href="<?php the_permalink(); ?>"></a>

<a href="<?php the_permalink(); ?>">

<?php if (has_post_thumbnail()) { ?>

<?php the_post_thumbnail('main-category'); ?>

<?php } ?>

</a>

<div class="metaInfo">

<h3>

<a href="<?php the_permalink(); ?>" title=""><?php the_title(); ?></a>

</h3>

<span>By <?php the_author(); ?></span>

</div>



</div>

<?php $count++ ; continue; } if( $count <= 4 ) { ?>

<div class="smallFeatured dropShadowBottomCurved <?php if ($i == 4) echo 'last'; ?>">

<a class="gradientCover" href="<?php the_permalink(); ?>"></a>

<a href="<?php the_permalink(); ?>">

<?php if (has_post_thumbnail()) { ?>

<?php the_post_thumbnail('main-feature-small'); ?>

<?php } ?>

</a>

<div class="metaInfo">

<h3><a href="<?php the_permalink(); ?>" title=""><?php the_title(); ?></a></h3>

<span>By <?php the_author(); ?></span>

</div>

</div>


<?php $count++ ;continue; } if( $count == 5 ) { ?>
</div>
<?php } ?>


<!-- End Feature Module-->



<div id="ArticleList">



<div style="padding-bottom: 5px;

border-bottom: 2px solid #e7e6e4;

height: 25px;

margin: 10px 0px 15px;width:650px;float:left;">

<h2><?php single_cat_title(); ?> Archive</h2>

</div>


<div class="cb ChList ">

<a class="flt" href="<?php the_permalink(); ?>">

<?php the_post_thumbnail(array(157, 185)); ?>

</a>

<div class="cont">

<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>

<h6><?php the_time(); ?> by <?php the_author(); ?></h6>

<?php the_excerpt(); ?>



</div>

</div>


<?php endwhile; ?>



<?php wp_pagenavi(); ?>





</div>



</div>

<div class="rightColumn">

<?php get_sidebar(); ?>

</div>

<div class="clear"></div>

</div>

<?php get_footer(); ?>

</div>