0

I'd like to be able to call the user-selected tag ID for the Jetpack Featured Content module, but I can't find a function or an object that holds that value.

I'm basically trying to filter featured posts out of a WP_Query with these arguments:

$args = array(
        'ignore_sticky_posts' => 1,                 
        'posts_per_page' => $recent_posts_count,
        'tag__not_in'   => array(
            [HERE IS WHERE I WANT PHP TO TELL ME THE TAG ID]
        ),
        'post_type' => array(               
            'post'                  
        )
    );  
RoboRob
  • 195
  • 13

2 Answers2

0

Check This one

<?php

        global $post;
        $tags = get_tags($post->ID);
        $tagids = array();
        foreach($tags as $tag) $tagids[] = $tag->term_id;
    $args = array(
            'ignore_sticky_posts' => 1,                 
            'posts_per_page' => $recent_posts_count,
            'tag__not_in'   => $tagids,
            'post_type' => array(               
                'post'                  
            )
        );  
    ?>

Thanks

Narendra
  • 464
  • 2
  • 5
0

I know this is pretty late, but I found this post while looking for the same thing, even posted in the WordPress support forum, but figured it out eventually:

$featured_options = get_option( 'featured-content' );
$featured_name = $featured_options[ 'tag-name' ];
Adrian
  • 11
  • 2