Support » Plugin: AMP for WP - Accelerated Mobile Pages » Conditionals IF NOT > RETURN issue

  • 1. design3, featured-image.php – first div is before conditional, when is featured not set, then in code is only this orphan open div.

    2. bad RETURN, very bad …it’s a bit hard to use, so it’s better not to use too much.
    Well, some bad return make my footer disappear on homepage.
    -bad used in frontpage.php files:

    if ( !comments_open() ) {
     return;
    }

    This return not only prevent add comment button, but stop executing rest code.

    Simple demonstration: http://sandbox.onlinephpfunctions.com/code/3e5fb40ad9c8813bdb14fdae197fb7b00a1be903

    Probably in other places, similar used causes the loss of some code, such as closing tags.

    • This topic was modified 4 years, 6 months ago by infokurs.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Conditionals IF NOT > RETURN issue’ is closed to new replies.