WordPress如何在视图中显示skill1_logo

你好, 我是新手, 我想问一下如何在所需页面上显示skill1_logo, skill1_title, skill1_description。我正在尝试使用wordpress来练习我的wordpress来建立一个1页的网站。

    function theme_skills_customizer($wp_customize){
     //adding section in wordpress customizer
    $wp_customize->add_section('skills_settings_section', array(
      'title'          => 'Skills Section'
     ));

    $wp_customize->add_setting('skill1_logo');
    $wp_customize->add_setting('skill1_title');
    $wp_customize->add_setting('skill1_description');
    $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'skill1_logo', array(
         'label'    => __( 'Skill 1 Logo', 'themeslug' ), 'width'              => 400, 'height'             => 400, 'flex-width'         => true, 'flex-height'        => true, 'section'  => 'skills_settings_section', 'settings' => 'skill1_logo', )));
    $wp_customize->add_control( 'skill1_title', array(
      'label' => __( 'Skill 1 Title' ), 'section' => 'skills_settings_section', // Add a default or your own section
      'type' => 'text', ));
    $wp_customize->add_control( 'skill1_description', array(
      'label' => __( 'Skill 1 Description' ), 'section' => 'skills_settings_section', // Add a default or your own section
      'type' => 'textarea', ));

   }

    add_action( 'customize_register', 'theme_skills_customizer' );

#1


你可以使用get_theme_mod函数来回显这些设置。

例如

 $s_title = get_theme_mod('skill1_title');

来源:

https://www.srcmini02.com/66150.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_40617.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
0
分享到:
没有账号? 忘记密码?