Entity to store contact form entries?

Post types are not only intended for front-facing content, they can be generic content objects you can use for lots of purposes. If you’re concerned with data being exposed, there are a number of arguments available for controlling whether the items can be queried from the front end, appear in search, have UI for managing … Read more

CPT Archive pre_get_posts not working?

&& is_post_type_archive(‘local-attractions’) is_post_type_archive isn’t set yet, WP is still deciding this, hence the call to pre _get_posts. Instead use: && $query->is_post_type_archive(‘local-attractions’) The same is true of any other is_ type methods, use the $query object, else you might be asking these questions about a completely different query and getting confusing results

Where are post type columns stored in database?

How to actually get post type columns for a specific post type All post types should be inside the wp_posts table inside your database, if you haven’t used the custom prefix. This table has the following structure. Column Type Comment ID bigint(20) unsigned Auto Increment post_author bigint(20) unsigned [0] post_date datetime [0000-00-00 00:00:00] post_date_gmt datetime … Read more

Custom Columns for Custom Post Type Manager

add_action(‘manage_edit-pricing_columns’, ‘manage_pricing_columns’); add_action(‘manage_pricing_posts_custom_column’, ‘manage_pricing_custom_columns’); function manage_pricing_columns($_columns) { $new_columns[‘cb’] = ‘<input type=”checkbox” />’; $new_columns[‘title’] = _x(‘Pricing Item’, ‘wp’); $new_columns[‘categories’] = _x(‘Type’, ‘wp’); $new_columns[‘date’] = _x(‘Created’, ‘wp’); return $new_columns; } function manage_pricing_custom_columns($column, $post_id){ global $post; switch($_columns) { case ‘pricing_type’: $pt = get_the_terms( $post_id, ‘pricing_type’ ); echo $pt[0]->name; break; default: break; } }

Custom Post type content within a slider

Since WP loaded with jQuery by default, you might be able to modify this script http://www.jqueryscript.net/rotator/Simple-Text-Slider-Rotator-with-jQuery-CSS.html to create a testimonials sliders. For randomizing your query, just put ‘orderby’ => ‘rand’ in your $args variable like this: $args = array( ‘post_type’ => ‘testimonials’, ‘orderby’ => ‘rand’); There are way more arguments you can learn from here: … Read more