Facetwp custom facet. Plugin author notified 2022-03-04.
Facetwp custom facet Nov 22, 2024 · FacetWP’s indexer can stall temporarily, for several reasons. Nov 27, 2024 · Also (non-FacetWP) AJAX-based pagination is not compatible with FacetWP. Jan 31, 2025 · FacetWP 4. Nov 25, 2024 · When importing products with the WP All Import plugin (or the free version) , FacetWP’s automatic indexer is triggered. To migrate your legacy Proximity / Map facet implementation and customizations to the new version, read the migration guide. After enabling this setting, make sure to re‑index . It might seem a bit counter-intuitive that pagination can be added as a facet type, but just like any other facet type, a Pager facet can be added by making a new facet in the FacetWP admin interface. For older versions, use the legacy documentation instead. . My Account Support Sales About Us May 24, 2024 · FacetWP provides a wide range of hooks and filters to influence its behavior and filtering results. faceted search – to your result listings. So in the above example, the facet_value of the newly created facet choice is citrus-fruits, which appears in Dec 16, 2024 · It is possible to pre-select facet choices on page load, using the facetwp_preload_url_vars hook. A basic loop example using the above custom query would look like this: Dec 19, 2024 · Ghosts are facet choices that do appear in the unfiltered results, but disappear after being filtered out. With the Custom Permalinks for WooCommerce plugin by Meow Crew, you can customize the permalinks for your WooCommerce product pages and product category archives. Note that FacetWP only supports one FacetWP-enabled Loop element per Jul 31, 2024 · How to use custom PHP code? PHP code can be added to your (child) theme's functions. Aug 12, 2024 · The following will prevent problems with FacetWP: Go to WP External Links’ settings page, to the “Exceptions” tab. Without it, facets will not show up. Feb 6, 2025 · The Proximity facet type; Using the facetwp_i18n hook to translate facet labels and strings; The Pager + Load more facet type; Using FacetWP with Advanced Custom Fields; Using FacetWP with WP Job Manager; Using FacetWP with the Listify theme; Using FacetWP with the Listable theme; How to disable facet auto-refresh and add a submit button; The Dec 19, 2024 · The facetwp_facet_orderby hook; The Search facet type; The Autocomplete facet type; The Radio facet type; The Range List facet type; The Time Since facet type; The facetwp_facet_html hook; The facetwp_shortcode_html hook; The facetwp_facet_display_value hook; Custom facet types Jan 23, 2025 · Using a custom WP_Query; The facetwp_is_main_query hook; The facetwp_template_use_archive hook; How to pre-select facet choices; How to prevent duplicate results; The facetwp_template_html hook; Using the facetwp_i18n hook to translate facet labels and strings; The facetwp_query_args hook; The facetwp_templates hook; The facetwp_facets hook Aug 19, 2024 · How character matching works. Long text, text that’s relatively unique (such as SKUs or street names), dates, and numeric values are usually stored as custom fields. Jan 31, 2025 · FacetWP Facet – adds a facet. Create the query loop. Plugin author notified 2022-03-04. Next, we add an indexer hook to calculates the percent discount and modify the index value. With a “FacetWP Facet” widget you can add an existing facet to your Elementor page. Creating a custom field. In the screenshot below, we’re adding a new “Event Fields” group, and attaching it to the Event post type. Nov 25, 2024 · FacetWP has an automatic indexer that performs a single re-index when an individual item (a post, page, and category or term name/slug) is edited or saved. Jan 8, 2025 · You can create your own facet types with FacetWP. Feb 28, 2025 · Important: All info on this page is deprecated, and applies only to the “Legacy” FacetWP Google Maps integration: versions before FacetWP v4. When editing the page via Beaver Builder’s visual mode, click the blue “+” to display available modules. Dec 19, 2024 · The facetwp_facet_orderby hook; The Search facet type; The Autocomplete facet type; The Checkboxes facet type; The Hierarchy facet type; The Range List facet type; The Time Since facet type; The facetwp_facet_html hook; Custom facet types If you are using the Intuitive Custom Post Order plugin to order your taxonomy terms, use the code below to preserve that order for facets that use terms. If you experience these issues, try disabling WP Engine’s Object Cache : Jul 26, 2024 · When a facet is registered with the facetwp_facets hook, the facet label will have a ‘locked’ icon. Important: All info on this page refers to FacetWP’s “New” Google Maps integration: FacetWP v4. This plugin causes the following compatibility issue when using FacetWP with WooCommerce on product category archives that have a Nov 25, 2024 · During a process called indexing, FacetWP analyzes your site and stores facet data into a custom database table for quick lookups. Jan 8, 2025 · The facet_value is its technical name (“slug”) as it appears in the URL after filtering. To demonstrate this, we created an example plugin that lets users filter by future or past date. 0. It also uses an index table for extra speed. Sep 10, 2024 · To show “% discount” in a facet, we’ll first create the facet: We’re setting the Data source to Post Type just as a placeholder. In the Color facet’s settings, you can choose a taxonomy as the Data source. Additionally, with a Professional license you can install the User Post Type add-on, which allows you to map users to a post type, and therefore filter users. See the available commands below. Or, for facets using a custom field created with Advanced Custom Fields , use the ACF Multilingual plugin . FacetWP includes many facet types, including checkboxes, dropdowns, date ranges, sliders, pagers, and even proximity (geolocation). After adding some products, go to Settings > FacetWP and click the “Add facet” link. 4+ with the Map add-on v2. Installation. You can make FacetWP index them by enabling the “Index out-of-stock products” setting under FacetWP > Settings > Woocommerce. Nov 25, 2024 · FacetWP includes built-in support for using WP-CLI to do a full or partial re-index, or to purge FacetWP’s index table. Dec 17, 2024 · $('. Dec 19, 2024 · For custom ways of sorting, for example numerically, you can use the facetwp_facet_orderby hook. The /facetwp/v1/fetch endpoint lets you query raw FacetWP data, with which you can build custom applications. What I'd like is to list the results in two sections: FacetWP Bootstrap 4 Custom Facet Type. Dec 19, 2024 · Name Description; Data source: Where the values live (taxonomy, custom field, post attribute). This page gives an overview of possible customizations, among which: Customize Google Maps API loading, or localize your map; Change the map type Nov 22, 2024 · If your facet uses a custom field as data source, just translate that custom field. This can either be a custom taxonomy, or – if you are using WooCommerce – a global product attribute, which is also stored as a custom taxonomy. See also Installation and updates; FacetWP licenses and pricing; What are facets? Using the Listing Builder Jan 31, 2025 · Next, add some facets to the page. 0+. Nov 28, 2024 · Using FacetWP with Advanced Custom Fields; The facetwp_render_output hook; The Number Range facet type; The Range List facet type; Using the facetwp_i18n hook to translate facet labels and strings; How to disable facet auto-refresh and add a submit button Jan 9, 2025 · It is important to keep in mind that the facetwp_index_row hook runs once on the insertion of each of these table rows. To get your pagination to work with your listing template, you need to replace it with a (numbered) Pager facet. FacetWP is a powerful WordPress plugin that allows you to create custom search filters and listings for content on your site. Jul 26, 2021 · I have FacetWP setup to provide results of a query based on 4 facets (one Search box, one Categories drop-down, and two custom taxonomy drop-downs). To generate and download your invoice, first log into your account. My Account Support Sales About Us Feb 25, 2025 · Important: All info on this page is deprecated, and applies only to the “Legacy” FacetWP Google Maps integration: versions before FacetWP v4. The facet_display_value is the choice’s display value as it shows up in the facet itself in the front-end. May 2, 2023 · Two of the resulting custom fields can be used for the Map / Proximity facet: in the facet’s settings, as “Data source” choose geolocation_lat and as “Longitude” choose geolocation_long. Because the facetwp-loaded event fires after each AJAX page load, the page will scroll when any facet is used. Note that the Hierarchy facet requires a taxonomy to function properly. Developer friendly Developers can take advantage of the plugin's many hooks for a high degree of customization. Dec 16, 2024 · Also, make sure the facet you are pre-selecting is actually present on the page. Alternatively, you can use the Custom Hooks add-on, or a code snippets plugin. While you could enable the script independently with the facetwp_assets hook, this would not include the needed JSON. This keeps the index up to date automatically without having to worry about it, and without putting the potentially heavy burden of a full re-index on your site. To install FacetWP, upload the ZIP file into Plugins > Add New > Upload Plugin, or manually extract the plugin folder into /wp-content/plugins/. We generally recommend using Advanced Custom Fields (ACF). This affects approximately 0. 4+ with the Maps add-on v2. prev('h3') Conditionally hide facet labels in the Mobile Flyout If you want to conditionally hide specific facet labels that are automatically added above facets in the Mobile Flyout , the custom selector needs to look like this: Jan 6, 2025 · How to use custom PHP code? PHP code can be added to your (child) theme's functions. Sep 10, 2024 · Scroll on facet interaction after the initial page load. Note: The code below is meant to work for only one page with facets. js script and a few JSON settings. Jul 4, 2024 · For FacetWP to work with this custom query, the facetwp => true argument needs to be added. Improve indexing speed Aug 19, 2024 · An added benefit of this approach is that your facet- and listing settings can be placed under version control (with git for example), making it easy to revert to previous sets of facets/listings or previous facet/listing settings. At Oct 22, 2024 · How to use custom PHP code? PHP code can be added to your (child) theme's functions. The issue causes only a single language to be indexed, resulting in posts disappearing from indexed rows and facet options. Make sure that this Pager facet is outside of the listing container with class facetwp-template, like any facet should be. Note: Besides adding the Google Maps API key to the FacetWP settings , also make sure to add the key to the WP Job Manager plugin (and to the Listify Name Description; Data source: Where to pull values from. If you want to customize the facet’s container/placeholder element, for example to add a custom class or attribute, use the facetwp_shortcode_html hook instead. Select the “Facet” option, then choose an existing facet: Other FacetWP features (Sort, Selections, etc. Sep 10, 2024 · Our Help Center articles and our custom code library contain a lot of code snippets to add or customize FacetWP functionality. 4 and Map add-on v2. FacetWP can be enabled on Breakdance Post Loop Builder, Post List, Products List, and Shop Page elements. php. Demo Buy. Facets use your site's existing post types, custom fields, and taxonomies. Whenever facets are added or edited, save your changes and then press the Re-index button. e. Fix the Pager facet on product category archives. If you are using Elementor, you can also use the FacetWP facet widget and listing widget to do Nov 22, 2024 · Yes, FacetWP supports listing and filtering of posts, pages, and any custom post type (as long as it is searchable). : Default label Nov 22, 2024 · FacetWP does not index anything for Search facets, so if you only have a Search facet on your page, this is enough to enable searching within attachments/PDFs. It supports basic field types (Text, Select, Checkbox, etc. Nov 25, 2024 · To check which post types FacetWP currently indexes, click the “Show indexable post types” button in the settings, as shown in the image on the right. FacetWP includes built-in resume functionality. Jun 4, 2024 · Most of the PHP-based code examples in our Help Center articles and our custom code library are based on WordPress or FacetWP hooks, which can be pasted directly into your (child) theme’s functions. The FacetWP Facet widget The FacetWP Elementor Facet widget settings. Aug 6, 2024 · Enable FacetWP for Loop elements. To see it in action, browse to our Cars demo then shrink your browser width until you see the purple “Show filters” button. Or – if you use a separate custom field for the longitude – only a latitude. Sep 10, 2024 · These custom attributes can also be used as facet source (as they are just custom fields). Feb 5, 2025 · How to use custom PHP code? PHP code can be added to your (child) theme's functions. Dec 19, 2024 · How to change the billing details on your invoice. My Account Support Sales About Us Dec 18, 2024 · Custom Permalinks for WooCommerce by Meow Crew [#23304, #23356, #26740] – plugin is causing pagination redirects that break FacetWP’s Pager facet and listing refresh. FacetWP 4. Setup. Sep 6, 2024 · With the help of Meta Box, you can create any kind of data (custom fields) for your product / listing or any custom post type. Feb 26, 2025 · If you are using FacetWP’s “New” Google Maps integration (FacetWP v4. Within that area, you’ll see a new “FacetWP” section. Dec 5, 2024 · Value storage and empty post range values. After your purchase, you’ll receive a download link and license key, and access to your account. . Uncheck the checkbox after: “Apply settings on: All contents (the whole page)”. com/FacetWP/facet-future-past FacetWP includes built-in support for Advanced Custom Fields (ACF). When choosing a hierarchical taxonomy, read this warning. See also How to filter or sort a WP_Query by one or more custom fields; Using a custom WP_Query; Using a WP archive page; How to customize WordPress archive queries; The facetwp_query_args hook; How to use sticky posts with FacetWP Jan 31, 2025 · Your site deserves the best filtering. Show your results. It may look like a listing, as it shows posts (a marker for each), and those posts/markers will be filtered when using other facets, but it is still technically a facet. When “Show ghosts” is enabled, after filtering, facet choices that would return zero results are still shown, but dimmed and not clickable. With FacetWP, filtering happens instantly and without page refreshes. By default, the A-Z Listing facet will only show the capital letters A to Z in the standard Latin alphabet. Even if your facets don’t apply to all post types that exist, FacetWP will still look up every post from every indexable post type, and check it against each facet to see if it needs to be indexed. If your results don’t show, try disabling that setting, as demonstrated below: Disable Relevanssi’s “Create custom search result snippets” setting. You can use WP-CLI to manually trigger re-indexing , or you can use a WP-CLI command in a cron job to re-index at pre-defined intervals. Dec 2, 2024 · When importing products with WebToffee’s Product Import Export for WooCommerce or Import Export Suite for WooCommerce plugins, FacetWP’s automatic indexer is triggered. You can see/clone the code in this GitHub repo: https://github. This update fixes a vulnerability in the Google Maps API key setting field, which could theoretically be used to execute malicious code, if a user would have access to the FacetWP settings . But most often it interferes with FacetWP’s ability to detect or use the right query on refresh. This happens because posts and/or terms are being inserted and/or saved during the import process. FacetWP Button – adds an Apply button, a Flyout button or a Submit button. php file. Dec 19, 2024 · The facetwp_facet_orderby hook; The Search facet type; The Autocomplete facet type; The Radio facet type; The Range List facet type; The Time Since facet type; The facetwp_facet_html hook; The facetwp_shortcode_html hook; The facetwp_facet_display_value hook; Custom facet types Nov 22, 2024 · There is a known issue when using FacetWP with WPML, when using cron indexing (for example with the Schedule Indexer add-on). Feb 4, 2025 · [facetwp facet="single_map"] [facetwp template="single_page"] Add these shortcodes directly in the page’s content field, or use a Shortcode block (when using the Block Editor), or a Shortcode widget (when using Elementor, Bricks or Beaver Builder). We have seen some users using it successfully with FacetWP. If this happens, the first thing to do is wait a few minutes. If you are using FacetWP’s “New” Google Maps integration (FacetWP v4. Using categories, a custom taxonomy or a WooCommerce product attribute as Data source. FacetWP Listing – adds a Listing Builder listing. Nov 29, 2023 · How to add a loading spinner or fade the results during facet refresh? This tutorial explains how to add a loading text or spinner icon to the listing template during facet refresh. This happens because posts and/or terms are being inserted and/or saved during the import proce Reducing the post types that FacetWP indexes can improve indexing speed. Nov 27, 2024 · Any form of infinity load / infinite scroll / load more button that is added by other plugins, themes, blocks, or page builder modules/widgets will not work as expected. How to run the indexer. My Account Support Sales About Us Feb 25, 2025 · Overview. Sep 11, 2024 · • We introduced a new `facetwp_scripts` action hook which you can use to add custom scripts that only run on pages with facets (as opposed to using the `wp_footer` hook which runs on every page). Nov 20, 2024 · A hard reload of a page with facet selections in the URL will show the cached query instead of the query that should be modified by the FacetWP query parameters. If the new facet does not appear, make sure its name is unique and not already used for another facet. If a facet choice has no associated posts, then it will never appear. May 28, 2024 · Note: This hook only has access to the HTML of a facet’s content. Jan 6, 2025 · We wrote this tutorial to explain how to use meta_query to filter or sort queries by one or more custom field values. Feb 11, 2025 · The Map facet is highly customizable. ) are available as modules too. See all facet types. facetwp-facet-firstfacetname, . Aug 20, 2024 · Your site deserves the best filtering. Back up / export facets or listing templates. To enable FacetWP for your Loop element, select it, scroll to the FacetWP section at the bottom of the settings pane, and enable FacetWP. GitHub Gist: instantly share code, notes, and snippets. How it works. The first letter of each post is compared to these letters, after being stripped from any accent (or simplified) with WP’s built-in remove_accents() function, before being indexed. You can also fade the listing template during refresh , or hide it until facets are selected . Nov 22, 2024 · FacetWP has two API endpoints: the /facetwp/v1/fetch and the /facetwp/v1/refresh endpoint. 3. The Pager facet type can be used to add several types of pagination. Create single-select facets with attributes as data source A Radio facet and a single-select fSelect facet with WooCommerce product variations/attributes as data source. But there are limits to servers, the database, and MySQL itself to take into account. To get a clear mental picture of how the Map add-on works, it is important to understand that the map is not a listing, but a facet. Dec 2, 2024 · FacetWP has an automatic indexer that performs a single re-index when an individual item (a post, page, and category or term name/slug) is edited or saved. Sep 10, 2024 · Custom fields do not include built-in listing URLs, but you can both filter and sort by custom fields (unlike with taxonomies). Jan 31, 2025 · Create your facets Setting a WooCommerce field as a facet’s data source. These hooks and filters can be used directly in your (child)theme’s code (mostly in functions. The /facetwp/v1/refresh endpoint is used by FacetWP itself in the front-end, for filtering. 6 was released on January 31, 2025. If you want to customize the billing details on the invoice, don’t use an access token to log in. The following example scrolls the page to the top of the results (the element with class facetwp-template), after each facet interaction. FacetWP works great with WooCommerce, Advanced Custom Fields, and many other WordPress plugins. For example, to pre-select audi in the ‘make’ facet if the current page URI is demo/cars and the facet isn’t already in use, add the following code to your (child) theme’s functions. Jan 24, 2025 · Your site deserves the best filtering. : Default label: Set the label for the top-level option (default: “Any”). With this hook, you can programmatically register/add new Listing Builder listing templates, instead of using the plugin interface. Browse to Settings > FacetWP > Settings and click the Import / Export tab. Prevent FacetWP interference with the search query on search result pages with no facets Sep 11, 2024 · We’re thrilled to announce the availability of FacetWP 4. Feb 27, 2025 · add_filter( 'facetwp_load_css', '__return_false' ); Enable accessibility support programmatically. Click the “Add Label” button to add (labels for) more levels. However, when you have other facets on the page besides a Search facet, you’ll need to also force FacetWP to index attachments . If you’ve been to any eCommerce site, you’ve probably seen those UI elements (checkboxes, dropdowns, price ranges) that let you narrow down the results. 0 or above. The code on this page works for both types of attributes. 3% of our customer base, and it’s strongly recommended anyways since PHP 7 is up to twice as fast (and more secure). Jul 26, 2024 · Overview. This consists of the accessibility. Download the add-on from the Meta Box website; Install and activate FacetWP, Meta Box, and this add-on; Browse to Settings > FacetWP to add a new facet Jun 27, 2024 · If the source of the builder item is a custom field that outputs an array (for example an ACF Checkboxes or Taxonomy field), FacetWP will automatically output the array values as a comma-separated string. Aug 21, 2024 · Some users have reported issues with Relevanssi’s “Create custom search result snippets” feature. Disabling the “301 redirects” setting fixes the issue. php: Sep 2, 2024 · How to use custom PHP code? PHP code can be added to your (child) theme's functions. Nov 12, 2024 · Another application is to export facet- and listing settings to be used in the facetwp_facets and facetwp_templates hooks, with which it is possible to register facets and listings programmatically. For WPML see this tutorial . Nov 14, 2024 · However, FacetWP does not index out-of-stock products by default. This is important to check because Feb 4, 2025 · Name Description; Data source: The Data source should be a custom field containing a comma-separated latitude, longitude. On this page, intended for beginners, we’ll explain where and how to use these code snippets, for each type of code: PHP, JavaScript and jQuery, CSS, and shortcodes. See also Indexing; The Custom Hooks add-on; Using FacetWP with WP Engine; Using FacetWP with WPML or Polylang; Using FacetWP with Advanced Custom Fields; The facetwp_indexer_query_args hook Dec 16, 2024 · Your site deserves the best filtering. Jan 24, 2025 · In most cases, using FacetWP in combination with (persistent) object caching is problematic. See this explanation of how the indexing process works and which/how facet data is stored in the facetwp_index table. FacetWP uses this special argument to automatically detect this query as the main query to use for filtering. Alternatively, you can use the Custom Hooks add-on , or a code snippets plugin. FacetWP’s includes built-in accessibility support. Breakdance has its own FacetWP integration for filtering post loop elements. Nov 25, 2024 · FacetWP and its index table are highly optimized to handle large amounts of content. facetwp-facet-secondfacetname'). php). With FacetWP, you can enhance the search and filtering experience for your users. • The “Strict query detection” setting is now enabled for new installs, preventing most automatic query detection issues. Default label: “Any”. Jun 20, 2024 · This add-on generates a flyout sidebar which can help with mobile support. Show depth levels: Set custom dropdown labels, and determine which dropdown level appears. Notes: Jan 24, 2022 · FacetWP adds advanced filtering – i. ), Relationship fields and even Repeater sub-fields. Jun 21, 2024 · add_filter( 'facetwp_preload_force_query', '__return_true' ); A usage example can be found in our sticky posts tutorial, where the facetwp_pre_filtered_post_ids hook is used to float sticky posts to the top of the listing when they are already in the results, and the facetwp_preload_force_query hook is needed to make sure this also happens on first page load, on WP archive or custom WP_Query Sep 10, 2024 · The following code preserves the facet choices in a cookie, and upon returning to the page, will reload the page with the active facet choices stored in the cookie. FacetWP automatically works on your existing archive pages too. The reason is that even if the facet is not on the page, FacetWP will filter by it (if it exists), because at the point in the process that this hook runs, FacetWP does not know yet which facets are present on the page. First, edit your facet (Settings > FacetWP) and set the “Sort by” option to “Term Order”. Feb 5, 2025 · // FacetWP Map facet Spiderfier defaults: 'spiderfy' => [ 'markersWontMove' => true, 'markersWontHide' => true, 'basicFormatEvents' => true, 'keepSpiderfied' => true ] Customize spider leg colors The following example shows how to set the color and highlight color of the spider legs. If a Slider facet uses two data sources, the lower value is stored as facet_value, and the upper value is stored as facet_display_value in the index table. So it runs for each post ID, for each facet, and then for each value that this post has stored for that facet’s data source (generally a custom field or one or more terms in a taxonomy). 0+), use the updated documentation instead. 0 requires PHP 7. Add facets anywhere on your page using WP's block editor, shortcodes or PHP. Bumped requirements. The first step is to create an ACF field group. hyf omq ralhvif fnayn bmcaq ttonqz reti udmfgu tytjwrk dstfn hxkqwc elhwdgc aagpc pfc qbmszn