WordPress.org

Ready to get started?Download WordPress

Forums

Advanced Custom Fields
[resolved] WYSIWYG p tag not rendering (4 posts)

  1. Eddie
    Member
    Posted 1 year ago #

    I'm using Advanced Custom Fields to add a second WYSIWYG editor to a page - The problem is that it's not rendering any <p> tag around regular text within the additional WYSIWYG editor
    - The default editor is working
    - Both editors are rendering other HTML tags correctly

    http://wordpress.org/extend/plugins/advanced-custom-fields/

  2. ladyroboto
    Member
    Posted 1 year ago #

    Assuming you are using get_meta_data to retrieve your variable, I had the same problem. Here's the solution:

    <?php
    global $wp_query;
    $postid = $wp_query->post->ID;
    $myCopyBlockMeta = get_post_meta($postid, 'my_field_name', true);
    $myCopyBlock = wpautop($myCopyBlockMeta);
    wp_reset_query();
    
    if ($myCopyBlock) {
    echo $myCopyBlock;
    }
    ?>

    Also, if you are copy/pasting any text into your advanced custom field, make sure you backspace and recreate any line breaks. It seems that the field won't recognize the paragraph breaks otherwise.

    Hope this helps!

  3. Eddie
    Member
    Posted 1 year ago #

    Worked perfectly, thanks!

  4. elliotcondon
    Member
    Plugin Author

    Posted 1 year ago #

    Hey guys,

    Check out the ACF functions like get_field and the_field.

    They do all this for you!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.