Support » Plugin: Multiple content blocks » tag not working

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author Harold Angenent


    Actually, no. MCB uses the same filters as the normal content. The content seems to be removing the rest on its own.

    That means you should use code to show part of the content block. Maybe you can take a look at

    Thanks for your help! But how can i insert some code in MCB? “the more on pages hack” is inserted in the template in the loop right under “<?php while( have_posts() ) : the_post(); ?>”, so i guess there should be some kind of template for MCB where i could insert that hack too?

    by reading the linked code, i guess i understand most of that stuff, but we cannot change that, as it’s the wp-source, right?

    Plugin Author Harold Angenent


    No, but this is how the WordPress the_content function works. If you want the same thing for a custom block, you should replicate that code.

    So that ‘hack’ won’t work on MCB, since it doesn’t replicate the the_content function by default.

    If you want to show part of a content block, you could use the function wp_trim_words:

    ok, thanks a lot! Where should i add some code to prevent it from beeing overwrtten with a future update?

    Plugin Author Harold Angenent


    There is no need to edit the plugin, instead of the_block( 'Blockname' ); you can try something like echo wp_trim_words( get_the_block( 'Blockname'), 40 );.

    If you put it in your template, a plugin update won’t overwrite it. Good luck!

    thanks a lot, i’ll try that and see what happens.

    sorry for the delay, i ran out of time…
    So now i tried this:

    <?php echo wp_trim_words( get_the_block(‘unterer_block_1’), 40 ); ?>

    well, it works partially… It cuts the text after 40 word, but it also cuts all html-formats like <h3> and <img> and finally there’s no read-more-link at the end of the stripped text. 3 dots and nothing more.

    So i guess i’m stuck again…

    if i try <?php the_content( get_the_block(‘unterer_block_2’) ); ?> the text won’t be cut, but the whole text becomes the read-more-link, which is of course not working. But at least the html-formats won’t be cut.

    So i guess, we are on the right way, but there’s still some way to go…

    Plugin Author Harold Angenent



    How about <?php echo strstr( get_the_block('unterer_block_2'), '<!--more-->', true ); ?>?

    Warning: Wrong parameter count for strstr() in /WWWROOT/227712/htdocs/wp-content/themes/responsive-child/Inhalt_Sidebar_Block_unten.php on line 75

    Plugin Author Harold Angenent


    The last parameter was added from PHP 5.3. Maybe you have a lower version.

    I’m glad to help you when there’s a problem / bug with my plugin, but this is just one of the implementations you could do with it. In my opinion, this is more PHP support.

    I think I’ve given you a lot of pointers for where to look, but I’m afraid I don’t have time to answer all PHP support questions. Good luck!

    Ok, thanks a lot. If i get it running, i’ll post it here. If not, i’m dead 😀

    I updated to 5.3 and the error is gone, the text is cut at the right place, all html-tags are working, only the read-more-link is missing.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘tag not working’ is closed to new replies.