WordPress.org

Ready to get started?Download WordPress

Forums

Theme Category Page (3 posts)

  1. justinlosh
    Member
    Posted 4 years ago #

    Hello,
    I'm trying to code a page to display a author's bio and picture, and then I just need to display certain categories, for example categories 50, 51, 52, 53 with their full post, post category, and date posted. I've not had much luck. So far I have this:

    <?php
    /**
     * @package WordPress
     * @subpackage Default_Theme
     */
    /*
    Template Name: Name of Author Page
    */
    ?>
    
    <?php get_header(); ?>
    
    <div id="content">
    
    	<div id="contentleft">
    
    	<h1>Author Name</h1>
    			{WILL DISPLAY PICTURE AND QUICK BIO HERE}<br /><br />
    
    		<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    		<?php endwhile; else: ?>
    
    		<p><?php _e('Sorry, no posts matched your criteria.'); ?></p><?php endif; ?>
    
    	</div>
    
    	<?php include(TEMPLATEPATH."/l_sidebar.php");?>
    
    	<?php include(TEMPLATEPATH."/r_sidebar.php");?>
    
    </div>
    
    <!-- The main column ends  -->
    
    <?php get_footer(); ?>

    TIA for any help!

  2. jessn
    Member
    Posted 4 years ago #

    Instead of this:

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <?php endwhile; else: ?>
    <p><?php _e('Sorry, no posts matched your criteria.'); ?></p><?php endif; ?>

    Try this:

    <?php query_posts('cat=2,6,17,38'); ?>
    <?php while (have_posts()) : the_post(); ?>
    
    <?php endwhile; ?>

    Replacing the numbers with your category IDs

  3. justinlosh
    Member
    Posted 4 years ago #

    no content will show up on the page, and i've triple checked the code and category id's... any ideas?

    <?php
    /**
     * @package WordPress
     * @subpackage Default_Theme
     */
    /*
    Template Name: Name of Author Page
    */
    ?>
    
    <?php get_header(); ?>
    
    <div id="content">
    
    	<div id="contentleft">
    
    	<h1>Author Name</h1>
    			{WILL DISPLAY PICTURE AND QUICK BIO HERE}<br /><br />
    
    		<?php query_posts('cat=41'); ?>
    <?php while (have_posts()) : the_post(); ?>
    
    <?php endwhile; ?>
    	</div>
    
    	<?php include(TEMPLATEPATH."/l_sidebar.php");?>
    
    	<?php include(TEMPLATEPATH."/r_sidebar.php");?>
    
    </div>
    
    <!-- The main column ends  -->
    
    <?php get_footer(); ?>

Topic Closed

This topic has been closed to new replies.

About this Topic