With the Views plugin you can create different Views elements to display all your custom types and content on the front-end, without coding. You can also create powerful parametric searches and add pagination to your content lists.
When you ask for help or report issues, make sure to tell us the options of your View.
Viewing 15 topics - 4,006 through 4,020 (of 4,073 total)
Problem: I would like to calculate an age in years based on a given birth year.
Solution: It's not possible to calculate an age with only a year. You must have a year, month, and day to perform an accurate calculation. I have created a custom shortcode for this purpose, you can adapt for your needs.
Problem: I would like to display a list of posts that were published in the last 2 months, but I can't get the Query Filter to work correctly.
Solution: Month range filters like this aren't simple to add in wp-admin but I can provide a custom code snippet that will help. First, please remove the post date filters from your View. Then add the following code to your child theme's functions.php file, or create a new snippet in Toolset > Settings > Custom code:
Problem:
Is it possible to output a URL stored in a Types URL field as a shortened-URL?
Solution:
No. It might be possible to produce a custom solution if the URL-shortening service has an API, otherwise you would need to store the shortened URL (which you might get by pasting the normal URL into such a URL shortening service) directly as a custom field.
Problem: I have a one-to-many post relationship set up between Trial Days and Showings. I would like to display a list of Showings from the Trials Days with a custom field date in the last few days.
Solution: You can set up a View of Trial Days, filtered by the trial date custom field. Apply your 'n' number of days to the query filter of this View. You can place this View on your site temporarily to confirm the correct Trial Days are being displayed.
Next create a View of Showings, filtered by post ID, set by a shortcode attribute "ids". In the Loop of this View, add the post title for now. You can modify the display later. Next, add this code in your child theme's functions.php file, or create a new snippet in Toolset > Settings > Custom code:
You must edit the parent View ID to match the numeric ID of your View of Trial Days. You must edit the child View ID to match the numeric ID of your View of Showings. You must also edit the relationship slug to match your Trial Days > Showings relationship slug. You can find that in Toolset > Relationships when you edit this relationship. Finally, insert this custom shortcode where you want to display recent Showings: