- This topic has 2 replies, 1 voice, and was last updated 1 week ago by .
- You must be logged in to reply to this topic.
These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.
Tagged: Genesis Custom Blocks
I am working on setting up a custom block with Genesis Custom Blocks. I have the block front end configured and my php build out on the backend. When I go to preview the block or add it to any page I get the following error
Error loading block: The response is not a valid JSON response.
I am using the following:
Theme: Custom theme using Sage 10 Framework
- Acorn (for Sage 10)
- Genesis Custom Blocks
Below is a copy of my backend code
<div class="hero-block"> <div class="hero-block__left"> <?php if($block_field('pre-header-text')) : ?> <div class="hero-block__pre-header"> <?php $block_field('pre-header-text'); ?> </div> <?php endif; ?> <?php if($block_field('header-text')) : ?> <h1 class="hero-block__header"> <?php $block_field('header-text'); ?> </h1> <?php endif; ?> <?php if($block_field('body-text')) : ?> <p class="hero-block__body"> <?php $block_field('body-text'); ?> </p> <?php endif; ?> <?php if($block_field('call-to-action-text')) : ?> <a href="<?php $block_field('call-to-action-link'); ?>" class="hero-block__cta-link"> <?php $block_field('call-to-action-text'); ?> </a> <?php endif; ?> </div> <div class="hero-block__right"> <?php if($block_field('hero-image')) : ?> <img src="<?php $block_field('hero-image'); ?>" alt="<?php $block_field('hero-image-alt'); ?>" /> <?php endif; ?> </div> </div>
Figured it out, my PHP was bad. DOH...
Yeah, You are right I am also facing some errors while using some custom blocks on genesis theme. As I have developed a script by my developer for android apps site. But when I apply it so it shows some error. Have your found the solution. Kindly share your experience if you have found solution.
© 2022 WPEngine, Inc.