WordPress.org

Ready to get started?Download WordPress

Forums

wp2.5 breaks query_posts usage (4 posts)

  1. shua
    Member
    Posted 6 years ago #

    I have pages that have a bit of descriptive content on them - I then list some articles that relate to the page. I did it this way so I could easily control the navigation.

    I have found that upgrading to 2.5.1 has broken my pages. Please take a quick look at the example below:

    This page works in 2.0.5...
    http://www.seesawnetworks.com/affiliates/articles/

    here is my code snippit

    <?php if (have_posts()) : ?>
    	<?php while (have_posts()) : the_post(); ?>
    		<div id="featureMsgLanding">
    			<h1><?php echo c2c_get_custom('landingHead'); ?></h1>
    		</div>
    	<?php endwhile; ?>
    <?php endif; ?>
    
    <!--- Begin Loop News Category --->
    <div style="margin-left:10px;width:530px;clear:both;">
    	<?php query_posts('category_name="Article Affiliate"&showposts=10');
    		while (have_posts()) : the_post();
    		$do_not_duplicate = $post->ID; ?>
    			<table border="0" width="540" cellspacing="0" cellpadding="0" id="newsPRevents">
    				<tr valign="top">
    					<td><img src="<?php echo get_template_directory_uri() . '/images/avatars/avatarArticles50x50.gif' ?>" width="50" height="50" alt="<?php the_title(); ?>" border="0"/></td>
    					<td valign="top">
    						<h1><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
    						<?php the_excerpt(); ?>
                                            </td>
    				</tr>
    			</table>
    			<p />
    		<?php endwhile; ?>
    	</div>
    <!--- End Loop News Category --->

    Now the page renders without the query_posts('category_name="Article Affiliate"&showposts=10'); ...?> kicking off.

    thoughts?

  2. Evita
    Member
    Posted 6 years ago #

    Try
    '<?php query_posts('category_name=Article Affiliate&showposts=10');'

  3. shua
    Member
    Posted 6 years ago #

    ha! that was the first thing I tried - wp doesn't seem to like spaces - still didnt work.

  4. shua
    Member
    Posted 6 years ago #

    the fix I found (which kinda sucks) is to use cat=ID rather than category_name=Name

Topic Closed

This topic has been closed to new replies.

About this Topic