![]() This topic was modified 1 month, 3 weeks ago by sweetrobot. 1/ Browse to Settings > FacetWP, click the Templates tab, select the template which you are using, then copy and backup the code in Display Code to. Set a custom zoom level or location/center, or Restrict the map viewport. i wanted to see if a solution where both are fully compatible is possible in the first place. This page gives an overview of possible customizations of the Map facet, among which: Customize Google Maps API loading, or localize your map. If needed, i am not opposed to seeking professional/ developer assistance in the matter. i figure iâd ask here, seeking support from both sides. I would prefer to pursue a solution where both play nicely before throwing in the towel and opting for either resolve. however, in this instance i was told that various object caching plugins tend to prevent fwp from being able to detect the query â and to therefore disable the object cache, or create exclusions. If you have facets on a normal post or page, and you need to pre-select a facet choice based on a value. I reached out to support from fwp, (who have been very helpful in the past). Pre-select a facet choice based on a custom field value. is_filtered): ?> Not faceting content. This worked quite well, but was, in retrospect, overkill.įacetWP maintains a global PHP singleton with most of the information you could ever want attached to it, including whether or not any facets are activated. Updated AnswerÄ«ack in 2019, the solution published here included some filters to add custom variables to the WP_Query object. By default, the Hierarchy Select facet will always show all levels of the taxonomy, also if you select a parent choice that has fewer levels than others. We need to disable that unless a user has selected some facets. Given this query, if there are any products on the site that match this default taxonomy query, this loop will display them. While($productQuery->have_posts()) : $productQuery->the_post() Ä®ndif ?> Code language: HTML, XML ( xml ) ![]() Documentation on the facetwp query argument can be found on the FacetWP website. I had shortcodes to output my facets: Find Your Product Code language: HTML, XML ( xml ) Thereâs definitely a typo in that heading, but you get the idea.Ä®ven though the default query returns results, I donât want to display them if no facets have been selected.įirst, letâs take a look at how weâve implemented FacetWP in this case. Turning off all facets, however, should show a special no-facets-active message. With facets selected, we see products that match our narrowing filters. with class facetwp-counter around the counts in each option // With node.I needed to display something other than the unfiltered ( unfaceted) query results if a user hadnât selected any facets. In this particular use case, I had a collection of facets to narrow the results of a listing of products on the website. 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. FacetWP plugin for sorting/filtering the resource and TranslatePress for translation. How to pre-select facet choices It is possible to pre-select facet choices on page load, using the facetwppreloadurlvars hook. If thereâs one thing I hate, itâs writing code in the WordPress admin. select one of the languages in the top right hand corner other than. But I have enjoyed that FacetWP, by and large, lets me bring my own templates to the party from within the theme. Iâve used Toolset Views in the past, and Iâm not deep enough to say I have a favorite. Iâve recently been diving into FacetWP as a tool for getting down and dirty with post filtering in WordPress.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |