Support » Developing with WordPress » $_GET not working inside header.php

  • Resolved italoborges

    (@italoborges)


    Hello,

    I’m having this problem from nowhere because was working before.
    There is a blue bar where I get the query string and put inside the bar using:

    <div class="nombre-site"><? if(!empty($_GET['asearch'])) echo $_GET['asearch']; ?></div>

    Now, on localhost is working, on production not. WordPress is converting the php code above into a comment tag.

    Anyone can help me?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Steve Stern

    (@sterndata)

    WordPresser, Third Class

    You must use <?php, not <?. This is a PHP setting that’s set poorly on your localhost and correctly on your production site.

    italoborges

    (@italoborges)

    Thank you so much, Steve! It worked!!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.