Views plugin provides an API, making it easy to display Views output using PHP.
When you ask for help or report issues, make sure to tell us all related information about your View and the data that you want to display using the Views API.
Viewing 15 topics - 376 through 390 (of 458 total)
Problem:
How to use the Views API on WordPress Archives?
Solution:
WordPress archives do not support the Views API.
Only
pre_get_posts
will work on archives.
You can, however, add queries to the Archive by setting them in the Toolset WordPress archive, if you enable the full custom view (Screen options of the archive)
There, you can add queries by fields, terms, and more.
Problem: I have a View that shows Events as a list, and also on a map. If the Event is "private", I do not want to show it on the map but I want it to appear in the results.
Solution: Use a checkbox field or a radio field to set the public / private status of each item. Use conditional HTML to show or not show the map marker for each result.
Problem:
How to record the date a user last logged in?
Solution:
The WordPress hook wp_login is triggered whether a user logs in with the standard WordPress login form, or a Toolset custom login form, and can be used to trigger code to record the login time.