How to conditionally add Custom Post Type to Front Page

I believe that if all your products have the custom meta field show_on_front_page with some containing ‘1’ and some containing ‘0’ or some such, AND your regular posts do not have that field, then something like below should work: //… $query->set(‘post_type’, array(‘post’, ‘product’)); //add this $meta_key = ‘show_on_front_page’; $query->set(‘meta_query’, array( ‘relation’ => ‘OR’, array( ‘key’ … Read more

Hide Status Option From WordPress Publish Metabox and Rename Published on:

Both those strings seem to be located in wp-admin/includes/meta-boxes.php. They don’t have any filters attached to them, so they’re not meant to be (easily) altered by your code. However, both those strings are internationalized (ie, run through a translation function) to allow WordPress’s interface to be translated into languages other than English. The i18n functions—__() … Read more

Custom post type loop with custom category filtering

Is that category or custom taxonomy? if this is a category, then try this one. <?php $loop = new WP_Query( array( ‘post_type’ => ‘portfolio’, ‘posts_per_page’ => 50, ‘category__in’ => array(‘8′,’9′,’10’), // your category ids ) ); while ( $loop->have_posts() ) : $loop->the_post(); ?> <div class=”half-column”> <h2><?php the_title(); ?></h2> </div> <?php endwhile; wp_reset_postdata(); ?> Or if … Read more

CPT Columns doesn’t show categories

why ‘categorias_de_pessoas’ => __( ‘Categorias’ ), doesn’t the show the content within the categories selected to my post? This is a taxonomy called ‘categorias_de_pessoas’. That issue happened because you did not prepend the taxonomy (or array key or column name) with a taxonomy-. I.e. The correct format is: taxonomy-<taxonomy>. See WP_Posts_List_Table::column_default(). So to fix the … Read more

Address as a content type post

Welcome to WPSE. This is a rather broad question and perhaps not quite on topic here, but here are some links that should get you started developing a solution to match your needs. Introduction to Plugin Development – A custom plugin is good place for this kind of custom functionality so it won’t be lost … Read more

get_post_types – exclude multiple post types by name

The query args you’re passing to get_post_types() are handled by the underlying function wp_filter_object_list(), which isn’t designed to handle advanced querying operations like “if key value (not) in array”. Since you’re just getting the names of post types, use the native PHP function array_diff to filter the out the ones you don’t want: $post_types = … Read more

Which file/template is in charge of taxonomies for custom post types?

There’s a giant diagram on the wordpress documentation showing how it chooses which file to display/load, as you can see here: http://codex.wordpress.org/images/1/18/Template_Hierarchy.png If this doesn’t help, my other suggestion is trying with the ‘_’ removed from the taxonomy name, and to test with the rewrite option removed from your custom post type declaration. In my … Read more