
<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>WordPress Customizer Archives - TECHNIG</title>
	<atom:link href="https://www.technig.com/tag/wordpress-customizer/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.technig.com/tag/wordpress-customizer/</link>
	<description>Gateway for IT Experts and Tech Geeks</description>
	<lastBuildDate>Mon, 16 May 2016 16:30:52 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.6.2</generator>

<image>
	<url>https://www.technig.com/wp-content/uploads/2020/04/32x32.png</url>
	<title>WordPress Customizer Archives - TECHNIG</title>
	<link>https://www.technig.com/tag/wordpress-customizer/</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">162720667</site>	<item>
		<title>How to Make a Complete Theme Options with Kirki Customizer?</title>
		<link>https://www.technig.com/complete-wordpress-theme-options-kirki-customizer/</link>
					<comments>https://www.technig.com/complete-wordpress-theme-options-kirki-customizer/#comments</comments>
		
		<dc:creator><![CDATA[Hujatulla Asghari]]></dc:creator>
		<pubDate>Mon, 16 May 2016 16:30:52 +0000</pubDate>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[web developement]]></category>
		<category><![CDATA[WordPress Customizer]]></category>
		<category><![CDATA[WordPress Developer]]></category>
		<guid isPermaLink="false">https://www.technig.com/?p=7449</guid>

					<description><![CDATA[<div style="margin-bottom:20px;"></div>
<p>In the previous tutorials we have learned how to configure and set some basic options with kirki customizer. In this tutorial we will learn how to create a complete WordPress theme options with this amazing customizer plugin. At the end of this tutorial, you will be able to customize or make your own complete WordPress [&#8230;]</p>
<p>The post <a href="https://www.technig.com/complete-wordpress-theme-options-kirki-customizer/">How to Make a Complete Theme Options with Kirki Customizer?</a> appeared first on <a href="https://www.technig.com">TECHNIG</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div style="margin-bottom:20px;"></div><p>In the <a href="https://www.technig.com/wordpress-customizer-kirki-adding-options/">previous</a> tutorials we have learned how to configure and set some basic options with kirki customizer. In this tutorial we will learn how to create a complete WordPress theme options with this amazing customizer plugin. At the end of this tutorial, you will be able to customize or make your own complete WordPress theme options from scratch.</p>
<h2>Requirements</h2>
<p>This tutorial for WordPress theme developers, If you are not a developer, this tutorial is not for you. We assume you know the basic knowledge of working with WordPress kirki customizer, if you don&#8217;t, so please read the <a href="https://www.technig.com/use-kirki-wordpress-theme-customizer/">previous </a>articles and introduction tutorials. Than come back and start creating a complete WordPress theme options. We will not go through installation and configuration of this plugin because we already did those things in previous articles. If you faced any problem, check the <a href="https://www.technig.com/use-kirki-wordpress-theme-customizer/">part one</a> of this tutorials.</p>
<h3>Step 1</h3>
<p>Here is how we can include and configure this plugin in basic way.</p>
<pre class="theme:sublime-text lang:php decode:true ">include_once( dirname( __FILE__ ) . '/inc/plugins/kirki/kirki.php' );

function mytheme_kirki_configuration() {
    return array( 'url_path'     =&gt; get_stylesheet_directory_uri() . '/inc/plugins/kirki/' );
}
add_filter( 'kirki/config', 'mytheme_kirki_configuration' );</pre>
<h3>Step 2</h3>
<p>Now we must add the panels and sections. To do that, first we create a function to wrap all panels and sections. For our example, we make one panel named, &#8221; Theme Options&#8221;. Inside this panel, we create sections.</p>
<pre class="theme:sublime-text lang:php decode:true ">function up_kirki_section( $wp_customize ) {
	/**
	 * Add panels
	 */
	$wp_customize-&gt;add_panel( 'up_theme_options', array(
		'priority'    =&gt; 10,
		'title'       =&gt; __( 'Theme Options', 'upplanet' ),
	) );

	/**
	 * Add sections
	 */
     $wp_customize-&gt;add_section( 'general_options', array(
 		'title'       =&gt; __( 'General Options', 'upplanet' ),
 		'priority'    =&gt; 10,
 		'panel'       =&gt; 'up_theme_options',
 	) );

     $wp_customize-&gt;add_section( 'header_options', array(
 		'title'       =&gt; __( 'Header Options', 'upplanet' ),
 		'priority'    =&gt; 20,
 		'panel'       =&gt; 'up_theme_options',
 	) );

    $wp_customize-&gt;add_section('layout_options',array(
    	'title' 	 =&gt; __('Layouts Options','upplanet'),
    	'priority' 	 =&gt; 30,
    	'panel' 	 =&gt; 'up_theme_options',

    	));

    $wp_customize-&gt;add_section('slide_options',array(
    	'title' 	 =&gt; __('Slide Options','upplanet'),
    	'priority' 	 =&gt; 30,
    	'panel' 	 =&gt; 'up_theme_options',

    	));

    $wp_customize-&gt;add_section('page_options',array(
    	'title' 	 =&gt; __('Page Options','upplanet'),
    	'priority' 	 =&gt; 30,
    	'panel' 	 =&gt; 'up_theme_options',

    	));

    $wp_customize-&gt;add_section('single_options',array(
    	'title' 	 =&gt; __('Single Page','upplanet'),
    	'priority' 	 =&gt; 40,
    	'panel' 	 =&gt; 'up_theme_options',

    	));

    $wp_customize-&gt;add_section('footer_options',array(
    	'title' 	 =&gt; __('Footer Options','upplanet'),
    	'priority' 	 =&gt; 50,
    	'panel' 	 =&gt; 'up_theme_options',

    	));


}
add_action( 'customize_register', 'up_kirki_section' );</pre>
<p>We append each section we create to up_theme_options panel. Until now, you might not see anything in the WordPress customizer page. It will show-up when we add the fields and options. The last line will hook the panels to customize_register. Now we have almost a complete WordPress theme options. Let&#8217;s add options and fields.</p>
<h3>Step 3</h3>
<p>It&#8217;s up to you, what you need and what you want to add in your theme options. We will add one fields for each section just to show you the example. Than you can customize it for your own theme. To add fields, we need to create a new function and hook it to kirki/fields.</p>
<p>Here is a basic example. let&#8217;s add a favicon uploader fields in general section.</p>
<pre class="theme:sublime-text lang:php decode:true">function up_kirki_fields( $wp_customize ) {

 /*General Options*/
    $fields[] = array(
	'type'        =&gt; 'image',
	'settings'    =&gt; 'fav_icon',
	'label'       =&gt; __( 'Favicon', 'upplanet' ),
	'description' =&gt; __( 'Upload your site favicon here', 'upplanet' ),
	'section'     =&gt; 'general_options',
	'default'     =&gt; '',
	'priority'    =&gt; 10,
);

    return $fields;
}

add_filter( 'kirki/fields', 'up_kirki_fields' );
</pre>
<p><span style="background-color: #d4d4d4"><em>$fields[]</em> </span>is an array that will contain all the fields for all sections. And at the end of function, we return the <em>$fields. </em></p>
<p>the last line will hook the up_kirki_fields function to kirki fields.</p>
<h3>Step 4</h3>
<p>Let&#8217;s add one field for each section we have created. We will use different input types to show you how we can use them. After that we will write the complete WordPress theme options code.</p>
<p>Here is the complete code for fields function.</p>
<pre class="theme:sublime-text lang:php decode:true">function up_kirki_fields( $wp_customize ) {

	/*General Options*/

    $fields[] = array(
	'type'        =&gt; 'image',
	'settings'    =&gt; 'fav_icon',
	'label'       =&gt; __( 'Favicon', 'upplanet' ),
	'description' =&gt; __( 'Upload your site favicon here', 'upplanet' ),
	'section'     =&gt; 'general_options',
	'default'     =&gt; '',
	'priority'    =&gt; 10,
);


    // Header Options

	$fields[] = array(
	    'type'        =&gt; 'radio-image',
	    'setting'     =&gt; 'header_hero',
	    'label'       =&gt; __( 'Choose to show slide or text in header', 'upplanet' ),
	    'section'     =&gt; 'header_options',
	    'default'     =&gt; 'slide',
	    'priority'    =&gt; 10,
	    'choices'     =&gt; array(
	      'slide' =&gt; trailingslashit( get_template_directory_uri() ) . 'images/header-slide.png',
	      'text' =&gt; trailingslashit( get_template_directory_uri() ) . 'images/header-text.png',
	    ),
	);


	// Layouts Options

    $fields[] = array(
        'type'        =&gt; 'radio-image',
        'setting'     =&gt; 'up_layout',
        'label'       =&gt; __( 'Site Layout', 'upplanet' ),
        'description' =&gt; __( 'Decide which layout you want for your site', 'upplanet' ),
        'section'     =&gt; 'layout_options',
        'default'     =&gt; 'sidebar-right',
        'priority'    =&gt; 10,
        'choices'     =&gt; array(
          'sidebar-right' =&gt; trailingslashit( get_template_directory_uri() ) . 'images/layout-right-side.png',
          'sidebar-left' =&gt; trailingslashit( get_template_directory_uri() ) . 'images/layout-left-side.png',
          'right-left' =&gt; trailingslashit( get_template_directory_uri() ) . 'images/right-left-side.png',
        ),
    );



	// Slide Options


    $fields[] = array(
		'type'        =&gt; 'radio',
		'settings'    =&gt; 'slide_query',
		'label'       =&gt; __( 'What to Query in Slide', 'upplanet' ),
		'section'     =&gt; 'slide_options',
		'default'     =&gt; 'recent-posts',
		'priority'    =&gt; 10,
		'choices'     =&gt; array(
			'most-commented'   =&gt; esc_attr__( 'Query most commented posts', 'upplanet' ),
			'recent-posts' =&gt; esc_attr__( 'Query most recent posts', 'upplanet' ),
		),
    	);


	/*Page Options*/

    $fields[] = array(
		'type'        =&gt; 'slider',
		'settings'    =&gt; 'page_hero',
		'label'       =&gt; esc_attr__( 'Page Header Hieght', 'upplanet' ),
		'section'     =&gt; 'page_options',
		'default'     =&gt; 120,
		'choices'     =&gt; array(
			'min'  =&gt; '100',
			'max'  =&gt; '400',
			'step' =&gt; '1',
		),
	);

	/*Single Post*/

 	$fields[] = array(
 		'type'        =&gt; 'checkbox',
		'settings'    =&gt; 'show_single_social',
		'label'       =&gt; __( 'Show Social Share', 'upplanet' ),
		'section'     =&gt; 'single_options',
		'default'     =&gt; '1',
		'priority'    =&gt; 10,
 		);


 	// Footer Options

    $fields[] = array(
		'type'     =&gt; 'textarea',
		'settings' =&gt; 'copy_right',
		'label'    =&gt; __( 'Footer Copyright Note', 'upplanet' ),
		'section'  =&gt; 'footer_options',
		'default'  =&gt; esc_attr__( 'Theme By &lt;a href="http://www.upplanet.com"&gt;Upplanet &lt;/a&gt;', 'upplanet' ),
		'priority' =&gt; 10,
		'sanitize_callback' =&gt; 'do_not_filter_anything',

	);

    return $fields;
}

add_filter( 'kirki/fields', 'up_kirki_fields' );</pre>
<h2>Complete WordPress Theme Options</h2>
<p>To wrap-up the complete WordPress theme options tutorial, let&#8217;s write the complete code snippet.</p>
<pre class="theme:sublime-text lang:php decode:true ">function do_not_filter_anything( $value ) {
	return $value;
}

include_once( dirname( __FILE__ ) . '/inc/plugins/kirki/kirki.php' );

function mytheme_kirki_configuration() {
    return array( 'url_path'     =&gt; get_stylesheet_directory_uri() . '/inc/plugins/kirki/' );
}
add_filter( 'kirki/config', 'mytheme_kirki_configuration' );


function up_kirki_section( $wp_customize ) {
	/**
	 * Add panels
	 */
	$wp_customize-&gt;add_panel( 'up_theme_options', array(
		'priority'    =&gt; 10,
		'title'       =&gt; __( 'Theme Options', 'upplanet' ),
	) );

	/**
	 * Add sections
	 */
     $wp_customize-&gt;add_section( 'general_options', array(
 		'title'       =&gt; __( 'General Options', 'upplanet' ),
 		'priority'    =&gt; 10,
 		'panel'       =&gt; 'up_theme_options',
 	) );

     $wp_customize-&gt;add_section( 'header_options', array(
 		'title'       =&gt; __( 'Header Options', 'upplanet' ),
 		'priority'    =&gt; 20,
 		'panel'       =&gt; 'up_theme_options',
 	) );

    $wp_customize-&gt;add_section('layout_options',array(
    	'title' 	 =&gt; __('Layouts Options','upplanet'),
    	'priority' 	 =&gt; 30,
    	'panel' 	 =&gt; 'up_theme_options',

    	));

    $wp_customize-&gt;add_section('slide_options',array(
    	'title' 	 =&gt; __('Slide Options','upplanet'),
    	'priority' 	 =&gt; 30,
    	'panel' 	 =&gt; 'up_theme_options',

    	));

    $wp_customize-&gt;add_section('page_options',array(
    	'title' 	 =&gt; __('Page Options','upplanet'),
    	'priority' 	 =&gt; 30,
    	'panel' 	 =&gt; 'up_theme_options',

    	));

    $wp_customize-&gt;add_section('single_options',array(
    	'title' 	 =&gt; __('Single Page','upplanet'),
    	'priority' 	 =&gt; 40,
    	'panel' 	 =&gt; 'up_theme_options',

    	));

    $wp_customize-&gt;add_section('footer_options',array(
    	'title' 	 =&gt; __('Footer Options','upplanet'),
    	'priority' 	 =&gt; 50,
    	'panel' 	 =&gt; 'up_theme_options',

    	));


}
add_action( 'customize_register', 'up_kirki_section' );


function up_kirki_fields( $wp_customize ) {

	/*General Options*/

    $fields[] = array(
	'type'        =&gt; 'image',
	'settings'    =&gt; 'fav_icon',
	'label'       =&gt; __( 'Favicon', 'upplanet' ),
	'description' =&gt; __( 'Upload your site favicon here', 'upplanet' ),
	'section'     =&gt; 'general_options',
	'default'     =&gt; '',
	'priority'    =&gt; 10,
);


    // Header Options

	$fields[] = array(
	    'type'        =&gt; 'radio-image',
	    'setting'     =&gt; 'header_hero',
	    'label'       =&gt; __( 'Choose to show slide or text in header', 'upplanet' ),
	    'section'     =&gt; 'header_options',
	    'default'     =&gt; 'slide',
	    'priority'    =&gt; 10,
	    'choices'     =&gt; array(
	      'slide' =&gt; trailingslashit( get_template_directory_uri() ) . 'images/header-slide.png',
	      'text' =&gt; trailingslashit( get_template_directory_uri() ) . 'images/header-text.png',
	    ),
	);


	// Layouts Options

    $fields[] = array(
        'type'        =&gt; 'radio-image',
        'setting'     =&gt; 'up_layout',
        'label'       =&gt; __( 'Site Layout', 'upplanet' ),
        'description' =&gt; __( 'Decide which layout you want for your site', 'upplanet' ),
        'section'     =&gt; 'layout_options',
        'default'     =&gt; 'sidebar-right',
        'priority'    =&gt; 10,
        'choices'     =&gt; array(
          'sidebar-right' =&gt; trailingslashit( get_template_directory_uri() ) . 'images/layout-right-side.png',
          'sidebar-left' =&gt; trailingslashit( get_template_directory_uri() ) . 'images/layout-left-side.png',
          'right-left' =&gt; trailingslashit( get_template_directory_uri() ) . 'images/right-left-side.png',
        ),
    );



	// Slide Options


    $fields[] = array(
		'type'        =&gt; 'radio',
		'settings'    =&gt; 'slide_query',
		'label'       =&gt; __( 'What to Query in Slide', 'upplanet' ),
		'section'     =&gt; 'slide_options',
		'default'     =&gt; 'recent-posts',
		'priority'    =&gt; 10,
		'choices'     =&gt; array(
			'most-commented'   =&gt; esc_attr__( 'Query most commented posts', 'upplanet' ),
			'recent-posts' =&gt; esc_attr__( 'Query most recent posts', 'upplanet' ),
		),
    	);


	/*Page Options*/

    $fields[] = array(
		'type'        =&gt; 'slider',
		'settings'    =&gt; 'page_hero',
		'label'       =&gt; esc_attr__( 'Page Header Hieght', 'upplanet' ),
		'section'     =&gt; 'page_options',
		'default'     =&gt; 120,
		'choices'     =&gt; array(
			'min'  =&gt; '100',
			'max'  =&gt; '400',
			'step' =&gt; '1',
		),
	);

	/*Single Post*/

 	$fields[] = array(
 		'type'        =&gt; 'checkbox',
		'settings'    =&gt; 'show_single_social',
		'label'       =&gt; __( 'Show Social Share', 'upplanet' ),
		'section'     =&gt; 'single_options',
		'default'     =&gt; '1',
		'priority'    =&gt; 10,
 		);


 	// Footer Options

    $fields[] = array(
		'type'     =&gt; 'textarea',
		'settings' =&gt; 'copy_right',
		'label'    =&gt; __( 'Footer Copyright Note', 'upplanet' ),
		'section'  =&gt; 'footer_options',
		'default'  =&gt; esc_attr__( 'Theme By &lt;a href="http://www.upplanet.com"&gt;Upplanet &lt;/a&gt;', 'upplanet' ),
		'priority' =&gt; 10,
		'sanitize_callback' =&gt; 'do_not_filter_anything',

	);

    return $fields;
}

add_filter( 'kirki/fields', 'up_kirki_fields' );</pre>
<p>We have added some more line to complete WordPress theme options.</p>
<pre class="theme:sublime-text lang:php decode:true">do_not_filter_anything</pre>
<p>If you don&#8217;t want any field to filter through html special char you can add this callback. Though it&#8217;s not a complete WordPress theme options, if you change and add a little more options, you can make it a complete WordPress theme options for your own.</p>
<h3>How to use the value.</h3>
<p>It&#8217;s pretty simple. Every field we create has a settings identifier, just echo it where you want to display or use the option value.</p>
<pre class="theme:sublime-text lang:php decode:true ">echo get_theme_mod('setting_identifier');</pre>
<h2>Conclusion.</h2>
<p>I hope, it help you make your next complete WordPress theme options settings. If you want to know more about kirki, I recommend join the github issues about this powerful plugin. If you have any questions or problem, feel free to ask it bellow.</p>
<p>The post <a href="https://www.technig.com/complete-wordpress-theme-options-kirki-customizer/">How to Make a Complete Theme Options with Kirki Customizer?</a> appeared first on <a href="https://www.technig.com">TECHNIG</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.technig.com/complete-wordpress-theme-options-kirki-customizer/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">7449</post-id>	</item>
		<item>
		<title>Adding more Options to WordPress Customizer with Kirki</title>
		<link>https://www.technig.com/wordpress-customizer-kirki-adding-options/</link>
					<comments>https://www.technig.com/wordpress-customizer-kirki-adding-options/#respond</comments>
		
		<dc:creator><![CDATA[Hujatulla Asghari]]></dc:creator>
		<pubDate>Tue, 26 Apr 2016 05:30:02 +0000</pubDate>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Coding Tips]]></category>
		<category><![CDATA[WordPress Customizer]]></category>
		<category><![CDATA[WordPress Developer]]></category>
		<category><![CDATA[WordPress Tips]]></category>
		<category><![CDATA[WordPress tutorial]]></category>
		<guid isPermaLink="false">https://www.technig.com/?p=7111</guid>

					<description><![CDATA[<div style="margin-bottom:20px;"></div>
<p>In previous tutorial, you have learn how to add and configure the WordPress Kirki customizer. In this tutorial we will continue on by learning how to add panel, section sections and control to our WordPress customizer. If you have came to this tutorial directly, I recommend to read the previous tutorial first. &#160; If you [&#8230;]</p>
<p>The post <a href="https://www.technig.com/wordpress-customizer-kirki-adding-options/">Adding more Options to WordPress Customizer with Kirki</a> appeared first on <a href="https://www.technig.com">TECHNIG</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div style="margin-bottom:20px;"></div><p>In previous tutorial, you have learn how to add and configure the WordPress Kirki customizer. In this tutorial we will continue on by learning how to add panel, section sections and control to our WordPress customizer. If you have came to this tutorial directly, I recommend to read the <a href="https://www.technig.com/use-kirki-wordpress-theme-customizer/" target="_blank" rel="noopener noreferrer">previous</a> tutorial first.</p>
<p>&nbsp;</p>
<figure id="attachment_7113" aria-describedby="caption-attachment-7113" style="width: 992px" class="wp-caption aligncenter"><a href="https://www.technig.com/wp-content/uploads/2016/04/WordPress-Kirki-Customizer.png"><img fetchpriority="high" decoding="async" class="size-full wp-image-7113" src="https://www.technig.com/wp-content/uploads/2016/04/WordPress-Kirki-Customizer.png" alt="WordPress Kirki Customizer" width="992" height="554" /></a><figcaption id="caption-attachment-7113" class="wp-caption-text">WordPress Kirki Customizer</figcaption></figure>
<p>If you look at the above picture, you will understand the concept of a panel, section, settings and controls better. The first thing you will need to do is to create a panel. After creating the panel, you can add section and hook them inside that panel. Inside sections, you can add control or section or maybe to say it clearly, adding fields options.</p>
<h2>Creating Panel in WordPress Kirki Customizer</h2>
<p>So, let&#8217;s start adding our first line of code and make a panel in WordPress theme Customizer. To do that, all you need is to write an function and inside that function add your panel using<span style="background-color: #c4c4c4;"> add_panel()</span> function.</p>
<p>Example:</p>
<pre class="theme:sublime-text lang:php decode:true ">function technig_options( $wp_customize ) {
	/**
	 * Add panels
	 */
	$wp_customize-&gt;add_panel( 'technig_theme_options', array(
		'priority'    =&gt; 10,
		'title'       =&gt; __( 'Theme Options', 'technig' ),
	) );
}</pre>
<p>Now, inside technig_options() function, we can add our panel and sections. You can add as many panel as you want. But before that, we should hook this function to WordPress<span style="background-color: #c4c4c4;"> customize_register()</span> function.</p>
<p>Here is how you do that.</p>
<pre class="theme:sublime-text lang:php decode:true ">add_action( 'customize_register', 'technig_options' );
</pre>
<p>Until now, if you check the WordPress Customizer, you will see nothing. It&#8217;s because, WordPress will show the panel if there is no section hooked to that. In the same way it will show the section if their is no setting hook in to it. So let&#8217;s add the section and hook it as well.</p>
<p>&nbsp;</p>
<p><em><strong>First, Create the section</strong></em>. Inside <span style="background-color: #c2c2c2;">teching_options()</span> function add the following code for adding a general option section.</p>
<pre class="theme:sublime-text lang:php decode:true">	/**
	 * Add sections
	 */
       $wp_customize-&gt;add_section( 'general_options', array(
 		'title'       =&gt; __( 'General Options', 'technig' ),
 		'priority'    =&gt; 10,
 		'panel'       =&gt; 'technig_theme_options',
 	) );
</pre>
<p><em><strong>Secondly</strong></em>, create a function for fields and hook it into general options section. For this example, will use image uploader to upload a favicon and than use it in our site.</p>
<pre class="theme:sublime-text lang:php decode:true">function technig_fields( $wp_customize ) {

   /*General Options*/
    $fields[] = array(
	'type'        =&gt; 'image',
	'settings'    =&gt; 'fav_icon',
	'label'       =&gt; __( 'Favicon', 'technig' ),
	'description' =&gt; __( 'Upload your site favicon here', 'technig' ),
	'section'     =&gt; 'general_options',
	'default'     =&gt; '',
	'priority'    =&gt; 10,
);

    return $fields;
}

add_filter( 'kirki/fields', 'technig_fields' );</pre>
<p>Now, check the WordPress Customizer, you have successfully add the first panel, section and fields with WordPress Kirki customizer. It will look like this.</p>
<figure id="attachment_7119" aria-describedby="caption-attachment-7119" style="width: 794px" class="wp-caption aligncenter"><a href="https://www.technig.com/wp-content/uploads/2016/04/WordPress-Kirki-Customizer.jpg"><img decoding="async" class="size-full wp-image-7119" src="https://www.technig.com/wp-content/uploads/2016/04/WordPress-Kirki-Customizer.jpg" alt="WordPress Kirki Customizer" width="794" height="451" /></a><figcaption id="caption-attachment-7119" class="wp-caption-text">WordPress Kirki Customizer</figcaption></figure>
<h2>How to Use the Value?</h2>
<p>Now, you can use get_theme_mod() function to display the value of the field anywhere in your theme. For our demo, which is favicon, we will use it as favicon in the header of our site.</p>
<p>Example :</p>
<pre class="theme:sublime-text lang:xhtml decode:true">&lt;link rel="shortcut icon" href="&lt;?php echo get_theme_mod('fav_icon'); ?&gt;" /&gt;
</pre>
<p>&nbsp;</p>
<h2>Conclusion.</h2>
<p>This was the part two of the WordPress Kirki Customizer. We have successfully created our theme option panel with section, settings and fields inside. In the next part will discuss about more fields like radio, radio-image, checkbox, textrea and more. We will also discuss about conditional statements and default values in Kirki. I hope it has been informative for you. If you have any types of questions related to this topic, feel free to comment it below. 🙂</p>
<p>The post <a href="https://www.technig.com/wordpress-customizer-kirki-adding-options/">Adding more Options to WordPress Customizer with Kirki</a> appeared first on <a href="https://www.technig.com">TECHNIG</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.technig.com/wordpress-customizer-kirki-adding-options/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">7111</post-id>	</item>
	</channel>
</rss>
