Support » Plugin: Multiple content blocks » can't get it to work

  • Resolved novaflash


    So I downloaded and installed and activated the plugin.

    Then I went to page.php and edited it. After the loop ends I added this line:

    <?php the_block('workdamnyou'); ?>

    But nothing happens.

    I tried tons of things to convince it to work but nothing works. I never once got an extra content block visible in the ‘Page’ area in the Dashboard when editing a page.

    I also tried doing the same with a specific template – still nothing.

    I do get under ‘custom fields’ in the dropdown an extra name “mcb-blocks” but with no value.

Viewing 14 replies - 1 through 14 (of 14 total)
  • This is what I added:

    <div class="column second-column">
    <?php the_block('Second column'); ?>

    I added the code above to page.php and checked a page and I found the Multiple Content blocks appearing when I refreshed it.


    Plugin Author Trendwerk


    It should work. Is this still a problem?

    MCB checks what blocks you’re using through a remote HTTP request. Maybe your server settings don’t allow it (and we should catch that error). Can you try and comment line 92 in assets/inc/class.MCB.php?

    Nope, still nothing.

    A remote HTTP request eh? How about if the server I use has Apache2 with Nginx as caching server in front?

    I’ve just tried commenting line 92 in the file you mentioned but it didn’t change anything.

    And to martsgirl; yes, thank you for the code sample. I use the same syntax and code, outside of the loop, but nothing shows for me.

    Plugin Author Trendwerk


    Actually, it registers which content blocks are used when you visit a page in the front end. But maybe they’re not registered, because it wasn’t visited. That’s why the HTTP request (using wp_remote_get, is made to visit it.

    Are you able to debug where the problem lies, since I cannot reproduce it myself?

    I’d appreciate it if you could post your findings to Git:

    Plugin Author Trendwerk


    By the way, when you uncommented that line, did you try to visit the page in the front-end? Maybe that will help..

    There is progress.

    After I have uncommented line 92, I did not get a result immediately, as I mentioned in my earlier post.

    However, as you have just pointed out, I had to visit the page first to get it to trigger the creation of the extra content block. That worked and I then had “It Still Does Nothing” content block visible in the back end. Please note that I had already tried this before commenting out the line 92 – I just didn’t do it after I had commented out that line. Sorry about that.

    I then changed the title of the block from “It Still Does Nothing” to “blargh” and got an extra second block. The original block added previously wasn’t removed from the back-end. So then I had “It Still Does Nothing” and “blargh”. When I changed the title again, to “shitzooi”, I now had a total of 3 extra content blocks: “It Still Does Nothing”, “blargh” and “shitzooi” even though I had only this one line:

    <?php the_block('shitzooi'); ?>

    When I removed the comment from the line 92 of class.MCB.php file, all those three content blocks disappeared from the back end and I was back to square 1: no extra content blocks visible in the back-end at all, not even “shitzooi”.

    I am capable of writing some PHP code but I do not know how to debug this. If you give me some instructions on what to try I’ll give it a go. I now have a working solution for now at least, so I’m happy with that, but I’d still like it to be able to work 100%.

    Plugin Author Trendwerk


    Thanks for your work on this!

    This says enough, someone else is having this problem too. Line 92 and 93 are just removing and reinitializing which content blocks there are on a certain page. Line 92 removes the old ones and 93 makes the HTTP request to check for new ones. When line 92 doesn’t work, nothing works. So I’ll catch that error in the next version (which will be out real soon).

    The temporary fix is to place all the blocks you need and comment line 92 out. Thanks again for your help!

    Plugin Author Trendwerk


    The fix has just been committed. Couldn’t really test it, so I hope it works. Please let me know!

    I am willing to test it but not willing to lose my data. When the fields disappear, and I later am able to bring them back with the exact same names, will the contents still be there?

    Plugin Author Trendwerk


    Yeah, the content is stored in different meta keys. This shouldn’t be a problem if you’ve already updated to 3.0 (versions before that were stored differenly, so your data had to be migrated).

    But I would always recommend to back-up before updating a plugin, especially one with valuable content like this one!

    Backups? I like to live dangerously. I will trust in you and do the update now. If it explodes, I have only myself to blame.

    I am sorry, but there were no explosions.

    I have added the_block(‘Of Cheese’); in the code, and nothing happened while I stayed in the back end. When I went to the front end, it added the block ‘Of Cheese’ in the back end, as it should.

    Same thing with removing the code – it only updates when visiting the page in the front end. So it seems all is working well now.

    Thanks for the update and a wonderful addition to WordPress.

    Plugin Author Trendwerk


    I’m glad it worked. Thanks for testing it so thoroughly!

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘can't get it to work’ is closed to new replies.