Get all post types that supports tags

Please try this. function get_post_tp(){ $args = array( ‘public’ => true, ‘_builtin’ => false, ); $post_types = get_post_types( $args, ‘objects’ ); foreach ( $post_types as $key => $value ) { $postArray = json_decode(json_encode($post_types), true); $array_key = key($postArray); print_r($post_types[$array_key]->taxonomies); // here you can see in taxonomies post_tag is exist or not. //if exist then push into … Read more

How to add Support to show Fullwidth Featured Image of Custom Post Types in WordPress.?

This happens when the image does not have a specific width/height. The image you try to load in your custom-post-type is too small (379x354px). So LinkedIn, Facebook or others will use the layout with the smaller image. Facebook says: Images that are at least 470×246 pixels will display as a rectangle with the title and … Read more

Understanding WordPress’ post type support

When you register post type, you can choose what support you need. For Example: function codex_custom_init() { $args = array( ‘public’ => true, ‘label’ => ‘Books’, ‘supports’ => array( ‘title’, ‘editor’ ) ); register_post_type( ‘book’, $args ); } add_action( ‘init’, ‘codex_custom_init’ ) In this way you will create post type Books only with Title Option … Read more

Querying for multiple post types in SQL

Couple of things to note; one’s a WordPress issue, the other an SQL issue: For WordPress, instead of editing the plugin files directly, you should use the ‘getarchives_where’ filter it provides, and change the query there. For SQL, in order to query for multiple post types, you need a conditional statement in the query, so … Read more

Filter post_type thumbnail in Search result

If you look at your code, you see that parameters for a WP_Query are defined in $defaults. There is also ‘post_type’ => ‘any’ defined which could be changed to ‘post_type’ => ‘post’ to query only for posts, not pages etc. As you see later on, the search function redefines the post_type to $context based. After … Read more