PODS CPT and Tags (post_tag)
-
`Hello Guys,
I created a CPT on POD with name ‘perfil’ and in pods admin i’ve associeted this post_type to default post_tag (tags) from WordPress.
So created a new article on ‘perfil’ and associeted a new tag name ‘playstation’.
But this article don’t appear if i acess this tag ‘playstation’: domainurl/tag/playstation/
I inserted this code on functions.php:
// Enable tags on PODS
add_action( ‘pre_get_posts’, function ( $q )
{
if ( !is_admin() // Only target front end queries
&& $q->is_main_query() // Only target the main query
&& $q->is_category() // Only target category archives [comment out if not needed]
&& $q->is_tag() // Only target tag archives [comment out if not needed]
) {
$q->set( ‘post_type’, [‘post’, ‘perfil’ ] ); // Change ‘custom_post_type’ to YOUR Custom Post Type
// You can add multiple CPT’s separated by comma’s
}
});And don’t work.
Can you help me?
- The topic ‘PODS CPT and Tags (post_tag)’ is closed to new replies.