Custom Post Type – Display Categories & Tags In Dashboard list
In your $args array of the taxonomy add this line: ‘show_admin_column’ => true, that will add it to the admin edit screen
In your $args array of the taxonomy add this line: ‘show_admin_column’ => true, that will add it to the admin edit screen
Based on wordpress reference for WP_QUERY you can use author__in to filter by more than one author. It uses an array of user ids. Here is your code with the needed changes: function list_cpt_by_author_id(){ $user = get_current_user_id(); $authors_id = array(“1”, $user); $custom_terms = get_terms(‘custom-tax’); foreach($custom_terms as $custom_term) { wp_reset_query(); $args = array( ‘post_type’ => ‘artigos’, … Read more
My plugin Custom Post Permalinks allows you to set permalink structures for custom post types and it supports post authors as part of a permastruct. However, while my plugin will enable you to set up that structure, I don’t suggest using that structure. That structure will essentially make WordPress interpret all top-level pages as 404 … Read more
You just have to modify the name attribute of the generated input fields from p_clr to p_clr[]. $_POST[‘p_clr’] will then be an array with the values of all the input fields. public function prod_colors_box() { global $post, $p_clr; $p_clr = array(); $p_clrs = get_post_meta( $post->ID, ‘p_clr’ ); ?> <div id=”p_colors”> <?php foreach( $p_clrs as $key … Read more
What you are looking for is a bit involved but I wrote it anyway. Unfortunately it took longer than I planned so I’ve run out of gas on going in depth to explain it but I did document the code so hopefully that will help you follow it and you can download a copy of … Read more
This is what I’ve used in the past for a similar requirement; register_post_type(‘movie’, array( ‘rewrite’ => array(‘slug’ => ‘movie’) )); register_taxonomy(‘movie_location’, ‘movie’, array( ‘rewrite’ => array(‘slug’ => ‘movies’) )); /** * Add rewrite rules for ‘base’ archives. * @param object $r Instance of {@see WP_Rewrite} */ function my_custom_rewrite_rules(&$r) { $rules = array( ‘movies/page/?([0-9]{1,})/?$’ => ‘post_type=movie&paged=’ … Read more
Make sure your query has paged in it like so: query_posts(‘post_type=fotolog’ . ‘&paged=’ . get_query_var(‘paged’)); Check to be sure that you don’t have page and a post type with the same permalink /foflog and /fotolog/your-post-name-here
Currently the best way I know to handle that is the Posts 2 Posts plugin: http://wordpress.org/extend/plugins/posts-to-posts/ Here’s an example showing how to set up the custom post types (if you already have them it’s more for other’s benefit who might be reading this) as well as the function call to p2p_register_connection_type() needed by the plugin … Read more
yea you can do just that. you only need to change the output function which in this case is function prod_custom_columns($column){ global $post; switch ($column) { case “description”: the_excerpt(); break; case “price”: // Now here I have to define the field, but how would I drag in other subsequent price fields? $custom = get_post_custom(); echo … Read more
Notice: Trying to get property of non-object Would indciate that $post has no scope inside your function. One simple solution here would be to globalise $post so it has scope, effectively fixing the error. However, whenever you create a query, or run the loop and call the_post method this gives you access to the WordPress … Read more