How to pull tags from multiple post IDs outside the loop
-
I’m having an issue getting tags to display in the following scenario. On my front page I have 4 posts displaying in boxed areas with an image. I’m using a heavily modified version of Arras wonderful theme with the following code in the library/filters.php file:
function arras_newsheader($page_type) { global $post; $postheader = ''; $postheader .= '<h3 class="entry-title"><a href="' . get_permalink() . '" rel="bookmark">' . get_the_title() . '</a></h3>'; $postheader .= '<div class="entry-thumbnails"><a href="' . get_permalink() . '"><img src="' . arras_get_thumbnail($w,$h) . '" alt="' . get_the_title() . '" title="' . get_the_title() . '" /></a>'; $postheader .= '<a href="' . get_permalink() . '"><img class="entry-meta" src="" alt="links"></img></a>'; $postheader .= '</div>'; $postheader .= ***this is where I need the listed tags*** echo apply_filters('arras_newsheader', $postheader); }
I have tried quite a few different tricks, mostly copying and pasting code from the codex, and other areas of the template. I understand php, but cannot code it (a bit like understanding a foreign language but not being able to speak it). I have tried the following strings:
wp_get_post_tags($thePostID = $wp_query->post->ID)
get_the_tags('ID=1') ;
wp_get_post_tags($wp_query->post->ID)
and various combination’s of the above. I’ve scoured the codex and the forums, but can’t seem to find the right info, or even combination of info to solve my issue.
- The topic ‘How to pull tags from multiple post IDs outside the loop’ is closed to new replies.