No wpautop - pulling meta from blog page

Support General No wpautop - pulling meta from blog page

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #10355
    lemonydesignlemonydesign
    Participant

    I want to display a paragraph heading my blog (set as a blog archive). I've added a wysiwyg metabox and this adds the intro to the top of the blog archive (index.php) before the posts. I am not having any success - trying all sorts of combinations - see below - to get <p> tags to function. All I am getting is the text surrounded by <div> tags. Any ideas? Am stuck.

    ** BASIC OUTPUT CODE
    $blog_id = get_option('page_for_posts');
    $blog_intro = rwmb_meta( 'blog_intro', '', $blog_id );
    echo $blog_intro;

    Have experimented with the following -
    $blog_intro = wpautop( $rwmb_meta( 'blog_intro', '', $blog_id ) );
    echo wpautop( $blog_intro );
    echo wpautop( $rwmb_meta( 'blog_intro', '', $blog_id ) );
    echo do_shortcode( wpautop( $value ) );

    ALSO TRIED
    $blog_meta = get_post_meta($blog_id, 'blog_intro', true);
    echo '<p>' . $blog_meta . '</p>';

    #10359
    Anh TranAnh Tran
    Keymaster

    Hi,

    This line is correct:

    echo wpautop( $rwmb_meta( 'blog_intro', '' $blog_id ) );

    However, both wpautop and non-wpautop versions have nothing to do with div tags. They only wrap paragraphs into p tags and ignores the br. The div must be entered in the field content. So I'd suggest you ask for the access to the field content and make the change manually, or ask who entered that check the markup in the "Text" mode.

    #10366
    lemonydesignlemonydesign
    Participant

    Oh dear, rookie error that I didn't think to check on the meta entry (copy-paste-haste - no one else to blame). Slap forehead. With thanks and apologies.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘No wpautop - pulling meta from blog page’ is closed to new replies.