Can you please answer to that it;s really a problem
if i want to for ex to write
hello
world
i have to do that
<div>hello</div>
<div>world</div>
if i put a br it doesn’t stay there
and if i simply go to the next line it doesn’t do it
in wordpress editor if i write
hello
world
it will appear like that in the front end , not here
Also, the shortcodes doesn’t work in the rich text 🙁
Shortcodes are not working for me either. Any update on this?
@alexadark These issues were explained in github – it resolved my problems with rich_text:
https://github.com/htmlburger/carbon-fields/issues/92
Great it works!
But one thing i don’t understand is that if i don’t want to have wpautop for ex, and want to have a <br> tag to go to the next line, the br is not kept, so it makes the rich_text editor very difficult to use without applying these filters
Hi, I have the same problem. Impossible to have a Return to the line in custom field rich text. or <Br/> (like in default wysiwyg WP).
Do you have a solution, or an update with carbon field ?
Paragraphs and line breaks are saved in the exact same way as the normal WordPress editor does. The difference being that when outputting, WordPress passes the content through a number of filters which prepare the content for display (the_content).
The simplest way to have line breaks and paragraphs added when you display content from a rich text field is to use wpautop() together with do_shortcode() like this:
<?php echo wpautop( do_shortcode( carbon_get_the_post_meta( 'your_richtext_field_name_here' ) ) ); ?>
do_shortcode() parses all shortcodes while wpautop() handles linebreaks and paragraphs.
You can also do apply_filters( 'the_content', carbon_get_the_post_meta( 'your_richtext_field_name_here' ) ) to apply the full list of filters over the content, however this is not recommended as it may have undesired effects and plugins may interfere with normal usage.
-
This reply was modified 9 years, 4 months ago by
htmlBurger.