WordPress Content Filter Documentation

This documentation contains tutorials that will make you easier to configure the plugin.

WordPress Content Filter

Created :
06/10/2015
Author :
ZuFusion
Website :
http://zufusion.com
Thank you for purchasing my theme. If you have any questions that are beyond the scope of this documentation, please feel free to email via my user page contact form here. Thanks so much!

1. Introduction

WordPress Content Filter Thumbnail

WordPress Content Filter lets you filter by rating, custom fields, taxonomies, meta fields, authors, dates, post types, sort and more. Users now able to choose to use the Redirect or Ajax to display the search result.

It allows you filter posts WooCommerce, Easy Digital Downloads: product attributes, product categories, custom taxonomies, price, meta fields ...

Main features:

  • Work on Wordpress 4.2+
  • Create as many different search forms
  • Import/export forms
  • Filter by rating, custom fields, taxonomies, meta fields, authors, dates, post types and more
  • Search Single or multiple post types
  • Support checkbox, radio, select, multiselect, color field.
  • Use AJAX or Redirect to display results
  • Displaying Fields: Vertical or Horizontal
  • Horizontal fields on mobile when using Vertical mode
  • Shortcode & Widget
  • Using shortcode or widget to display the search form.
  • Custom templates for search results.
  • Custom CSS.
  • Works with WooCommerce, Easy Digital Downloads
  • Works with Advanced Custom Fields
  • 13 Available Fields
  • Cross Browser (IE9+, Chrome, Safari, Firefox, Opera)
  • WPML ready
  • Documentation included

2. Installation

Download the zipped package from Codecanyon and extract to your desktop. Before processing the installation, you need to upgrade WordPress to WordPress 4.2 or later.


You can use FTP or WordPress to install

2.1 Using WordPress

  • Log into your WP dashboard
  • Go to Plugins > Add New > Upload
  • Click Choose File .
  • Navigate to find the "wordpress-content-filter.zip" file in the extracted package.
  • Click "Install Now" button.
  • Click Active plugin to activate WordPress Content Filter

2.2 Using FTP

  • Log into your site via FTP
  • Find the "wordpress-content-filter" folder in the extracted package. Then upload this folder to the wp-content/plugins folder in your WordPress directory on your server
  • Log Into WordPress and go to Plugins > Installed Plugins. Find WordPress Content Filter in the list
  • Active "WordPress Content Filter" plugins

3. Create Search Form

To create a search form, click on the WordPress Content Filter > Add new menu item. You will see a welcome screen like this:



Now, Clicking the "Add New" button will create a new Search Form. When editing a search form, you will see 3 areas: Template Fields, Search Form, Settings Form.

Each search forms requires a title, Drap and drop fields from Template Fields to Search Form then setting search form



Finally, clicking Publish/Update button

4. How It Works

After creating search form, go to list search forms by clicking WordPress Content Filter > All Search Forms menu item




In which,

  • Shortcode (1) using display a Search Form
  • Shortcode (2) using display a Grid Results of search form

The plugin need Search Form and Grid Results to work.

4.1 Search Form

If in the one page which the search form is not found any the grid results to display search results. The search form will redirect to default search template of theme (search.php) to display search results

4.2 Grid Results

In case, Search Form and Grid Results be displayed on the sample page like screen shot bellow



Because, the Search Form found a grid results to display search results on the sample page. It will only display search results on grid results of this page without redirect to default search template of theme (search.php)

Notice: you also can create your own search template with the 'custom template' option of search form if in case the search form redirect to default search template (8. Custom Search Template)

5. Display Search Form

The plugin allows use the Widget or Using Shortcode (1) from 4. How It Works to display a search form.


6. Display Grid Results

6.1 In Page/Post

Copy Shortcode (2) from 4. How It Works to page/post

6.2 In Search Template

1, Only use this when If in the one page which the search form is not found any the grid results to display search results. The search form will redirect to default search template of theme (search.php) to display search results (4.1 Search Form).

2, If you want to use grid results of the plugin to display search results, you need to create your own custom search template (8. Custom Search Template) base on search.php of theme.

7. Import/export

Importer & Exporter is useful for moving search froms one WordPress site to another, backing up search forms and for theme developers to provide users with sample search forms.

8. Setting Page

Go to WordPress Content Filter > Settings. the plugin allows to configure Color Scheme, custom css, sroll top, custom Ajax Loader image

9. Widgets

The plugin allows use the Widget to display a search form. go to Appearance > Widgets and drag widget to one of your sidebars:


10. Custom Search Template

In an activating theme, create a your own custom search template base on search.php of theme

For example: in twentytwelve

1. Copy search.php to search-custom.php then openning search-custom.php



2. Replace the line code is highlighted with

In which, the

[wcf_result id="1922"]
be copied from 4. How It Works

3. Enter search-custom.php in the custom template option of a search form

11. The Plugin Template

11.1 How Template Works

