Unexpected Content Styling
This guide applies to:
- Basic
- Professional
In this guide
Introduction
When creating an interactive image and the hotspots for it, sometimes there may be unexpected results within the description of the hotspot. Such issues can involve strange styling or characters that interfere with the overall look and feel of your image. Not to fret – there are some ways to check and resolve unexpected content styling!
Determining the Cause behind Unexpected Content Styling
To narrow down the cause of the unexpected styling, you can:
- Switch tabs
- Convert the description to plain text
1. Switch Tabs
Click the Text tab to switch from the Visual view. This will provide you with more details on how your text is formatted, and if there are any unexpected HTML elements scattered within the description.
2. Convert to Plain Text to Remove Unexpected Styling
Another way to determine whether or not there is an issue with unexpected styling in the description text is to convert it all to plain text. Doing so will remove any strange formatting that may have gone unnoticed.
To fix any formatting issues, you could copy the message and paste it into a basic text editor on your computer.
- For iOS: Paste into TextEdit, click on Format > Make Plain Text, copy the text again and paste it back into the Description.
- For Windows: Paste into Notepad, copy the text again and paste it back into the Description.
3. Disable wpautop
The Draw Attention plugin uses a WordPress function called wpautop; it automatically adds paragraph tags to help you format your content. If you would like to have total control over the HTML in your more info or description fields, you can disable the wpautop filter.
One thing to keep in mind – this will automatically remove all of the extra paragraph tags from every more info field on every Draw Attention image.
Disable wpautop to stop getting paragraph tags from being added between your HTML tags in the description or more info fields.
function my_da_unautop() {
remove_filter( 'da_description', 'wpautop' );
}
add_action( 'template_redirect', 'my_da_unautop' );
Learn how to add PHP snippets to your website.
Related Guides
-
JavaScript Error Displays or Flashes
-
Unable to Edit or Create
-
Hotspots Out of Place
-
Hidden Images Don’t Work