wordpress能够用html5吗
wordpress是能够用html5的,可认为WordPress开启 HTML5 支撑。WordPress 也能够经由过程在 header.php 文件增加这段代码的要领完成。或许运用 functions.php 文件也能够:
找到当前主题对应的 functions.php 文件,并增加以下代码:
function add_ie_html5_shim () { echo ''; } add_action('wp_head', 'add_ie_html5_shim');
道理是经由过程 header.php 文件中的 wp_head() 函数强行插进去。
wordpress挪用html5文件
就WP中心来讲,只须要鄙人面的HOOK
after_setup_theme
的函数内增加以下代码:
/* * 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' ) ); }
插件的HTML输出平常都是相符HTML5规范的;另外,就是主题对HTML5的支撑了,这个须要自行修正,没有什么便利的要领。
更多WordPress技术文章,请接见WordPress教程栏目!
以上就是wordpress能够用html5吗的细致内容,更多请关注ki4网别的相干文章!