Support » Plugin: Show Post Categories » Tried using HTML entities as separators, but doesn’t work

  • Resolved Craig

    (@cpfusion)


    Hi,

    I have tried adding the following as separators (removing the spaces obviously), but they don’t have any effect on the result. I got this info from the original post here.

    & # 010; For Line Feed, or,
    & # 013; For Carriage return

    My shortcode:-
    [show_post_categories show="category" hyperlink="no" separator="& # 013;"]

    Any other ideas as to why this may not be working?

    • This topic was modified 6 months, 1 week ago by Craig.
    • This topic was modified 6 months, 1 week ago by Craig.
Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author willemso

    (@willemso)

    Hello Craig

    In your short code, can you remove the white spaces between & # and 013?
    The forum doesn’t allow to add this code in the comments, so can’t post the exact code. So if you remove this spaces in your WP app it should work fine!

    Thread Starter Craig

    (@cpfusion)

    Hi Olivier,

    Thanks for your reply. The shortcode I used has the spaces removed, but unfortunately it still doesn’t work. I also tried adding the entity in the plugin UI, but when saving, the entity disappears.

    I just added the spaces here as even when wrapping the shortcode in a code wrapper, it doesn’t display properly.

    Craig

    Plugin Author willemso

    (@willemso)

    Ok, clear!
    If you would just enter a regular br, what happens?

    And can you give some info on the WP version, theme..?

    Thread Starter Craig

    (@cpfusion)

    I have tried a regular br, and it cuts off some of the text (see screen grab)

    Screen Grab

    I’m using WP 6.0 and Beaver Builder/Beaver Builder Theme (child)

    Plugin Author willemso

    (@willemso)

    I haven´t tried it on WP6 nor Beaver, but my guess it might be cause due Beaver Builder.

    Does Beaver have an option to insert plain text instead of a visual text box? If so can you enter the code in the plain text instead of the visual text editor? This is often an issue on Elementor (another builder).

    You could also try to use &#10 or &#13 instead of &#010 / &#013

    Thread Starter Craig

    (@cpfusion)

    The Beaver Builder module I am using is a Post Grid module which has the ability to add a custom layout with HTML (which is what I am using and is shown in the screen grab in my previous post).

    Unfortunately, the &#10 or &#13 didn’t work.

    I will get in touch with Beaver Builder support and see if they can shed some light of the issue from their end.

    • This reply was modified 6 months ago by Craig.
    Thread Starter Craig

    (@cpfusion)

    After further investigation, and discussion with the BB support team, it doesn’t appear to be anything to do with Beaver Builder. It was tested on a non BB site and the result was the same.

    I tried playing around with the category title and slug, and here is what I found:-

    Tried “writing for the car” – no “r”
    Tried “writing for the near” – no “r”
    Tried “writing for the fear” – no “r”
    Tried “writing for the butter” – no r
    Tried “writing for the eat” – works fine
    Tried “writing for the cat” – works fine

    So it seems to be the letter R at the end that is being removed, but if the word does not end in an R, it seems to be fine.

    https://share.cleanshot.com/HoAs0xrEOyCpNOsgEkuT

    Replacing return trim( $spc_output, $Separator ); with the following did the trick.
    return is_numeric( $pos = strrpos( $spc_output, $Separator) ) ? substr_replace( $spc_output, '', $pos, strlen( $Separator ) ) : $spc_output;

    Plugin Author willemso

    (@willemso)

    Hi Craig, Simon,

    That’s the first time I’ve seen this error. Happy to see Simon found a work around, could you give it a go?

    Will see if I can find some time to update the code, although this might take some time.

    Tanks Simon!

    Thread Starter Craig

    (@cpfusion)

    Awesome work from Simon (and Jamie) from the Beaver Builder support team.

    I can confirm that by making the change above in the category.php file, everything is working as it should.

    Thank you Simon, Jamie and Olivier.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Tried using HTML entities as separators, but doesn’t work’ is closed to new replies.