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,401 through 2,415 (of 2,472 total)
Problem: I have a custom post type called "Swimmers", and each Swimmer single post page title is the name of the Swimmer. I would like to show a View of standard WordPress Posts on the Swimmer single post page, and I would like to filter that View using the Swimmer's name.
Solution: Use a text search Query Filter and pass the current post's title into the filter as a shortcode attribute.
How to loop and display all parent post, then sort order that list by the date of the child post?
Solution
In a View, you can order by 2 arguments, a primary and secondary, but there is no orderby "the parent post".
As a possible solution, you can create a View, and query the Child Post Type.
Those you can order by their date in the orderby setting.
Then, in the Loop, you will have to call the related parent Posts.
What you can also do is create 2 Views, in one you query the parent post and order it by what you need, in the second View you query the Child posts (that are a child to the post in the loop).
Those you can order again as you need.
Then you insert the second View into the first's View Loop.
Then, the first View is inserted in a page, and will produce this sort of result:
- parent post (ordered by what you chose)
-- child post (ordered by what you chose)
-- child post (ordered by what you chose)
-- child post (ordered by what you chose)
- another parent post (ordered by what you chose)
-- another child post (ordered by what you chose)
-- another child post (ordered by what you chose)
-- another child post (ordered by what you chose)
The issue here is that the customer wanted to allow his clients to add apartment capacities to his custom fields. Example if a customer creates an apartment but it can hold more than the standard 1-2 or 3-4 . Then the customer wants the user to add the additional capacities.
Solution:
I would recommend using taxonomies as you can dynamically add more terms to a taxonomy from our CRED form on the frontend.
So if the user creates a new apartment location and the current group size that this apartment offers is not in the list then the user can click on add term and then add a new group size.
Problem: I have a View that shows inconsistent results when filters are applied or removed.
Solution: Uncheck the box "Don't include this page in the results of this View" and delete the current WordPress Archive applied to product categories. There is currently a Layout and a View assigned to product categories so the WordPress Archive is unnecessary.
Problem:
Client is adding custom JS to modify the behaviour of Views filter controls, but the JS only works on initial page load and not when the page has been updated via ajax after changing existing filters.
Solution:
Views provides a series of custom JS events available when using ajax, e.g. for updating content when filters are changed or on pagination, which can be inserted using the Front-end Events button in the custom JS box.
The correct format for adding custom code to the dom ready event and a custom Views event would look like this:
( function( $ ) {
$( document ).ready( function(){
// Code you want to run when the page loads
});
$( document ).on( 'js_event_wpv_parametric_search_form_updated', function( event, data ) {
// Code you want to run when filters have been changed
});
})( jQuery );