Views is a WordPress plugin that lets you easily display content on your website's front-end in any way you choose.
Views User Guides include detailed documentation for creating lists of content, templates for content and archive page and also explain how to create parametric searches for any content type.
When you ask for help or report issues, make sure to tell us the versions of the Toolset plugins that you have installed and activated.
Viewing 15 topics - 1,621 through 1,635 (of 3,129 total)
Problem: I have a series of search filters displayed as checkboxes. The checkboxes are displayed in a single column with several rows. Instead, I would like to display the checkboxes in a single row with multiple columns. If I inspect the checkbox containers I can see they are set to display:inline-block; but they break to separate rows. How can I display the checkboxes in a single row?
Solution: Use custom CSS to override the default layout styles for the checkbox elements. In this case, applying display:flex to the checkboxes container element is sufficient to implement the flexbox model and display the filters in a single row with multiple columns.
Problem: I have implemented the select2.js library and replaced the select filters in my custom search View with select2 elements. After submitting search filters, Views updates the results using AJAX and the select2.js filters are replaced with default select fields. I would like to reinitialize the select2 filters after an AJAX update in the View.
Solution: Views search filters are replaced during AJAX result updates, so any customizations you perform to the filters must be reapplied after an AJAX update. In the legacy Views editor, you can use the Front-end Events button in the Search and Pagination editor area to insert event hook templates for various events available in the Views and Maps systems. Use the search results updated event hook to trigger custom JavaScript code that reinitializes the select2.js elements in custom search filters. The event hook callback template looks like this:
jQuery( document ).on( 'js_event_wpv_parametric_search_results_updated', function( event, data ) {
/**
* data.view_unique_id (string) The View unique ID hash
* data.layout (object) The jQuery object for the View layout wrapper
*/
// Add your own custom JavaScript here to initialize the select2 element again
});