I'm kind of new to creating my own themes with WordPress 4.x so I hope it's not too boring.
In search.php I'm using this code:
get_search_form ()
Also, I got this code in searchform.php
<form role="search" method="get" class="search-form" action="<?php echo home_url( '/' ); ?>">
<label>
<span class="screen-reader-text"><?php echo _x( 'Search for:', 'label' ) ?></span>
<input type="search" class="search-field"
placeholder="<?php echo esc_attr_x( 'Search …', 'placeholder' ) ?>"
value="<?php echo get_search_query() ?>" name="s"
title="<?php echo esc_attr_x( 'Search for:', 'label' ) ?>" />
</label>
<input type="submit" class="search-submit"
value="<?php echo esc_attr_x( 'Search', 'submit button' ) ?>" />
</form>
If i'm getting this right, on the Wordpress Developers website, where I got the codes from... it also says to add a code with a function to support HTML5 which looks like this:
function wpdocs_after_setup_theme() {
add_theme_support( 'html5', array( 'search-form' ) );
}
add_action( 'after_setup_theme', 'wpdocs_after_setup_theme' );
Now, after testing it for a few seconds, everything looks working fine without this HTML5 support function... but I don't understand if I should add it to my functions.php file anyway?!
My code in functions.php looks like this:
function customTheme_setup() {
// Thumbnails support
add_theme_support('post-thumbnails');
}
add_action('after_setup_theme', 'customTheme_setup');
I'm using WordPress 4.4.2 and the theme is crafted from scratch. so, I don't have the code in there to support HTML5... but, since I already got a function to use after theme setup with another code for the image...
should I add the function, anyway? If so, how the code should look like, together with the function for the image support line?