• The website uses the Go Theme. Many pages use the Shape Divider block from CoBlocks. Some Add-In pages, however, cannot be modified to add these blocks.

    Is there an easy way to add these to the Header and Footer php files so that they appear on every page?

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello @fivebs,

    Thanks for reaching out!

    Instead of modifying PHP files directly, an easier solution in your case would be to create a separate Blog page just like every other page on the site. Then you will be able to adjust the layout and design according to other pages. In order for the page to display posts, you can add them using various blocks ( https://ibb.co/qd6gc8z, https://ibb.co/4Mz45WZ ). The link to the newly created page should replace the current Blog page in the main menu. So instead of using the PHP Blog template from the theme, your site will use the custom-built page.

    Kindly let me know if this helps. 🙂

    Best Regards,

    Milos

    Thread Starter fivebs

    (@fivebs)

    Thank you Milos. That would indeed do the trick for the blog page but I am also trying to setup WooCommerce and there are a multitude of pages that come with that. I’d rather not have to create them all again to add a block to the header.

    Hi @fivebs,

    Thanks for your reply!

    You can also achieve the desired modifications by editing PHP files but make sure to have a child theme active first. In order to create a child theme, you can use this plugin.

    Once you have the child theme, for you to apply modifications to the Blog page you should create the archive.php file directly in the root of the child theme.

    The code that is added to the mentioned file will be displayed on the Blog page.

    Since it’s not easy to convert Gutenberg blocks into shortcodes, I suggest you create an image that would replace the current divider (the image can be based on the current look of the divider). Then you can add the image at the beginning of the archive.php page and also on other pages created by CoBlocks.

    The workflow would be the same for Woo pages, just make sure to respect their procedures for overriding templates, more info can be found here.

    I hope this helps. 🙂

    Best Regards,

    Milos

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Add a block to the top/bottom of every page automatically.’ is closed to new replies.