How to style fallback output
-
The output from the fallback attribute of Today’s Events shortcode has no class or HTML, so there does not seem to be a way to easily style it with CSS. I tried adding HTML inside the fallback attribute, something like fallback=”<p class=’myclass’>No events today</p>”. This works until I edit the page again. Then the Gutenberg editor automatically changes the single quotes to double quotes, so the fallback text does not display at all. Is there a way to style the output of the Fallback attribute?
Steps to reproduce:
– add shortcode using Gutenberg editor to a page and Save
[my_calendar_today category=”3″ fallback=”<p class=’myclass’>No events today.</p>” template=”{title}”]
– Page displays the fallback text when there are no events, and paragraph has a class.
– Exit the editor
– Open the page again in the Gutenberg editor.
– Shortcode now has no single quotation marks. They have been replaced by double quotes.
– Make a change to the page, and save.
– Page no longer displays fallback text when there are no events.================ Installation Data ====================
==My Calendar:==
Version: 3.2.8
DB Version: 3.2.8
CSS: twentytwenty.css==WordPress:==
Version: 5.4.2
Language: en-US
Charset: UTF-8==Extra info:==
PHP Version: 7.2.33
DB Version: 5.5.5
Server Software: Microsoft-IIS/8.5
- The topic ‘How to style fallback output’ is closed to new replies.