You can see in the folder {root}/wp-content/plugins/wordpress-content-filter/templates/

with 6 default loop template:
  • wcf-form-search.php (1)
  • wcf-grid-results.php (2)
  • wcf-loop.php (3)
  • wcf-loop-download (4)
  • wcf-loop-page (5)
  • wcf-loop-post (6)
  • wcf-loop-product (7)
  • wcf-loop-table (8)
  • wcf-loop-{your_custom_post_type} (9)

(1) - Display search form

(2) - Display grid results

(3) - Display posts of any post types base on this template. It is loaded when the Search Type is multiple in a search form

(4) -> (8) - Display posts for each post types. It is loaded when the Search Type is single in a search form

(9) - Display posts for custom post types. It is loaded when the Search Type is single in a search form

Notice: grid type must be Post type if you want to display the template of a custom post types

11.2 Overwrite Template

The plugin support overwrite, custom template from default template. You only create a wordpress-content-filter/templates in the root of activating theme. Copy the template of the plugin you need to custom to here and change what you wan to



12. Color Scheme

12.1 Change Color Scheme

Go to WordPress Content Filter > Settings > Color Scheme

12.2 Create Own Color Scheme

1. You only create a wordpress-content-filter/colors in the root of activating theme.

2. Copy a color from folder {root}/wp-content/plugins/wordpress-content-filter/assets/colors/ to wordpress-content-filter/colors and change name of copied file (ex: green123.css)

3. Finally, Go to WordPress Content Filter > Settings > Color Scheme to set your own color scheme

13. Hooks Function

The developer can use these hooks function to customize display, fields, build query, ...:

Actions:

wcf_display_field_before

do_action( 'wcf_display_field_before', $field_id, $field_type, $field_data );

wcf_display_field_after

do_action( 'wcf_display_field_after', $field_id, $field_type, $field_data );

wcf_meta_field_query

Using it to build query for meta field do_action( 'wcf_meta_field_query', $meta_query_append, $val_bk, $compare_bk, $field_setting );

wcf_tax_field_query

Using it to build query for taxonomy do_action( 'wcf_tax_field_query', $tax_query_append, $val_bk, $taxonomy_operator, $field_setting );

wcf_form_search_before

Before search form at front end do_action( 'wcf_form_search_before', $id, $settings);

wcf_form_search_after

After search form at front end do_action( 'wcf_form_search_after', $id, $settings);

wcf_forms_available_fields

the action for template fields meta box do_action( 'wcf_forms_available_fields', $post->ID );

wcf_forms_search_fields

the action for search fields meta box do_action( 'wcf_forms_search_fields', $post->ID );

wcf_forms_settings

the action for settings form meta box do_action( 'wcf_forms_settings', $form_id);

wcf_script_before_init

the action before init script at the frontend do_action('wcf_script_before_init', $this->options);

wcf_script_after_init

the action after init script at the frontend do_action('wcf_script_before_init', $this->options);

Filters:

wcf_color_url

Custom the color scheme url

wcf_result_columns

Custom the number of columns of grid results to display search results apply_filters('wcf_result_columns', $columns, $id, $fields, $settings)

wcf_result_loop_template

Custom the loop template for grid results apply_filters('wcf_result_loop_template', $template_loop, $id, $fields, $settings)

wcf_get_template

Get a template apply_filters( 'wcf_get_template', $file, $template )

wcf_vars_processed

Build query vars for WP_Query apply_filters( 'wcf_vars_processed', $var_processed, $vars )

wcf_price_post_in

Using this filter posts by price for post type. apply_filters( 'wcf_price_post_in', $price_posts, $post_type, $min, $max )

wcf_rating_post_in

Using this filter posts by rating for post type. apply_filters( 'wcf_rating_post_in', $rating_posts, $post_type, $from, $to )

wcf_default_options

Default values for settings page apply_filters( 'wcf_default_options', $defaults );

wcf_author_field_role

Change role for author field apply_filters('wcf_author_field_role', 'author');

wcf_price_shop_type_options

Custom dropdown post type (Select Shop) for price field

wcf_order_by_options

Custom dropdown order by for sort field

14. Updating Plguin

Once the new version gets released, you can update via WordPress or FTP .


14.1 Update via FTP:

This is the safest way. If you have access via FTP to your site files, you can update the old one simply by overwriting your wp-content/plugins/wordpress-content-filter folder with the newer one.

14.2 Update via WordPress:

You deactivate and delete the plugin on the Plugin’s administration page of WordPress and upload and active the updated plugin. We recommend the via FTP solution, because it’s safer.

Notice: You should not use the way Update via WordPress. Because this way if you have any changes in plugin folder it will be deleted.

15. Credits & resources

  1. jQuery
  2. jQuery UI
  3. dashicons
  4. Masonry

Once again, thank you for purchasing my plugin! If you have any questions that are beyond the scope of this documentation, please feel free to email via my user page contact form here!