WordPress.org

Ready to get started?Download WordPress

Forums

Multiple content blocks
[resolved] If MCB empty display default content (2 posts)

  1. candell
    Member
    Posted 1 year ago #

    I am displaying some fallback content if no content has been placed into the Multiple Content Block on any particular page. This works fine, however, two editor textareas appear in the edit page in wordpress, see here

    http://s13.postimage.org/ks0btwzwn/Capture.png

    This will be down to how I am checking for content in the MCB and outputting based on that. Is there a better way that will also ensure only one textarea appears in wordpress?

    <?php
    $rhs_block = get_the_block('Right-hand-side');
    if ($rhs_block == "") :
    ?>
    <p>Fallback content if nothing is entering into the mcb in the editor</p>
    <?php
    else :
    echo $rhs_block;
    endif
    ?>

    http://wordpress.org/extend/plugins/multiple-content-blocks/

  2. Trendwerk
    Member
    Plugin Author

    Posted 1 year ago #

    This problem should be fixed in the new completely rewritten 3.0. Templates and annotations should always work now.

    Any suggestions or still having issues? Please tell us on Git!
    https://github.com/trendwerk/multiple-content-blocks/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.