I'm using a piece of code to display images from a google image search using Pipes, with a specific keyword as the search term. However, I would like to set this keyword as the post tile of the wordpress post. I currently have the following: <?php $maxItems = 15; $Document = new DOMDocument(); $Document->load('http://pipes.yahoo.com/pipes/pipe.run?_id=a&_render=rss&q=keyword&safe=active'); $NodeList = $Document->getElementsByTagName('item'); $i = 0; foreach ($NodeList as $Node) { if ($i++ >= $maxItems) { break; } $media = $Node->getElementsByTagNameNS('http://search.yahoo.com/mrss/', 'thumbnail'); if ($media->length > 0) { $imageUrl = $media->item(0)->getAttribute('url'); echo "<img src=\"$imageUrl\n\"/>"; } else { echo "No media:content\n"; } } ?> PHP: In this line: $Document->load('http://pipes.yahoo.com/pipes/pipe.run?_id=a&_render=rss&q=keyword&safe=active'); PHP: I would like to change where it says keyword, to use the get_the_title() wordpress function to search for the post title. Any ideas on how I would do this? Many thanks.
$Document->load('http://pipes.yahoo.com/pipes/pipe.run?_id=a&_render=rss&q=get_the_title()&safe=active'); PHP:
then i guess this is the solution $Document->load('http://pipes.yahoo.com/pipes/pipe.run?_id=a&_render=rss&q='.get_the_title().'&safe=active'); PHP: