WordPress.org

Ready to get started?Download WordPress

Forums

Child of and tag in help (3 posts)

  1. justawebbie
    Member
    Posted 1 year ago #

    Can someone please tell me what i did wrong here. It shows the cat title but not the post or posts under the cat title which belong in the tag Spring 2012? The website is at justawebbie.com and the page I am working on is http://justawebbie.com/category/spring2012/. Thank you in advance for your help.

    <?php
    $curauth = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
    ?>
    
    <div id="posts">
    <?php $categories = get_categories("child_of=105"); foreach ($categories as $cat) { ?>
    		<?php query_posts("cat=$cat->cat_ID&&tag=124&order=ASC&orderby=name"); ?>
    
            <h1 class="pagetitle"><?php single_cat_title(); ?></h1>
    
    		<?php
    	$i = 0;
    	while (have_posts()) : the_post(); unset($prev, $image); $m++;
    
    	?>
    	<div class="post post-normal">
    			<?php
    		get_the_image( array( 'size' => 'loop-main', 'width' => 120, 'height' => 90, 'before' => '<div class="cover">', 'after' => '</div>' ) );
    		?>
    
    		<div class="content">
    			<div class="column_count"><a href="<?php the_permalink() ?>#commentspost" rel="nofollow" title="Jump to the comments"><?php comments_number('0','1','%'); ?></a></div>
    			<h2><a href="<?php the_permalink() ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
    			<p class="postmetadata"><span class="timestamp"><?php the_time('F j, Y'); ?></span><?php edit_post_link( __('EDIT', 'wpzoom'), ' | ', ''); ?></p>
    			<p><?php the_content_limit(160, ''); ?></p>
    			<p class="more"><a href="<?php the_permalink(); ?>" title="Permanent Link to <?php the_title_attribute(); ?>" rel="nofollow"><?php _e('Read Full Story', 'wpzoom');?> &raquo;</a></p>
    		</div>
    	</div>
    
    	<div class="sep">&nbsp;</div>
    	<?php endwhile; ?>
    
    	<div class="cleaner">&nbsp;</div>
    	<div class="sep">&nbsp;</div>	
    
       <?php }?>
    </div><!-- end #posts -->
  2. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    what are you trying to show with:

    <h1 class="pagetitle"><?php single_cat_title(); ?></h1>

    single_cat_title() only works in category (and tag) archive pages:
    http://codex.wordpress.org/Function_Reference/single_cat_title

  3. justawebbie
    Member
    Posted 1 year ago #

    It is a category page for cat*105 I want it to show only the child cat titles with the tag Fall 2012 and their posts with image.

Topic Closed

This topic has been closed to new replies.

About this Topic