Hi @flaboi850m. Do you mean that the button gets outputted on a new line instead of inline in the previous text? The button gets printed on a new line on purpose. It’s actually wrapped in a <div> which makes it possible to align it horizontally. But you could override the button template by yourself if you want. See this documentation https://github.com/liip/bootstrap-blocks-wordpress-plugin#templates how to do this.
@tschortsch when I add the button text. A line break is added before the text and i can’t get rid of it.
Can you maybe insert your block content (code from the editor) here and tell me on which version of wp-bootstrap-block and WordPress you are?
Sorry I didn’t see you had replied. The code being output is
<div class="wp-bootstrap-blocks-button">
<a href="" class="btn btn-primary"><br>
Test</a>
</div>
For some reason after the starting a tag a br
tag is being added. I can’t find out where it’s getting added from.
I’m running WordPress 5.3.4 and Version 2.4.0 of bootstrap blocks
Sorry I can’t reproduce this issue in a WordPress 5.3.4 demo instance.
Here’s my editor content:
<!-- wp:wp-bootstrap-blocks/button {"text":"Test","alignment":"center"} /-->
Which results in this output:
<div class="wp-bootstrap-blocks-button text-center">
<a href="" class="btn btn-primary">
Test </a>
</div>
Have you maybe overwritten the button.php
template? Can you insert the exact content of the editor here? (<!-- wp:wp-bootstrap-blocks/button { ... } /-->
)
I’m having the same issue… the editor content appears fine:
<!-- wp:wp-bootstrap-blocks/button {"url":"https://google.com","text":"Button","className":"btn-lg"} /-->
But the <br> appears in the rendered page (like it’s being automatically generated by WordPress):
<div class="wp-bootstrap-blocks-button">
<a
href="https://google.com"
class="btn btn-lg btn-primary"
><br />
Button </a>
</div>
-
This reply was modified 4 years, 3 months ago by
peterjrees.
-
This reply was modified 4 years, 3 months ago by
peterjrees.
I found this was caused by the Raw HTML Pro Plugin – deactivated and the issue has resolved.
Good to know where the issue is coming from! Theoretically we have snapshot tests for the output of many different block variations so the chance that it’s a problem coming from this plugin directly should be rather low.