WooCommerce shop page to use my custom template [closed]

By going through your question I want to tell you that woocommerce will not use your custom template. It will use its own template. As you want to use wordpress advanced custom fields plugin I want to tell you is that feature only works on the page and post. So as woocommerce will not allow … Read more

Media library – Limit images to custom post type

I’m not 100% sure if I get your problem right, but… Maybe this will help you… Media uploader gets attachments with simple WP_Query, so you can use many filters to modify it’s contents. The only problem is that you can’t query posts with specific CPT as parent using WP_Query arguments… So, we will have to … Read more

Filter by custom field in custom post type on admin page

And for displaying result for Filter then try this code add_filter( ‘parse_query’, ‘prefix_parse_filter’ ); function prefix_parse_filter($query) { global $pagenow; $current_page = isset( $_GET[‘post_type’] ) ? $_GET[‘post_type’] : ”; if ( is_admin() && ‘competition’ == $current_page && ‘edit.php’ == $pagenow && isset( $_GET[‘competition-name’] ) && $_GET[‘competition-name’] != ” ) { $competition_name = $_GET[‘competition-name’]; $query->query_vars[‘meta_key’] = ‘competition_name’; … Read more

Filtering multiple custom fields with WP REST API 2

This solution works with get_items() in /lib/endpoints/class-wp-rest-posts-controller.php of the v2 WP Rest API. First, you’ll want to construct the GET arguments like you would for a new WP_Query(). The easiest way to do this is with http_build_query(). $args = array ( ‘filter’ => array ( ‘meta_query’ => array ( ‘relation’ => ‘AND’, array ( ‘key’ … Read more

Where are custom field values stored in the database

From the codex for custom fields: The PostMeta information is stored in a new table, $wpdb->postmeta. This table has four fields: ‘meta_id’ – A unique id for each entry. ‘post_id’ – The ID of the post for this metadata. ‘meta_key’ – The name of the ‘key’. ‘meta_value’ – The value associated with the key. This … Read more