Quantcast
Channel: How to include an RSS feed or search results on a single template? | WordPress.org
Viewing all articles
Browse latest Browse all 8

WPChina on "How to include an RSS feed or search results on a single template?"

$
0
0

Great thank you so much Simon! Your idea is much simpler and easier. But I still have one small syntax problem. I am now using this to search only within specific categories based on the current headline/title of the current post:

<?php
// The Query
$the_query = new WP_Query( 'cat=1,55,346&s=' . get_the_title() . '' );

// The Loop
while ( $the_query->have_posts() ) :
	$the_query->the_post();
	echo '<li><a href="' . the_permalink() . '">' . get_the_title() . '</a></li>';
endwhile;
?>

The output is correctly finding and placing the headlines on the page. But the permalink is not outputting correctly. It is coming through as the full link before the headline. I have fooled around with the quotation marks and apostrophes but little changes. Any ideas?


Viewing all articles
Browse latest Browse all 8

Trending Articles