• Resolved shaquilleray

    (@shaquilleray)


    Hey.

    I’m trying to embed the WordPress search box on a page, I found that I needed to use PHP so I installed the “Allow PHP on Pages and Post” plugin and added the code, however the search box doesn’t display!

    I if i don’t use the plugin the search box appears however “<?php bloginfo(‘home’)’?>/”>” appears in the search box!
    itself

    Code I am using is below

    <form method="get" id="searchform" action="<?php bloginfo('home'); ?>/">
    <div><input type="text" size="18" value="<?php echo wp_specialchars($s, 1); ?>" name="s" id="s" />
    <input type="submit" id="searchsubmit" value="Search" class="btn" />
    </div>
    </form>

    Does anyone have an idea on what I can do to embed the search box into the page?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Try:

    <form method="get" id="searchform" action="<?php echo home_url(); ?>">
    <div><input type="text" size="18" value="<?php echo esc_html($s); ?>" name="s" id="s" />
    <input type="submit" id="searchsubmit" value="Search" class="btn" />
    </div>
    </form>

    wp_specialchars is deprecated.

    Thread Starter shaquilleray

    (@shaquilleray)

    Tried it and same issue. You can see it for yourself at

    https://webmasters.dfengine.com/

    Thread Starter shaquilleray

    (@shaquilleray)

    Appears to be a issue with the Plugin. I disabled the plugin previously mentioned above and used “Exec-PHP” and the code works ??

    Issue Resolved

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Search Box’ is closed to new replies.