Check if Gutenberg Blocks are being used in Post or Page

During development of a site for a client, they requested the site to be built using Gutenberg blocks. On import of other existing posts from a previous site (that wasn’t using blocks), we found that content was simply put into the page on import. This was fine, except the blocks we designed were fullwidth with … Continued

Redirect users to another URL by IP using PHP

Here’s a handy snippet I’ve used a few times now. I find it handy for quick redirects should you want to send all other users to another page such as a maintenance page, coming soon page or other holding page. It allows all users NOT using the IP listed to be sent elsewhere, allowing those … Continued

Check if homepage with PHP in Magento

This snippet wraps around your homepage-specific code in order to only display when on the homepage of your store. The ‘home’ identifier may be different for your site so amend as necessary.

Show content in specific category in Magento

Here’s a little snippet which allows you to enter specific content based on store category. This is handy if you want to show something on a page which belongs to just a specific category only. Likewise you can show either content A if on category and if not, show content on all other categories: