• I just finished a site where I used the “Insert PHP Code Snippet” plugin in conjunction with the Elegant Themes Theme “Divi” and Advanced Custom Fields. It worked perfectly. So, I decided to use it again under the same theme/ACF plugin scenario. But for some reason this plugin is breaking the site on the front end AND the backend when I put a PHP shortcode into my page.

    Shortcode is called “[xyz-ips snippet=”phpHomeServices”]” and here is the code entered into the PHP plugin:

    if( have_rows('services_leftcolumn') ): ?>
    <ul>
    	<?php while ( have_rows('services_leftcolumn') ) : the_row();?>
    	<li><a href="<?php echo the_sub_field('service_page_link_lc'); ?>"><?php echo the_sub_field('service_name_lc'); ?></a></li>
    	<?php endwhile; ?>
    </ul>
    <?php endif;?>
    
    <?php if( have_rows('services_rightcolumn') ): ?>
    <ul>
        <?php while ( have_rows('services_rightcolumn') ) : the_row();?>
    	<li><a href="<?php echo the_sub_field('service_page_link_rc'); ?>"><?php echo the_sub_field('service_name_rc'); ?></a></li>
        <?php endwhile; ?>
    </ul>
    <?php endif;

    Even if I change the PHP code to just echo "Hello"; it breaks.

    Front End (links should be in the blue box):
    https://goo.gl/aX8n2q

    Back End:
    https://goo.gl/ZMx8eW

    https://www.ads-software.com/plugins/insert-php-code-snippet/

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘PHP Code Breaks Site’ is closed to new replies.