WordPress.org

Support

Support » Plugins and Hacks » query based on title not working with more then 2 words

query based on title not working with more then 2 words

  • So, I am using the page titles to help query the appropriate posts. I get the posts that are catagorized with the “band name” – which happens to be the title of the Artist page. This has been working really well for me until there was a band with three words. so “coyote clean up” will not work… but “coyote clean” will.

    I’m using magic fields since this is an older site.

    Any Ideas why it will except one word, two words, and not 3 words?

    You can see the site in question HERE. The Coyote Clean Up artist page is where I’m not getting the releases showing up. Thanks.

    <?php query_posts( array(
    				'cat' => '1',
    				'artist' => wp_title("",false),
    				'showposts' => 3
    				) ); ?>
    
    			<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    			<div id="artist-related-posts">
    
    				<a href="<?php the_permalink() ?>">
    				<?php the_content() ?>
    				<div class="related-title">
    				<h3><?php the_title() ?></h3></div>
    				</a>
    
    			</div> <!-- end artist-related-posts -->
    
    		<?php endwhile; ?>
    
    		<?php else : ?>
    
    			<p>there are currently no related posts for this artist.</p>
    
    		<?php endif; ?>
    		<?php wp_reset_query(); ?>
  • The topic ‘query based on title not working with more then 2 words’ is closed to new replies.