Forums › Forums › Search & Filter Pro › Not filtering custom post meta
Tagged: custom post meta
- This topic has 4 replies, 2 voices, and was last updated 10 years, 4 months ago by Ross.
-
Anonymous(Private) July 14, 2014 at 7:59 am #2450
Hi, I have a problem with S&F plugin.
I use:
1. WordPress 3.9.1
2. S$F Pro plugin 1.1.6
3. Theme based on Gantry Framework 4.1.2
4. Custom post type, taxonomy, fields create by Types – Custom Fields and Custom Post Types Management plugin 1.5.7 (wp-types.com)
5. My web-site – http://www.masterboss.net/
The filter works perfectly but if I add a POST META field “wpcf-statusnp”,
by search it is ignored.
Tell, please, in what there can be a problem?Custom field “wpcf-statusnp” (select) created by Types – Custom Fields and Custom Post Types Management plugin 1.5.7 (wp-types.com)
<?php /** * @version 4.1.2 May 18, 2014 * @author RocketTheme http://www.rockettheme.com * @copyright Copyright (C) 2007 - 2014 RocketTheme, LLC * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only */ // no direct access defined( 'ABSPATH' ) or die( 'Restricted access' ); ?> <?php global $post, $posts, $query_string, $wp_query, $s; ?> <?php /** Begin Query Setup **/ ?> <?php $page_context = $this->getContext(); $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1; $query = $wp_query->query; if ( !is_array( $query ) ) parse_str( $query, $query ); $custom_query = new WP_Query( array_merge( $query, array( 'posts_per_page' => $gantry->get( $page_context . '-count', '5' ), 'paged' => $paged ) ) ); ?> <?php /** End Query Setup **/ ?> <?php if( $custom_query->have_posts() ) : ?> <?php /** Begin Page Heading **/ ?> <?php if( $gantry->get( $page_context . '-page-heading-enabled', '1' ) ) : ?> <?php if( $gantry->get( $page_context . '-page-heading-text' ) != '' ) : ?> <h1> <?php echo $gantry->get( $page_context . '-page-heading-text' ); ?> </h1> <?php else : ?> <h1> <?php printf( _r( 'Search Results for: %s' ), '<span>' . get_search_query() . '</span>' ); ?> </h1> <?php endif; ?> <?php endif; ?> <?php /** End Page Heading **/ ?> <?php /** Begin Posts **/ ?> <?php while ($custom_query->have_posts()) : $custom_query->the_post(); ?> <?php $this->get_content_template( 'content/mbcontent', get_post_format() ); ?> <?php endwhile; ?> <?php /** End Posts **/ ?> <?php /** Begin Pages Navigation **/ ?> <?php if( $gantry->get( 'pagination-enabled', '1' ) && $custom_query->max_num_pages > 1 ) gantry_pagination($custom_query); ?> <?php /** End Pages Navigation **/ ?> <?php else : ?> <h1> <?php _re('Sorry, but nothing matched your search criteria. Please try again with some different keywords.'); ?> </h1> <?php endif; ?> <?php wp_reset_query(); ?>
Ross Moderator(Private) July 14, 2014 at 1:38 pm #2469Hey Maxim, lets get your results working with a custom template first (in the other support thread) then we can move on to this, hopefully that will solve all your problems 🙂
Ross Moderator(Private) July 15, 2014 at 1:25 pm #2528Hey Maxim, I’ve closed the other topic, however before I can help further I really would need access to see what is going on – because it sounds like your theme is implemented in a non standard way (not necessarily a bad thing) but because of this it makes it very hard to guess what the problem will be.
Do you think you can send me some temporary login details so I may investigate further?
Thanks
Ross Moderator(Private) July 29, 2014 at 1:36 pm #3060Hey Maxim, sorry this support ticket slipped through the net – I’ll try to take a look in the next few days 🙂
-
AuthorPosts