• Resolved ialfrederick

    (@ialfrederick)


    Hi!

    I’m trying to insert a set of shortcodes that will enable me to restrict part of my post to logged out users.

    The shortcodes are the following:

    Opening: [um_loggedin]
    Closing: [/um_loggedin]

    The content between these opening and closing shortcodes will be hidden to logged out users on our site.

    The opening shortcode works but the closing one isn’t. It’s just being displayed as a regular text on our site.

    I would really appreciate your assistance in making the closing shortcode to work. Thanks and have a good one! πŸ™‚

    • This topic was modified 5 years, 5 months ago by ialfrederick.

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Spacetime

    (@spacetime)

    Remote debugging doesn’t seem to be enabled:
    https://wordpress.org/support/topic/ad-inserter-support-before-you-ask-for-help/

    Please check this and also list block numbers to check.

    Thread Starter ialfrederick

    (@ialfrederick)

    Done! πŸ™‚ It is now enabled.

    Plugin Author Spacetime

    (@spacetime)

    A possible problem I noticed is that your are inserting shortcodes inside the wrapping div.
    Try to use No wrapping style so only the shortcodes will be inserted:
    https://adinserter.pro/documentation/alignments-and-styles#no-wrapping

    Right click and browser debugging functions also do not work.

    Thread Starter ialfrederick

    (@ialfrederick)

    Hi!

    I tried to use the No Wrapping style to no avail…

    I also enabled the right-click function on the site…

    Do we have other potential solutions aside from No Wrapping?

    I just noticed that the opening shortcode works, but the closing one ([/um_loggedin]) isn’t but when I remove the slash (/), the closing works but it doesn’t restrict the content between these two shortcodes since I removed the slash…

    Plugin Author Spacetime

    (@spacetime)

    Not sure how that plugin processes shortcodes.

    Try to lower plugin priority (for example to 8):
    https://adinserter.pro/documentation/plugin-settings#plugin-priority

    This way Ad Inserter will process the content first.

    Thread Starter ialfrederick

    (@ialfrederick)

    Done, still not working πŸ™

    Plugin Author Spacetime

    (@spacetime)

    Then the problem is very likely the way you are inserting the shortcodes.
    That plugins very likely expects both shortcodes in the conten at the same time.

    Block 1 is inserted first and Ad Inserter calls do_shortcode () to process shortcodes in the block. It then inserts the actual code generated by that restriction plugin.
    Then it inserts block 2 with the closing shortcode but that plugin doesn’t see the opening shortcode.

    Try to prevent processing the opening shortcode during insertion with Ad Inserter:

    [ [um_loggedin] ]

    No spaces between brackets – it seems the forum processes shortcodes.

    Thread Starter ialfrederick

    (@ialfrederick)

    If I add the said closing shortcode manually directly on the post editor, it actually works…it detects the opening shortcode even if they are not on the same content block…

    Plugin Author Spacetime

    (@spacetime)

    Have you tried the suggestion above?

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Some Shortcode Not Working’ is closed to new replies.