• I inherited this WP site from another developer and have created a local version using XAMPP to test running updates and making changes on.

    After successfully updating from 2.9.2 to 3.4.2 I am getting the following error when I try and load child product pages (e.g. http://3blindmiceusa.com/products/motorization/) using a custom product-template.php file (http://pastebin.com/LuhmtDge)

    Parse error: syntax error, unexpected T_ENDWHILE in C:\xampp\htdocs\3blindmice_new\wp-content\themes\3blindmice\template_products.php on line 132.

    The live site using 2.9.2 works fine using this code (www.3blindmiceusa.com), but the developer who created this custom theme did a bunch of sketchy stuff and I really have no idea where to go now that I have tried everything else I can find about this error.

    I have gone through the code numerous times, checked all the other threads with this error code and can find no solution that applies to this case.

    I am not a PHP expert but I think it is probably something simple I am missing. Please help!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Can you post here line 132 of template_products.php, the line before and the line after?

    Thread Starter Andrew Rowland

    (@arowls)

    Hello Andrew,

    Lines 131-133 read:

    </div>
    		<?php endwhile; // end of the loop. ?>
    		<div class="navigation">

    I have pasted the entire contents of template_products.php to Pastebin as well: http://pastebin.com/LuhmtDge

    Thanks in advance!

    Thread Starter Andrew Rowland

    (@arowls)

    OK so I figured it out. It is because the code (http://pastebin.com/LuhmtDge) uses shorthand to close a bunch of tags and my local server environment wasn’t seeing them as proper PHP tags.

    SO:
    <? } ?>
    was replaced by
    <?php } ?>
    and everything works now.

    Well that was a frustrating couple hours! (I hope this thread saves someone else someday.)

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘unexpected T_ENDWHILE Error after upgrade from 2.9.2’ is closed to new replies.