Home > CMS Tutorial > WordPress > body text

Can wordpress use html5?

藏色散人
Release: 2019-07-26 10:17:44
Original
5058 people have browsed it

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');
Copy after login

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
Copy after login

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'
    ) );
}
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template