Reputation: 211
I'm using a flickrRSS plugin, and would like to use the search term as the title of the post, rather than a specified keyword.
Here is the code snippet I'm using:
get_flickrRSS(
array('num_items' => 10,
'type' => 'public',
'tags' => 'keyword'
));
I'd like to change the "keyword" to the wordpress post title.
Any ideas how I can do this?
Many thanks.
Upvotes: 0
Views: 319
Reputation: 4503
Not entirely sure but I believe this will work:
<?php
global $post;
$ID = $post->ID
get_flickrRSS(
array('num_items' => 10,
'type' => 'public',
'tags' => get_the_title($ID)
));
?>
Upvotes: 0
Reputation: 21282
Try get_the_title()
get_flickrRSS(
array('num_items' => 10,
'type' => 'public',
'tags' => get_the_title()
));
Reference: https://codex.wordpress.org/Template_Tags/get_the_title
Upvotes: 1