wp2.5 breaks query_posts usage (4 posts)

  1. shua
    Posted 8 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...

    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>
    	<?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(); ?>
    			<p />
    		<?php endwhile; ?>
    <!--- End Loop News Category --->

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


  2. Evita
    Posted 8 years ago #

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

  3. shua
    Posted 8 years ago #

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

  4. shua
    Posted 8 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