Custom Meta Box Causing Error: “Are you sure you want to do this? Please try again.”

so you need to correct your nonce field add a second pram nonce name, more information on WordPress codex here // wp nonce field wp_nonce_field( $action, $name, $referer, $echo ); // replace yours with below wp_nonce_field( ‘ind_pricing_table_box_nonce’, ‘ind_pricing_nonce’ ); now verify your nonce, more info here wp_verify_nonce( $nonce, $action ); // replace yours with below … Read more

How to add editable/dynamic values to dropdown of a Custom Post Type Meta Box

I made a similar site and created each team as a custom post type. For the meta fields I did: $report_custom_meta_fields = array( array( ‘label’ => ‘Match Date’, ‘desc’ => ‘Choose match date’, ‘id’ => $prefix.’date’, ‘type’ => ‘date’ ), array( ‘label’ => ‘Select Home Team’, ‘desc’ => ‘Select home team from list’, ‘id’ => … Read more

How to list tags from custom post type attachments?

get_the_tags() function in deed returns only terms of ‘post_tag’ taxonomy (tags). If you’d like to get terms of another taxonomies, you’d have to use get_the_terms function (http://codex.wordpress.org/Function_Reference/get_the_terms) $custom_post_tags = get_the_terms( get_the_ID(), ‘type’ ); //type is a name of custom taxonomy or you can use wp_get_object_terms function (http://codex.wordpress.org/Function_Reference/wp_get_object_terms) where you can define more than one taxonomy … Read more

get_category_link() for custom post type does not include custom slug rewrite?

Your category URLs are correct, they won’t change by virtue of being associated with a custom post type. I’ll guess that the problem is that default category queries do not include any custom post types, so will display “Nothing found” on term pages where the only associated posts are a CPT. To fix that, you … Read more

Trouble with pagination

You appear to be trying to paginate the $all_work query data, but your pagination code is using the $wp_query data… global $wp_query; $total_pages = $wp_query->max_num_pages; if ($total_pages > 1){ $current_page = max(1, get_query_var(‘paged’)); … for reasons unknown to me. If you want to paginate $all_work you need to use the $all_work data. The data in … Read more