Home  >  Article  >  CMS Tutorial  >  Can wordpress use html5?

Can wordpress use html5?

藏色散人
藏色散人Original
2019-07-26 10:17:445071browse

Can wordpress use html5?

Can wordpress use html5?

Wordpress can use html5. You can enable HTML5 support for WordPress. WordPress can also do this by adding this code to the header.php file. Or you can use the functions.php file:

Find the functions.php file corresponding to the current theme and add the following code:

function add_ie_html5_shim () {
    echo '';
}
add_action('wp_head', 'add_ie_html5_shim');

The principle is through the wp_head() function in the header.php file Forced insertion.

wordpress calls html5 files

As far as WP core is concerned, you only need to add the following code in the function of HOOK

after_setup_theme

below:

/*
 * Switch default core markup for search form, comment form, and comments
 * to output valid HTML5.
 */
add_theme_support( 'html5', array(
    'search-form', 'comment-form', 'comment-list', 'gallery', 'caption'
) );
如果没有找到挂到上面HOOK的函数,需要在functions.php中添加:
add_action( 'after_setup_theme', 'suoling_net_after_theme_setup' );
function suoling_net_after_theme_setup(){
    /*
     * Switch default core markup for search form, comment form, and comments
     * to output valid HTML5.
     */
    add_theme_support( 'html5', array(
        'search-form', 'comment-form', 'comment-list', 'gallery', 'caption'
    ) );
}

The HTML output of the plug-in generally conforms to the HTML5 standard; in addition, the theme supports HTML5. This needs to be modified by yourself, and there is no convenient method.

For more WordPress technical articles, please visit the WordPress Tutorial column!

The above is the detailed content of Can wordpress use html5?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn