Views plugin lets you build your own custom search for any content type. These searches can be based on post content, taxonomies and custom fields.
When you ask for help or report issues, make sure to tell us settings for your custom search.
Viewing 15 topics - 2,431 through 2,445 (of 2,480 total)
When creating a Voyage (CPT), there is a Select field where a user specifies option 1 or option 2. Based on their selection they will then be given different fields for inputting voyage dates.
Option 1 gives them a repeating field to enter multiple Start Date & Times and a 'voyage length' field to state how many hours long the voyage will be.
Option 2 Gives them fields to enter a Start Date and an End Date for the voyage.
My ideal situation would be a single archive page listing all results, where users have the option to filter to show only Option 1 results or only Option 2 results then set a Date Range in order to further filter the results.
The problem is that the date fields are not the same for both Options.
The solution I envisage is that the correct date filters will only display for the when and if the right option is selected.
Solution:
There isn't such a built-in feature within Views plugin, it needs custom JS codes.
In your case, I suggest you reset the hidden field "wpv-wpcf-voyage-disembarkation-date" instead of the datepicker, the hidden field wpv-wpcf-voyage-disembarkation-date" will pass the URL parameter to the view, but the datepicker don't.
For example, you can replace this line of your codes from:
jQuery( '.wpv-date-front-end[data-param=wpv-wpcf-voyage-disembarkation-date]' ).datepicker( "setDate", null );
To:
Problem: I have a View that shows results from two post types. I would like to show the results in two different columns, organized by post type.
Solution: Since there is no post type filter in Views, the best solution is to use two separate Views.
- View 1 will show Houses, and View 2 will show Apartments.
- The two Views should use exactly the same filters, including the same URL parameters. The easiest way to make sure is to create View 1 first, get it working right, then Duplicate View 1, change the post type, and save it as View 2.
- In the Loop Output editor, build the list of results in a single column.
- Insert View 1 showing both the filters and results, and insert View 2 after that, showing only results.
- Use CSS to move the two Views into columns.
Problem:
A View with text searches returns results where the search term is found only in the body and not the title, and the client wants to give higher weighting to the title.
Solution:
Views text searches builds on standard WordPress queries and so simply detects whether the string is present or not. You can specify whether to include just the post title, or both the title and the content, but not assign weights to them.
For that you would need to add a specialised search plugin.
Relevanssi (https://wordpress.org/plugins/relevanssi/) includes such weighting, and has the additional benefit that it is integrated with Views searches so that you can include text from your custom fields in the searches, too.
Problem:
If you try to insert front-end ordering controls that allow sorting by a hidden custom field onto a custom product (WooCommerce) archive, the sorting doesn’t work.
Problem:
The issue here was that the user wanted to create a custom search archive but set it up incorrectly so the filters didn't have any value in them.