WordPress.org

Ready to get started?Download WordPress

Forums

Multiple content blocks
Can't activate the blocks on a per template basis. (4 posts)

  1. asecondwill
    Member
    Posted 3 years ago #

    When placing the code:

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

    in page-home.php so that the home page will have an extra wysiwyg to edit, no extra content area appears. error message: "There are no content blocks in this template."

    This happens even if the home page is not selected as the sites front page.

    This is a deal breaker for us - we need to be able to specify which page templates get extra fields.

    This is broken right? The expected behaviour is for the template for the page to trigger the blocks?

  2. MarbleCake
    Member
    Posted 3 years ago #

    OK, so you added the code to your custom template.

    Then for your home page in WP-Admin, you change the template to the one with the the_block tag.

    Hit update and you should get an additional editor box appear.

    Put your additional content in that box and hit update again.

    Now view that page on your site.

    Still not working?

    Have you got multiple declarations of the_block? Have you made sure they all use unique names? Try changing the blockname to something other than the default.

    It mind sound dumb but you've got the the_block tab within the loop right?

  3. REKopacz
    Member
    Posted 3 years ago #

    I am having a similar problem. I love the idea of this plugin but it is poorly documented. I keep getting 404 errors when I try to go to the documentation page. Now I read that it isn't enough to have a template like page-home.php, you have to select the template the page has to use in the admin window? Then what's the point of using the page-[slug].php configuration?

    Anybody know where I can get some complete documentation on this?

  4. dsburdette
    Member
    Posted 3 years ago #

    Perhaps I'm missing something but I'm finding that this plugin does not work when you are using Templates defined by the slug name (i.e. page-home.php) which I like to do. It appears you have to specifically define the page-home.php as a template file and then select it as such from the Template drop-down menu in the Edit page area.

    Not that I find this a big deal or crazy work-around but it was a huge missing piece of documentation. And perhaps I should be developing this way anyway in case I every alter a slug name and have it lose connection with the template.

    Again, maybe I overlooked this caveat somewhere in the documentation but otherwise this plug-in seems to be working very well for me. Hope this enlightens anyone else having similar difficulties or misunderstandings.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic