I also run Do It With WordPress, which has an array of tutorials for managing, modifying and maintaining your WordPress sites, as well as The WP Butler, a service for keeping your site maintained, backed up, updated and secure.Use WP Dark Mode plugin to create a stunning dark version for your WordPress website. The else attribute does accept HTML, but is restricted by WordPress’ limitation on HTML inside shortcode attributes.The time used by the plugin is your site’s local time (check in Settings > General).Note that with nested shortcodes, you need to add the else attribute to each shortcode. For example, you could invite people to visit your store during opening hours and ask them come back soon otherwise, like this: Our store is currently open You can also define a message which should appear if your content is not showing by using the else attribute 2.5. ).įor example, showing a message during business hours only on Monday to Friday: Our store is currently open
Since you cannot nest shortcodes with the same name, you need to add -2 or -3 to time-restrict-repeat in your shortcode (e.g. If you’re feeling creative, you can even nest shortcodes to account for multiple concurrent conditions. Our employees are currently enjoying time with their families for Christmas. You can cross over the end of the month or even the end of the year, and apply times to your start and end dates, e.g. Please bear with us! Īnd lastly, an annual schedule takes the following form: I'm currently in the mountains enjoying the summer! We are exceptionally busy at the end of each billing cycle. You can both cross over the end of the month, and apply times to your start and end dates, e.g. You can also specify start and stop times if you want (it will assume starting at 00:00:00 and ending at 23:59:59 if these are left out, like above): It's the weekend baby! Ī monthly schedule takes the following form: The first week of the month Note that you can also cross over midnight, so to only show something from 10PM to 5AM, you can use: For the night owls Ī weekly schedule takes the following form: The work week Your options are a daily, weekly, monthly or annual schedule.Ī daily schedule takes the following form: Working 9 to 5 To show and hide content on a recurring schedule, you can use the shortcode. So if you want some content to appear between January 1st and January 10th, you could do the following: This is a limited time offer Usage – repeating schedule You can also combine starting and ending dates for the same piece of content. You can use any date or time string supported by PHP, such as: Will display until Will display until Will display until Will show after at 6pm until the first second of 2015) and the second message will show up from 00:00:00 (i.e. If you do not enter a time with the date, it will default to 00:00:00, so in the above example, the first message will show up until 00:00:00 (i.e. For example: Please enter our competition Sorry, this competition has closed To show or hide content at one point in time, you can use the shortcode. There’s also a separate shortcode if you want to repeat a schedule for showing and hiding content – for example to only show information about a radio show while it’s on air. You can also combine the two to show some content at a given time, and then hide it at another time. This plugin provides shortcodes allowing you to display content or hide content at given dates and times.
WORDPRESS SHOWHIDE PLUGIN PHP FREE
This plugin is maintained on GitHub, so feel free to use the repository for reporting issues, submitting feature requests and submitting pull requests. Like this plugin? Consider leaving a quick review or writing about how you’ve used it on your site – send me a link to that write up if you do.