how to call posts from a tag instead of category
-
In my sidebar I currently have a command that pulls in posts from a certain category
<ul class=”topics” id=”_tabtoggler1_tab1″>
<?php
global $post;
$cat_id = themename_category_id(‘editorspicks’);
if(!empty($cat_id))
{
$myposts = get_posts(‘numberposts=13&category=’.$cat_id);
foreach($myposts as $post) :
?>-
I’d like to replace this with a command that pulls in posts that have been tagged with a certain tag e.g tag = editorspick
I tried replacing category_id with tag_id but it didn’t work, any help would be appreciated.
-
- The topic ‘how to call posts from a tag instead of category’ is closed to new replies.