如何在自定义帖子中添加wordpress自定义seciton

如何创建该选项, 请在我的自定义主题上看到此图像?我可以使用自定义帖子来制作主题, 但是我想使网站类似于该图片。谢谢。


#1


图像中显示的项目是”定制程序部分”, 并通过定制程序API添加。你将使用类似这样的代码来添加一个部分。注意:你还需要添加设置和控件。

<?php
function mytheme_customize_register( $wp_customize ) {
    //All our sections, settings, and controls will be added here
    $wp_customize->add_section( 'mytheme_new_section_slider' , array(
        'title'      => __( 'Slider Settings', 'mytheme' ), 'priority'   => 30, ) );
    // you would also have settings and controls that are added to the section.
    // if you add a section and it contains no controls it will not appear.
}
add_action( 'customize_register', 'mytheme_customize_register' );

这是有关add_section方法的一些文档:https://codex.wordpress.org/Class_Reference/WP_Customize_Manager/add_section

以及有关整个过程的一些信息, 包括添加设置和控件:https://codex.wordpress.org/Theme_Customization_API

来源:

https://www.srcmini02.com/65248.html

微信公众号
手机浏览(小程序)

Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(): Failed to enable crypto in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_41027.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
0
分享到:
没有账号? 忘记密码?