Empty paragraphs inserted with logged in/out shortcodes
-
NOTE: Part of this is an issue with using inline shortcodes, part is a theme issue. Closing as Resolved for now!
Using the um_loggedin and um_loggedout shortcodes inline places content in new paragraph (<p>) tags, not in the blocks generated by WordPress. This creates two problems:
1. There’s an empty paragraph inserted above the shortcode text.
2. If I have a class or ID/anchor tag assigned to the block, it’s applied to the empty paragraph, and not the paragraph that contains the actual text.Here is the text as it appears entered in the WordPress Editor:
[um_loggedin show_lock=no]Choose from the payment options below to complete or renew your membership registration.[/um_loggedin][um_loggedout]Log in to process your payment.[/um_loggedout]
Here’s the generated source from the linked page for a non-logged in user:
<p class=”nwmm_form_intro”></p><p>Log in to process your payment.</p>
Note the empty paragraph with the class name “nwmm_form_intro”. This class is assigned in WordPress to the block containing the shortcode, but is not actually applied to the content created by the shortcode.
If I use separate shortcode blocks it gets better (the content is placed in the initial paragraph with the correct class), however there are empty paragraphs rendered after the shortcode is rendered. This is particularly problematic when there are multiple shortcodes used on the same page, resulting in multiple empty <p> tags and an undesirable layout.
Is there a way to have these shortcodes not create empty paragraphs when those conditions are present? Or a way to ensure they are placed in the parent paragrah? This makes styling or accessing these blocks via javascript difficult, plus it’s very important for me to be able to use your shortcodes inline.
I am using UM version 2.1.16 and WordPress 5.7.
Thanks,
Jim
- This topic was modified 3 years, 7 months ago by .
- This topic was modified 3 years, 7 months ago by .
- This topic was modified 3 years, 7 months ago by . Reason: Clarification after more troubleshooting
- This topic was modified 3 years, 7 months ago by .
The page I need help with: [log in to see the link]
- The topic ‘Empty paragraphs inserted with logged in/out shortcodes’ is closed to new replies.