• Resolved kenmcmahon

    (@kenmcmahon)


    Hi,

    First, thanks for an excellent plug-in! My title attribute text isn’t appearing as a placeholder in the search field, so I’m guessing My template isn’t HTML5. I’ve seen a couple of related posts and I’ve read the documentation re hooks, but it’s a bit advanced for my very limited programming knowledge. Any chance you could give me an idiots guide?

    Thanks

    Ken

    https://wordpress.org/plugins/bop-search-box-item-type-for-nav-menus/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author joe_bopper

    (@joe_bopper)

    Hi Ken,

    Thanks for complimenting the plugin, it is very nice to see.

    It is less complicated than you might expect to make your theme support html5.

    If you are using a third party theme from the wordpress repo (i.e. one that gets updated), you ought to make a child theme to introduce your upcoming changes in order to avoid them being deleted by updates. A guide to making child themes can be found here. Alternatively you could add the upcoming code to your own plugin (potentially a little easier – add a file to wp-content/plugins and start it with:

    <?php
    /*
    Plugin Name: MY PLUGIN'S NAME
    */

    and then treat it the same as a theme’s functions.php).

    You can add theme support for html5 by adding the following code to your theme’s (or child theme or plugin) functions file found at wp-content/themes/YOUR-THEME/functions.php:

    add_action( 'after_setup_theme', function(){
        add_theme_support( 'html5', array( 'search-form' ) );
    } );

    You need only to copy this into the bottom of the file. This’ll only add html5 theme support to search forms, for more info on adding theme support, look here.

    That should be it. Let me know if you have any trouble.

    Cheers,
    Joe

    P.S. I’m marking this topic as resolved as this is a theme issue rather than one with this plugin.

    Thread Starter kenmcmahon

    (@kenmcmahon)

    Thanks Joe, that worked a treat!

    Ken.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘placholder in non HTML5 template’ is closed to new replies.