Skip to content

copiadigital/results

Repository files navigation

How to use

  1. Initialize field by using wp-cli

    Run from your local machine, in a new terminal tab

    wp results results_init

  1. Enabling results in page builder

To enable results builder layout, go to Builder.php under to your sage theme. Search Results and uncomment it.

Uncomment this line of code:

// ->addLayout($this->get(Results::class), [
//     'label' => 'Results',
//     'display' => 'block',
// ])

  1. Enabling results in views template

To enable results in views template, go to resources/views/partials/builder directory & edit layout_container.blade.php.

replace this line of code:

@includeFirst([
  'partials.builder.' . $build['acf_fc_layout'],
], $build)

with this line of code:

@includeFirst([
  'partials.builder.' . $build['acf_fc_layout'],
  'Results::partials.builder.' . $build['acf_fc_layout']
], $build)

  1. Overriding templates by using wp-cli

Before proceeding with this step it is important to note there are two options to choose from. It will import the template to the sage theme.

  • Option 1: Use wp results results_default or php wp-cli.phar results results_default --allow-root to import the template without type.
  • Option 2: Use wp results results_with_type or php wp-cli.phar results results_with_type --allow-root to import the template with type.

Option 1:

Run from your local machine, in a new terminal tab

wp results results_default

Option 2:

Run from your local machine, in a new terminal tab

wp results results_with_type

  1. Altering taxonomies

We can use results_tax_before_insert hook in the filter.php to alter taxonomy. For example we want to remove taxonomy type

For removing type taxonomy. Paste this inside the filter.php

 add_filter( 'results_tax_before_insert', function ( $types ) {
   unset($types[1]);
   return $types;
 });

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published