View Single Post
Old 03-19-2009, 08:23 AM  
Jdoughs
Confirmed User
 
Jdoughs's Avatar
 
Industry Role:
Join Date: Mar 2004
Location: Great White North
Posts: 5,794
Wordpress puzzle. (advanced code problem)

Allright, I've been tweakin and playing with a theme and have done some extensive 'categorizing' to lay out this site. But just cant get the main page to display its categories and childs properly (non conventionally btw)

It has Parent Categories for A through Z. http://www.classic-porn.ca/list/j/ <-- category
Stars are childs of the first letter of their name, IE, Joanna Storm is a child category of "J ". http://www.classic-porn.ca/list/j/joanna-storm/ <-- child category of J

Now here is the issue, this code here displays the categories (as picked in the config to display on main index), if you look at www.classic-porn.ca , you can see that the Categories (A -Z) are listed, and the movies are posted, BUT it is showing the wrong child category. IE Bunny Bleu shows up in her parent Category (properly) but she also shows up in 'G' and in 'R' (because that movie is also posted in those other categories (its pulling them alphabetically I suppose but I need it to pull the proper child category that fits under that Parent.

PHP Code:
    <?php $i 0?>
    <?php foreach ($left_categories as $section) { ?>
    <?php $i++; ?>
    <?php query_posts('showposts=1&cat='.$section); ?>
    <?php $feed $section?>
    <h2><?php single_cat_title(); ?> <a href="<?php print get_category_feed_link($feed''); ?>"><img src="<?php bloginfo('template_directory'); ?>/images/rss.png" alt="" title="RSS" /></a></h2>
    <a href="<?php echo get_category_link($section); ?>" class="more">Read More</a><div class="clear"></div>
    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>
    <div class="postbox">
    <div class="top_thumb"><?php show_thumb(60,90); ?></div>
    <div class="top_entry">
<h3><?php
$category 
get_the_category();
echo 
$category[0]->cat_name;
?> - <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3><br />
        <div class="excerpt"><p><?php print do_excerpt(get_the_excerpt(), 15); ?></p></div>
        <ul class="postbit">
        <li><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>">Read Full Story</a></li>
        <li><a href="<?php the_permalink() ?>#comments" title="Go to Comments"><?php comments_number('0 Comments','1 Comment','% Comments'); ?></a></li>
        </ul>
    </div><div class="clear"></div>
    </div>
Now its all 'functioning' properly, I just need it to 'display' the proper child category, so that the stars name (child category) is shown that the post is associated with. So that Bunny Blue doesnt show up in 3-4 categories on the main page, only the category that she is a 'child' of.

Thanks a bunch, im fucking baffled at this point.
__________________
LinkSpun - Premier Adult Link Trading Community - ICQ - 464/\281/\250
Be Seen By New Webmasters/Affiliates * Target out webmasters/affiliates based on niches your sites are for less than $20 a month.
AmeriNOC - Proudly hosted @ AmeriNOC!
Jdoughs is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote