<?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 Archives - Codeplaners</title>
	<atom:link href="https://codeplaners.com/category/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>https://codeplaners.com/category/wordpress/</link>
	<description>Code Solution</description>
	<lastBuildDate>Wed, 01 Jan 2025 06:40:36 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.7</generator>

<image>
	<url>https://codeplaners.com/wp-content/uploads/2020/09/cropped-favicon-social-32x32.png</url>
	<title>Wordpress Archives - Codeplaners</title>
	<link>https://codeplaners.com/category/wordpress/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How To Solve XAMPP  Issue &#8220;Error: MySQL shutdown unexpectedly&#8221;?</title>
		<link>https://codeplaners.com/how-to-solve-xampp-issue-error-mysql-shutdown-unexpectedly/</link>
					<comments>https://codeplaners.com/how-to-solve-xampp-issue-error-mysql-shutdown-unexpectedly/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Sun, 20 Oct 2024 06:22:11 +0000</pubDate>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[Laravel]]></category>
		<category><![CDATA[Laravel 10]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Reacts]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[xampp]]></category>
		<guid isPermaLink="false">https://codeplaners.com/?p=1639</guid>

					<description><![CDATA[<p>This post was last updated on January 1st, 2025 at 06:40 amHi dev, Today, i show you how to solve XAMPP issue &#8220;Error: MySQL shutdown unexpectedly&#8221;?. In this article will tell you how to solve XAMPP issue &#8220;Error: MySQL shutdown unexpectedly&#8221;?. you will how to solve XAMPP issue &#8220;Error: MySQL shutdown unexpectedly&#8221;?. So, let’s follow &#8230; <a href="https://codeplaners.com/how-to-solve-xampp-issue-error-mysql-shutdown-unexpectedly/" class="more-link">Continue reading<span class="screen-reader-text"> "How To Solve XAMPP  Issue &#8220;Error: MySQL shutdown unexpectedly&#8221;?"</span></a></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/how-to-solve-xampp-issue-error-mysql-shutdown-unexpectedly/">How To Solve XAMPP  Issue &#8220;Error: MySQL shutdown unexpectedly&#8221;?</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p class="last-modified">This post was last updated on January 1st, 2025 at 06:40 am</p><p>Hi dev,</p>
<p>Today, i show you how to solve XAMPP  issue &#8220;Error: MySQL shutdown unexpectedly&#8221;?. In this article will tell you how to solve XAMPP  issue &#8220;Error: MySQL shutdown unexpectedly&#8221;?. you will how to solve XAMPP  issue &#8220;Error: MySQL shutdown unexpectedly&#8221;?. </p>
<p>So, let’s follow few steps to create example of how to solve XAMPP  issue &#8220;Error: MySQL shutdown unexpectedly&#8221;?.</p>
<p><img decoding="async" src="https://codeplaners.com/wp-content/uploads/2023/10/xampp.jpg" alt="how to solve XAMPP  issue "Error: MySQL shutdown unexpectedly"?"></p>
<h3 class="step_code">Simple solution Open shell from Xampp Control Panel and run command</h3>
<pre class="brush: xml; title: ; notranslate">
mysqld --console --skip-grant-tables --skip-external-locking
</pre>
<h3 class="step_code">Again open an other shell and run</h3>
<pre class="brush: xml; title: ; notranslate">
mysqlcheck -r --databases mysql --use-frm
</pre>
<p><strong>Now close both the shells and restart xampp.</strong></p>
<p><strong>I hope it will assist you…</strong></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/how-to-solve-xampp-issue-error-mysql-shutdown-unexpectedly/">How To Solve XAMPP  Issue &#8220;Error: MySQL shutdown unexpectedly&#8221;?</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://codeplaners.com/how-to-solve-xampp-issue-error-mysql-shutdown-unexpectedly/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to install and run multiple xampp on windows</title>
		<link>https://codeplaners.com/how-to-install-and-run-multiple-xampp-on-windows/</link>
					<comments>https://codeplaners.com/how-to-install-and-run-multiple-xampp-on-windows/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Sun, 01 Sep 2024 13:18:49 +0000</pubDate>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[Codeigniter]]></category>
		<category><![CDATA[Laravel]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[xampp]]></category>
		<guid isPermaLink="false">https://codeplaners.com/?p=397</guid>

					<description><![CDATA[<p>This post was last updated on January 1st, 2025 at 06:40 amIf some of your projects do not support PHP 7.1, you can install PHP 7.2. Without removing 7.1, Your Local Server xampp, see screenshot and install multiple xampp. 1. This link click and check your recruitment xampp php version and download. XAMPP PHP Version &#8230; <a href="https://codeplaners.com/how-to-install-and-run-multiple-xampp-on-windows/" class="more-link">Continue reading<span class="screen-reader-text"> "How to install and run multiple xampp on windows"</span></a></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/how-to-install-and-run-multiple-xampp-on-windows/">How to install and run multiple xampp on windows</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p class="last-modified">This post was last updated on January 1st, 2025 at 06:40 am</p><p>If some of your projects do not support PHP 7.1, you can install PHP 7.2. Without removing 7.1, Your Local Server xampp, see screenshot and install multiple xampp.</p>
<h2>1. This link click and check your recruitment xampp php version and download.</h2>
<p><a target="_blank" style="color: #FF5722;" href="https://sourceforge.net/projects/xampp/files/XAMPP%20Windows/" rel="noopener noreferrer">XAMPP PHP Version </a></p>
<h2>2. Start the XAMPP installation process, download the XAMPP version your needs, double-click the .exe file.</h2>
<p><img decoding="async" src="https://codeplaners.com/wp-content/uploads/2021/02/1.jpg" alt="XAMPP Installation process"></p>
<h2>3. Click next step</h2>
<p><img decoding="async" src="https://codeplaners.com/wp-content/uploads/2021/02/2.jpg" alt="XAMPP Installation process"></p>
<h2>3. Change your folder name(C:\xampp2)  </h2>
<p><img decoding="async" src="https://codeplaners.com/wp-content/uploads/2021/02/3.jpg" alt="XAMPP Installation process"></p>
<h2>4. Check your folder location two xampp folder insatll </h2>
<p><img decoding="async" src="https://codeplaners.com/wp-content/uploads/2021/02/4.jpg" alt="XAMPP Installation process"></p>
<h2>5. Run new xammp see screenshort  </h2>
<p><img decoding="async" src="https://codeplaners.com/wp-content/uploads/2021/02/5.jpg" alt="XAMPP Installation process"></p>
<h2>6. Look at the image below and the path you will keep above is the same xampp will work. </h2>

<a href='https://codeplaners.com/how-to-install-and-run-multiple-xampp-on-windows/6-2/'><img width="300" height="157" src="https://codeplaners.com/wp-content/uploads/2021/02/6-1-300x157.jpg" class="attachment-medium size-medium" alt="" decoding="async" loading="lazy" srcset="https://codeplaners.com/wp-content/uploads/2021/02/6-1-300x157.jpg 300w, https://codeplaners.com/wp-content/uploads/2021/02/6-1-1024x535.jpg 1024w, https://codeplaners.com/wp-content/uploads/2021/02/6-1-768x401.jpg 768w, https://codeplaners.com/wp-content/uploads/2021/02/6-1-1200x626.jpg 1200w, https://codeplaners.com/wp-content/uploads/2021/02/6-1.jpg 1408w" sizes="(max-width: 300px) 85vw, 300px" /></a>

<h2>7. Watch the video </h2>
<p><iframe loading="lazy" width="100%" height="315" src="https://www.youtube.com/embed/ik-prJ3qV5M" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/how-to-install-and-run-multiple-xampp-on-windows/">How to install and run multiple xampp on windows</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://codeplaners.com/how-to-install-and-run-multiple-xampp-on-windows/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How To Get post_type Data in WordPress</title>
		<link>https://codeplaners.com/how-to-get-post_type-data-in-wordpress/</link>
					<comments>https://codeplaners.com/how-to-get-post_type-data-in-wordpress/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Mon, 15 Jul 2024 00:49:20 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[postget]]></category>
		<category><![CDATA[posttypedataget]]></category>
		<guid isPermaLink="false">https://codeplaners.com/?p=1732</guid>

					<description><![CDATA[<p>Hi Dev, Today, we will show you how to get post_type data in wordpress. This article will give you simple example of how to get post_type data in wordpress. Let&#8217;s discuss how to get post_type data in wordpress. In this article, we will implement a how to get post_type data in wordpress. So let’s follow &#8230; <a href="https://codeplaners.com/how-to-get-post_type-data-in-wordpress/" class="more-link">Continue reading<span class="screen-reader-text"> "How To Get post_type Data in WordPress"</span></a></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/how-to-get-post_type-data-in-wordpress/">How To Get post_type Data in WordPress</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Hi Dev,</p>
<p>Today, we will show you how to get post_type data in wordpress. This article will give you simple example of how to get post_type data in wordpress. Let&#8217;s discuss how to get post_type data in wordpress. In this article, we will implement a how to get post_type data in wordpress.</p>
<p>So let’s follow few step to create example of how to get post_type data in wordpress.</p>
<h3 class="step_code">Step 1: All Post Data Get</h3>
<pre class="brush: php; title: ; notranslate">
&lt;?php $loop = new WP_Query( array ( 'post_type' =&gt; 'post', 'orderby' =&gt; 'post_id', 'posts_per_page' =&gt;'10') ); ?&gt;

&lt;?php while( $loop-&gt;have_posts() ): $loop-&gt;the_post(); ?&gt;

&lt;?php $url = wp_get_attachment_url( get_post_thumbnail_id($post-&gt;ID), 'full' ); ?&gt;

  &lt;article class=&quot;article_codeplaners&quot;&gt;
    &lt;div class=&quot;code_img&quot;&gt;
        &lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot;&gt;&lt;img src=&quot;&lt;?php echo $url ?&gt;&quot; alt=&quot;&quot;&gt;&lt;/a&gt;
    &lt;/div&gt;
    &lt;div class=&quot;code_cont&quot;&gt;
        &lt;h3&gt;&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h3&gt;
        &lt;span&gt;&lt;/span&gt;
    &lt;/div&gt;
&lt;/article&gt;   

&lt;?php endwhile; wp_reset_query();?&gt;
</pre>
<h3 class="step_code">Step 2: Category Wise Post Get</h3>
<pre class="brush: php; title: ; notranslate">
 &lt;?php $loop = new WP_Query( array ( 'post_type' =&gt; 'post', 'orderby' =&gt; 'post_id', 'cat' =&gt;'2', 'posts_per_page' =&gt;'10') ); ?&gt;

    &lt;?php while( $loop-&gt;have_posts() ): $loop-&gt;the_post(); ?&gt;

    &lt;?php $url = wp_get_attachment_url( get_post_thumbnail_id($post-&gt;ID), 'full' ); ?&gt;

    &lt;article class=&quot;article_codeplaners&quot;&gt;
    &lt;div class=&quot;code_img&quot;&gt;
        &lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot;&gt;&lt;img src=&quot;&lt;?php echo $url ?&gt;&quot; alt=&quot;&quot;&gt;&lt;/a&gt;
    &lt;/div&gt;
    &lt;div class=&quot;code_cont&quot;&gt;
        &lt;h3&gt;&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h3&gt;
        &lt;span&gt;&lt;/span&gt;
    &lt;/div&gt;
    &lt;/article&gt;   

    &lt;?php endwhile; wp_reset_query();?&gt;
</pre>
<h3 class="step_code">Step 3: offset Wise Post Get</h3>
<pre class="brush: php; title: ; notranslate">
&lt;?php $loop = new WP_Query( array ( 'post_type' =&gt; 'post', 'orderby' =&gt; 'post_id',  'offset' =&gt; '2','posts_per_page' =&gt;'10') ); ?&gt;
                    
    &lt;?php while( $loop-&gt;have_posts() ): $loop-&gt;the_post(); ?&gt;

    &lt;?php $url = wp_get_attachment_url( get_post_thumbnail_id($post-&gt;ID), 'full' ); ?&gt;

    &lt;article class=&quot;article_codeplaners&quot;&gt;
        &lt;div class=&quot;code_img&quot;&gt;
            &lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot;&gt;&lt;img src=&quot;&lt;?php echo $url ?&gt;&quot; alt=&quot;&quot;&gt;&lt;/a&gt;
        &lt;/div&gt;
        &lt;div class=&quot;code_cont&quot;&gt;
            &lt;h3&gt;&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h3&gt;
            &lt;span&gt;&lt;/span&gt;
        &lt;/div&gt;
    &lt;/article&gt;   

&lt;?php endwhile; wp_reset_query();?&gt;
</pre>
<p><strong>I hope it will assist you…</strong></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/how-to-get-post_type-data-in-wordpress/">How To Get post_type Data in WordPress</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://codeplaners.com/how-to-get-post_type-data-in-wordpress/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to create custom post_type and taxonomy in WordPress</title>
		<link>https://codeplaners.com/how-to-create-custom-post_type-and-taxonomy-in-wordpress/</link>
					<comments>https://codeplaners.com/how-to-create-custom-post_type-and-taxonomy-in-wordpress/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Sat, 13 Jul 2024 00:32:49 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[custompost_type]]></category>
		<category><![CDATA[taxonomy]]></category>
		<category><![CDATA[wordpress]]></category>
		<guid isPermaLink="false">https://codeplaners.com/?p=1729</guid>

					<description><![CDATA[<p>Hi Dev, Today, we will show you How to create custom post_type and taxonomy in WordPress. This article will give you simple example of How to create custom post_type and taxonomy in WordPress. Let&#8217;s discuss How to create custom post_type and taxonomy in WordPress. In this article, we will implement a How to create custom &#8230; <a href="https://codeplaners.com/how-to-create-custom-post_type-and-taxonomy-in-wordpress/" class="more-link">Continue reading<span class="screen-reader-text"> "How to create custom post_type and taxonomy in WordPress"</span></a></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/how-to-create-custom-post_type-and-taxonomy-in-wordpress/">How to create custom post_type and taxonomy in WordPress</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Hi Dev,</p>
<p>Today, we will show you How to create custom post_type and taxonomy in WordPress. This article will give you simple example of How to create custom post_type and taxonomy in WordPress. Let&#8217;s discuss How to create custom post_type and taxonomy in WordPress. In this article, we will implement a How to create custom post_type and taxonomy in WordPress.</p>
<p>So let’s follow few step to create example of How to create custom post_type and taxonomy in WordPress.</p>
<h3 class="step_code">Step 1: function.php file open and add code</h3>
<p>All you need to do is go to theme and open function.php file and copy the below code and paste it at the bottom of function.php file</p>
<pre class="brush: php; title: ; notranslate">
/****************************************
 * Add custom taxonomy for Codeplaners *
 ****************************************/
add_action('init', function() {
	register_post_type('codeplaner', &#x5B;
		'label' =&gt; __('CodePlaners', 'txtdomain'),
		'public' =&gt; true,
		'menu_position' =&gt; 5,
		'menu_icon' =&gt; 'dashicons-book',
		'supports' =&gt; &#x5B;'title', 'editor', 'thumbnail', 'author', 'revisions', 'comments'],
		'show_in_rest' =&gt; true,
		'rewrite' =&gt; &#x5B;'slug' =&gt; ''],
		'taxonomies' =&gt; &#x5B;'codeplaner_author', 'codeplaner_category'],
		'labels' =&gt; &#x5B;
			'singular_name' =&gt; __('Codeplaner', 'txtdomain'),
			'add_new_item' =&gt; __('Add new codeplaner', 'txtdomain'),
			'new_item' =&gt; __('New codeplaner', 'txtdomain'),
			'view_item' =&gt; __('View codeplaner', 'txtdomain'),
			'not_found' =&gt; __('No CodePlaners found', 'txtdomain'),
			'not_found_in_trash' =&gt; __('No CodePlaners found in trash', 'txtdomain'),
			'all_items' =&gt; __('All CodePlaners', 'txtdomain'),
			'insert_into_item' =&gt; __('Insert into codeplaner', 'txtdomain')
		],		
	]);
 
	register_taxonomy('codeplaner_category', &#x5B;'codeplaner'], &#x5B;
		'label' =&gt; __('categoryes', 'txtdomain'),
		'hierarchical' =&gt; true,
		'rewrite' =&gt; &#x5B;'slug' =&gt; 'codeplaner-category'],
		'show_admin_column' =&gt; true,
		'show_in_rest' =&gt; true,
		'labels' =&gt; &#x5B;
			'singular_name' =&gt; __('Category', 'txtdomain'),
			'all_items' =&gt; __('All categoryes', 'txtdomain'),
			'edit_item' =&gt; __('Edit Category', 'txtdomain'),
			'view_item' =&gt; __('View Category', 'txtdomain'),
			'update_item' =&gt; __('Update Category', 'txtdomain'),
			'add_new_item' =&gt; __('Add New Category', 'txtdomain'),
			'new_item_name' =&gt; __('New Category Name', 'txtdomain'),
			'search_items' =&gt; __('Search categoryes', 'txtdomain'),
			'parent_item' =&gt; __('Parent Category', 'txtdomain'),
			'parent_item_colon' =&gt; __('Parent Category:', 'txtdomain'),
			'not_found' =&gt; __('No categoryes found', 'txtdomain'),
		]
	]);
	register_taxonomy_for_object_type('codeplaner_category', 'codeplaner');
 

});
</pre>
<p><strong>I hope it will assist you…</strong></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/how-to-create-custom-post_type-and-taxonomy-in-wordpress/">How to create custom post_type and taxonomy in WordPress</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://codeplaners.com/how-to-create-custom-post_type-and-taxonomy-in-wordpress/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to get custom field data in WordPress</title>
		<link>https://codeplaners.com/how-to-get-custom-field-data-in-wordpress/</link>
					<comments>https://codeplaners.com/how-to-get-custom-field-data-in-wordpress/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Tue, 09 Jul 2024 04:13:49 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[customfielddata]]></category>
		<category><![CDATA[wordpress]]></category>
		<guid isPermaLink="false">https://codeplaners.com/?p=1725</guid>

					<description><![CDATA[<p>Hi Dev, Today, we will show you How to get custom field data in WordPress. This article will give you simple example of How to get custom field data in WordPress. Let&#8217;s discuss How to get custom field data in WordPress. In this article, we will implement a How to get custom field data in &#8230; <a href="https://codeplaners.com/how-to-get-custom-field-data-in-wordpress/" class="more-link">Continue reading<span class="screen-reader-text"> "How to get custom field data in WordPress"</span></a></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/how-to-get-custom-field-data-in-wordpress/">How to get custom field data in WordPress</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Hi Dev,</p>
<p>Today, we will show you How to get custom field data in WordPress. This article will give you simple example of How to get custom field data in WordPress. Let&#8217;s discuss How to get custom field data in WordPress. In this article, we will implement a How to get custom field data in WordPress.</p>
<p>So let’s follow few step to create example of How to get custom field data in WordPress.</p>
<h3 class="step_code">Get Single Value Of Custom Field</h3>
<pre class="brush: php; title: ; notranslate">
&lt;?php echo get_post_meta($post-&gt;ID, 'welcome', true); ?&gt;
</pre>
<h3 class="step_code">Get Acf Custom Field Data</h3>
<pre class="brush: php; title: ; notranslate">

&lt;?php
$home_page = get_fields();
$welcome = $home_page&#x5B;'welcome'];
$title = $home_page&#x5B;'title'];
$parg = $home_page&#x5B;'parg'];
$btn = $home_page&#x5B;'btn'];
$image = $home_page&#x5B;'image'];
$slide = $home_page&#x5B;'slide'];
?&gt;

&lt;?php echo $welcome; ?&gt;

Slider image get code

 &lt;?php foreach( $slide as $banner ) { 
                  $banner_img = $banner&#x5B;'img']&#x5B;'url'];
                ?&gt; 
                  &lt;?php if ($banner_img) { ?&gt;
                    &lt;img src=&quot;&lt;?php echo $banner_img; ?&gt;&quot; alt=&quot;Code Planers&quot; &gt;
                  &lt;?php } ?&gt;
 &lt;?php } ?&gt;

</pre>
<p>The post <a rel="nofollow" href="https://codeplaners.com/how-to-get-custom-field-data-in-wordpress/">How to get custom field data in WordPress</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://codeplaners.com/how-to-get-custom-field-data-in-wordpress/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How To Add Bootstrap Menu In WordPress</title>
		<link>https://codeplaners.com/how-to-add-bootstrap-menu-in-wordpress/</link>
					<comments>https://codeplaners.com/how-to-add-bootstrap-menu-in-wordpress/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Tue, 25 Jun 2024 01:53:33 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Bootstrap Menu In WordPress]]></category>
		<guid isPermaLink="false">https://codeplaners.com/?p=1722</guid>

					<description><![CDATA[<p>Hi Dev, Today, we will show you How To Add Bootstrap Menu In WordPress. This article will give you simple example of How To Add Bootstrap Menu In WordPress. Let&#8217;s discuss How To Add Bootstrap Menu In WordPress. In this article, we will implement a How To Add Bootstrap Menu In WordPress. So let’s follow &#8230; <a href="https://codeplaners.com/how-to-add-bootstrap-menu-in-wordpress/" class="more-link">Continue reading<span class="screen-reader-text"> "How To Add Bootstrap Menu In WordPress"</span></a></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/how-to-add-bootstrap-menu-in-wordpress/">How To Add Bootstrap Menu In WordPress</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Hi Dev,</p>
<p>Today, we will show you How To Add Bootstrap Menu In WordPress. This article will give you simple example of How To Add Bootstrap Menu In WordPress. Let&#8217;s discuss How To Add Bootstrap Menu In WordPress. In this article, we will implement a How To Add Bootstrap Menu In WordPress.</p>
<p>So let’s follow few step to create example of How To Add Bootstrap Menu In WordPress.</p>
<h3 class="step_code">Step 1: Create class-wp-bootstrap-navwalker.php file </h3>
<p><strong>You need to create this file in your theme (wp-content\themes\codeplaners\class-wp-bootstrap-navwalker.php</strong><br />
After creating the file, enter the code given below</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
/**
 * WP Bootstrap Navwalker
 *
 * @package WP-Bootstrap-Navwalker
 *
 * @wordpress-plugin
 * Plugin Name: WP Bootstrap Navwalker
 * Plugin URI:  https://github.com/wp-bootstrap/wp-bootstrap-navwalker
 * Description: A custom WordPress nav walker class to implement the Bootstrap 4 navigation style in a custom theme using the WordPress built in menu manager.
 * Author: Edward McIntyre - @twittem, WP Bootstrap, William Patton - @pattonwebz, IanDelMar - @IanDelMar
 * Version: 4.3.0
 * Author URI: https://github.com/wp-bootstrap
 * GitHub Plugin URI: https://github.com/wp-bootstrap/wp-bootstrap-navwalker
 * GitHub Branch: master
 * License: GPL-3.0+
 * License URI: http://www.gnu.org/licenses/gpl-3.0.txt
 */

// Check if Class Exists.
if ( ! class_exists( 'WP_Bootstrap_Navwalker' ) ) :
	/**
	 * WP_Bootstrap_Navwalker class.
	 */
	class WP_Bootstrap_Navwalker extends Walker_Nav_Menu {

		/**
		 * Whether the items_wrap contains schema microdata or not.
		 *
		 * @since 4.2.0
		 * @var boolean
		 */
		private $has_schema = false;

		/**
		 * Ensure the items_wrap argument contains microdata.
		 *
		 * @since 4.2.0
		 */
		public function __construct() {
			if ( ! has_filter( 'wp_nav_menu_args', array( $this, 'add_schema_to_navbar_ul' ) ) ) {
				add_filter( 'wp_nav_menu_args', array( $this, 'add_schema_to_navbar_ul' ) );
			}
		}

		/**
		 * Starts the list before the elements are added.
		 *
		 * @since WP 3.0.0
		 *
		 * @see Walker_Nav_Menu::start_lvl()
		 *
		 * @param string           $output Used to append additional content (passed by reference).
		 * @param int              $depth  Depth of menu item. Used for padding.
		 * @param WP_Nav_Menu_Args $args   An object of wp_nav_menu() arguments.
		 */
		public function start_lvl( &amp;$output, $depth = 0, $args = null ) {
			if ( isset( $args-&gt;item_spacing ) &amp;&amp; 'discard' === $args-&gt;item_spacing ) {
				$t = '';
				$n = '';
			} else {
				$t = &quot;\t&quot;;
				$n = &quot;\n&quot;;
			}
			$indent = str_repeat( $t, $depth );
			// Default class to add to the file.
			$classes = array( 'dropdown-menu' );
			/**
			 * Filters the CSS class(es) applied to a menu list element.
			 *
			 * @since WP 4.8.0
			 *
			 * @param array    $classes The CSS classes that are applied to the menu `&lt;ul&gt;` element.
			 * @param stdClass $args    An object of `wp_nav_menu()` arguments.
			 * @param int      $depth   Depth of menu item. Used for padding.
			 */
			$class_names = join( ' ', apply_filters( 'nav_menu_submenu_css_class', $classes, $args, $depth ) );
			$class_names = $class_names ? ' class=&quot;' . esc_attr( $class_names ) . '&quot;' : '';

			/*
			 * The `.dropdown-menu` container needs to have a labelledby
			 * attribute which points to it's trigger link.
			 *
			 * Form a string for the labelledby attribute from the the latest
			 * link with an id that was added to the $output.
			 */
			$labelledby = '';
			// Find all links with an id in the output.
			preg_match_all( '/(&lt;a.*?id=\&quot;|\')(.*?)\&quot;|\'.*?&gt;/im', $output, $matches );
			// With pointer at end of array check if we got an ID match.
			if ( end( $matches&#x5B;2] ) ) {
				// Build a string to use as aria-labelledby.
				$labelledby = 'aria-labelledby=&quot;' . esc_attr( end( $matches&#x5B;2] ) ) . '&quot;';
			}
			$output .= &quot;{$n}{$indent}&lt;ul$class_names $labelledby&gt;{$n}&quot;;
		}

		/**
		 * Starts the element output.
		 *
		 * @since WP 3.0.0
		 * @since WP 4.4.0 The {@see 'nav_menu_item_args'} filter was added.
		 *
		 * @see Walker_Nav_Menu::start_el()
		 *
		 * @param string           $output Used to append additional content (passed by reference).
		 * @param WP_Nav_Menu_Item $item   Menu item data object.
		 * @param int              $depth  Depth of menu item. Used for padding.
		 * @param WP_Nav_Menu_Args $args   An object of wp_nav_menu() arguments.
		 * @param int              $id     Current item ID.
		 */
		public function start_el( &amp;$output, $item, $depth = 0, $args = null, $id = 0 ) {
			if ( isset( $args-&gt;item_spacing ) &amp;&amp; 'discard' === $args-&gt;item_spacing ) {
				$t = '';
				$n = '';
			} else {
				$t = &quot;\t&quot;;
				$n = &quot;\n&quot;;
			}
			$indent = ( $depth ) ? str_repeat( $t, $depth ) : '';

			if ( false !== strpos( $args-&gt;items_wrap, 'itemscope' ) &amp;&amp; false === $this-&gt;has_schema ) {
				$this-&gt;has_schema  = true;
				$args-&gt;link_before = '&lt;span itemprop=&quot;name&quot;&gt;' . $args-&gt;link_before;
				$args-&gt;link_after .= '&lt;/span&gt;';
			}

			$classes = empty( $item-&gt;classes ) ? array() : (array) $item-&gt;classes;

			// Updating the CSS classes of a menu item in the WordPress Customizer preview results in all classes defined
			// in that particular input box to come in as one big class string.
			$split_on_spaces = function ( $class ) {
				return preg_split( '/\s+/', $class );
			};
			$classes         = $this-&gt;flatten( array_map( $split_on_spaces, $classes ) );

			/*
			 * Initialize some holder variables to store specially handled item
			 * wrappers and icons.
			 */
			$linkmod_classes = array();
			$icon_classes    = array();

			/*
			 * Get an updated $classes array without linkmod or icon classes.
			 *
			 * NOTE: linkmod and icon class arrays are passed by reference and
			 * are maybe modified before being used later in this function.
			 */
			$classes = $this-&gt;separate_linkmods_and_icons_from_classes( $classes, $linkmod_classes, $icon_classes, $depth );

			// Join any icon classes plucked from $classes into a string.
			$icon_class_string = join( ' ', $icon_classes );

			/**
			 * Filters the arguments for a single nav menu item.
			 *
			 * @since WP 4.4.0
			 *
			 * @param WP_Nav_Menu_Args $args  An object of wp_nav_menu() arguments.
			 * @param WP_Nav_Menu_Item $item  Menu item data object.
			 * @param int              $depth Depth of menu item. Used for padding.
			 *
			 * @var WP_Nav_Menu_Args
			 */
			$args = apply_filters( 'nav_menu_item_args', $args, $item, $depth );

			// Add .dropdown or .active classes where they are needed.
			if ( $this-&gt;has_children ) {
				$classes&#x5B;] = 'dropdown';
			}
			if ( in_array( 'current-menu-item', $classes, true ) || in_array( 'current-menu-parent', $classes, true ) ) {
				$classes&#x5B;] = 'active';
			}

			// Add some additional default classes to the item.
			$classes&#x5B;] = 'menu-item-' . $item-&gt;ID;
			$classes&#x5B;] = 'nav-item';

			// Allow filtering the classes.
			$classes = apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item, $args, $depth );

			// Form a string of classes in format: class=&quot;class_names&quot;.
			$class_names = join( ' ', $classes );
			$class_names = $class_names ? ' class=&quot;' . esc_attr( $class_names ) . '&quot;' : '';

			/**
			 * Filters the ID applied to a menu item's list item element.
			 *
			 * @since WP 3.0.1
			 * @since WP 4.1.0 The `$depth` parameter was added.
			 *
			 * @param string           $menu_id The ID that is applied to the menu item's `&lt;li&gt;` element.
			 * @param WP_Nav_Menu_Item $item    The current menu item.
			 * @param WP_Nav_Menu_Args $args    An object of wp_nav_menu() arguments.
			 * @param int              $depth   Depth of menu item. Used for padding.
			 */
			$id = apply_filters( 'nav_menu_item_id', 'menu-item-' . $item-&gt;ID, $item, $args, $depth );
			$id = $id ? ' id=&quot;' . esc_attr( $id ) . '&quot;' : '';

			$output .= $indent . '&lt;li ' . $id . $class_names . '&gt;';

			// Initialize array for holding the $atts for the link item.
			$atts           = array();
			$atts&#x5B;'title']  = ! empty( $item-&gt;attr_title ) ? $item-&gt;attr_title : '';
			$atts&#x5B;'target'] = ! empty( $item-&gt;target ) ? $item-&gt;target : '';
			if ( '_blank' === $item-&gt;target &amp;&amp; empty( $item-&gt;xfn ) ) {
				$atts&#x5B;'rel'] = 'noopener noreferrer';
			} else {
				$atts&#x5B;'rel'] = ! empty( $item-&gt;xfn ) ? $item-&gt;xfn : '';
			}

			// If the item has_children add atts to &lt;a&gt;.
			if ( $this-&gt;has_children &amp;&amp; 0 === $depth ) {
				$atts&#x5B;'href']          = '#';
				$atts&#x5B;'data-toggle']   = 'dropdown';
				$atts&#x5B;'aria-expanded'] = 'false';
				$atts&#x5B;'class']         = 'dropdown-toggle nav-link';
				$atts&#x5B;'id']            = 'menu-item-dropdown-' . $item-&gt;ID;
			} else {
				if ( true === $this-&gt;has_schema ) {
					$atts&#x5B;'itemprop'] = 'url';
				}

				$atts&#x5B;'href'] = ! empty( $item-&gt;url ) ? $item-&gt;url : '#';
				// For items in dropdowns use .dropdown-item instead of .nav-link.
				if ( $depth &gt; 0 ) {
					$atts&#x5B;'class'] = 'dropdown-item';
				} else {
					$atts&#x5B;'class'] = 'nav-link';
				}
			}

			$atts&#x5B;'aria-current'] = $item-&gt;current ? 'page' : '';

			// Update atts of this item based on any custom linkmod classes.
			$atts = $this-&gt;update_atts_for_linkmod_type( $atts, $linkmod_classes );

			// Allow filtering of the $atts array before using it.
			$atts = apply_filters( 'nav_menu_link_attributes', $atts, $item, $args, $depth );

			// Build a string of html containing all the atts for the item.
			$attributes = '';
			foreach ( $atts as $attr =&gt; $value ) {
				if ( ! empty( $value ) ) {
					$value       = ( 'href' === $attr ) ? esc_url( $value ) : esc_attr( $value );
					$attributes .= ' ' . $attr . '=&quot;' . $value . '&quot;';
				}
			}

			// Set a typeflag to easily test if this is a linkmod or not.
			$linkmod_type = $this-&gt;get_linkmod_type( $linkmod_classes );

			// START appending the internal item contents to the output.
			$item_output = isset( $args-&gt;before ) ? $args-&gt;before : '';

			/*
			 * This is the start of the internal nav item. Depending on what
			 * kind of linkmod we have we may need different wrapper elements.
			 */
			if ( '' !== $linkmod_type ) {
				// Is linkmod, output the required element opener.
				$item_output .= $this-&gt;linkmod_element_open( $linkmod_type, $attributes );
			} else {
				// With no link mod type set this must be a standard &lt;a&gt; tag.
				$item_output .= '&lt;a' . $attributes . '&gt;';
			}

			/*
			 * Initiate empty icon var, then if we have a string containing any
			 * icon classes form the icon markup with an &lt;i&gt; element. This is
			 * output inside of the item before the $title (the link text).
			 */
			$icon_html = '';
			if ( ! empty( $icon_class_string ) ) {
				// Append an &lt;i&gt; with the icon classes to what is output before links.
				$icon_html = '&lt;i class=&quot;' . esc_attr( $icon_class_string ) . '&quot; aria-hidden=&quot;true&quot;&gt;&lt;/i&gt; ';
			}

			/** This filter is documented in wp-includes/post-template.php */
			$title = apply_filters( 'the_title', $item-&gt;title, $item-&gt;ID );

			/**
			 * Filters a menu item's title.
			 *
			 * @since WP 4.4.0
			 *
			 * @param string           $title The menu item's title.
			 * @param WP_Nav_Menu_Item $item  The current menu item.
			 * @param WP_Nav_Menu_Args $args  An object of wp_nav_menu() arguments.
			 * @param int              $depth Depth of menu item. Used for padding.
			 */
			$title = apply_filters( 'nav_menu_item_title', $title, $item, $args, $depth );

			// If the .sr-only class was set apply to the nav items text only.
			if ( in_array( 'sr-only', $linkmod_classes, true ) ) {
				$title         = $this-&gt;wrap_for_screen_reader( $title );
				$keys_to_unset = array_keys( $linkmod_classes, 'sr-only', true );
				foreach ( $keys_to_unset as $k ) {
					unset( $linkmod_classes&#x5B; $k ] );
				}
			}

			// Put the item contents into $output.
			$item_output .= isset( $args-&gt;link_before ) ? $args-&gt;link_before . $icon_html . $title . $args-&gt;link_after : '';

			/*
			 * This is the end of the internal nav item. We need to close the
			 * correct element depending on the type of link or link mod.
			 */
			if ( '' !== $linkmod_type ) {
				// Is linkmod, output the required closing element.
				$item_output .= $this-&gt;linkmod_element_close( $linkmod_type );
			} else {
				// With no link mod type set this must be a standard &lt;a&gt; tag.
				$item_output .= '&lt;/a&gt;';
			}

			$item_output .= isset( $args-&gt;after ) ? $args-&gt;after : '';

			// END appending the internal item contents to the output.
			$output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );
		}

		/**
		 * Menu fallback.
		 *
		 * If this function is assigned to the wp_nav_menu's fallback_cb variable
		 * and a menu has not been assigned to the theme location in the WordPress
		 * menu manager the function will display nothing to a non-logged in user,
		 * and will add a link to the WordPress menu manager if logged in as an admin.
		 *
		 * @param array $args passed from the wp_nav_menu function.
		 * @return string|void String when echo is false.
		 */
		public static function fallback( $args ) {
			if ( ! current_user_can( 'edit_theme_options' ) ) {
				return;
			}

			// Initialize var to store fallback html.
			$fallback_output = '';

			// Menu container opening tag.
			$show_container = false;
			if ( $args&#x5B;'container'] ) {
				/**
				 * Filters the list of HTML tags that are valid for use as menu containers.
				 *
				 * @since WP 3.0.0
				 *
				 * @param array $tags The acceptable HTML tags for use as menu containers.
				 *                    Default is array containing 'div' and 'nav'.
				 */
				$allowed_tags = apply_filters( 'wp_nav_menu_container_allowedtags', array( 'div', 'nav' ) );
				if ( is_string( $args&#x5B;'container'] ) &amp;&amp; in_array( $args&#x5B;'container'], $allowed_tags, true ) ) {
					$show_container   = true;
					$class            = $args&#x5B;'container_class'] ? ' class=&quot;menu-fallback-container ' . esc_attr( $args&#x5B;'container_class'] ) . '&quot;' : ' class=&quot;menu-fallback-container&quot;';
					$id               = $args&#x5B;'container_id'] ? ' id=&quot;' . esc_attr( $args&#x5B;'container_id'] ) . '&quot;' : '';
					$fallback_output .= '&lt;' . $args&#x5B;'container'] . $id . $class . '&gt;';
				}
			}

			// The fallback menu.
			$class            = $args&#x5B;'menu_class'] ? ' class=&quot;menu-fallback-menu ' . esc_attr( $args&#x5B;'menu_class'] ) . '&quot;' : ' class=&quot;menu-fallback-menu&quot;';
			$id               = $args&#x5B;'menu_id'] ? ' id=&quot;' . esc_attr( $args&#x5B;'menu_id'] ) . '&quot;' : '';
			$fallback_output .= '&lt;ul' . $id . $class . '&gt;';
			$fallback_output .= '&lt;li class=&quot;nav-item&quot;&gt;&lt;a href=&quot;' . esc_url( admin_url( 'nav-menus.php' ) ) . '&quot; class=&quot;nav-link&quot; title=&quot;' . esc_attr__( 'Add a menu', 'wp-bootstrap-navwalker' ) . '&quot;&gt;' . esc_html__( 'Add a menu', 'wp-bootstrap-navwalker' ) . '&lt;/a&gt;&lt;/li&gt;';
			$fallback_output .= '&lt;/ul&gt;';

			// Menu container closing tag.
			if ( $show_container ) {
				$fallback_output .= '&lt;/' . $args&#x5B;'container'] . '&gt;';
			}

			// if $args has 'echo' key and it's true echo, otherwise return.
			if ( array_key_exists( 'echo', $args ) &amp;&amp; $args&#x5B;'echo'] ) {
				// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
				echo $fallback_output;
			} else {
				return $fallback_output;
			}
		}

		/**
		 * Filter to ensure the items_Wrap argument contains microdata.
		 *
		 * @since 4.2.0
		 *
		 * @param  array $args The nav instance arguments.
		 * @return array $args The altered nav instance arguments.
		 */
		public function add_schema_to_navbar_ul( $args ) {
			if ( isset( $args&#x5B;'items_wrap'] ) ) {
				$wrap = $args&#x5B;'items_wrap'];
				if ( strpos( $wrap, 'SiteNavigationElement' ) === false ) {
					$args&#x5B;'items_wrap'] = preg_replace( '/(&gt;).*&gt;?\%3\$s/', ' itemscope itemtype=&quot;http://www.schema.org/SiteNavigationElement&quot;$0', $wrap );
				}
			}
			return $args;
		}

		/**
		 * Find any custom linkmod or icon classes and store in their holder
		 * arrays then remove them from the main classes array.
		 *
		 * Supported linkmods: .disabled, .dropdown-header, .dropdown-divider, .sr-only
		 * Supported iconsets: Font Awesome 4/5, Glypicons
		 *
		 * NOTE: This accepts the linkmod and icon arrays by reference.
		 *
		 * @since 4.0.0
		 *
		 * @param array   $classes         an array of classes currently assigned to the item.
		 * @param array   $linkmod_classes an array to hold linkmod classes.
		 * @param array   $icon_classes    an array to hold icon classes.
		 * @param integer $depth           an integer holding current depth level.
		 *
		 * @return array  $classes         a maybe modified array of classnames.
		 */
		private function separate_linkmods_and_icons_from_classes( $classes, &amp;$linkmod_classes, &amp;$icon_classes, $depth ) {
			// Loop through $classes array to find linkmod or icon classes.
			foreach ( $classes as $key =&gt; $class ) {
				/*
				 * If any special classes are found, store the class in it's
				 * holder array and and unset the item from $classes.
				 */
				if ( preg_match( '/^disabled|^sr-only/i', $class ) ) {
					// Test for .disabled or .sr-only classes.
					$linkmod_classes&#x5B;] = $class;
					unset( $classes&#x5B; $key ] );
				} elseif ( preg_match( '/^dropdown-header|^dropdown-divider|^dropdown-item-text/i', $class ) &amp;&amp; $depth &gt; 0 ) {
					/*
					 * Test for .dropdown-header or .dropdown-divider and a
					 * depth greater than 0 - IE inside a dropdown.
					 */
					$linkmod_classes&#x5B;] = $class;
					unset( $classes&#x5B; $key ] );
				} elseif ( preg_match( '/^fa-(\S*)?|^fa(s|r|l|b)?(\s?)?$/i', $class ) ) {
					// Font Awesome.
					$icon_classes&#x5B;] = $class;
					unset( $classes&#x5B; $key ] );
				} elseif ( preg_match( '/^glyphicon-(\S*)?|^glyphicon(\s?)$/i', $class ) ) {
					// Glyphicons.
					$icon_classes&#x5B;] = $class;
					unset( $classes&#x5B; $key ] );
				}
			}

			return $classes;
		}

		/**
		 * Return a string containing a linkmod type and update $atts array
		 * accordingly depending on the decided.
		 *
		 * @since 4.0.0
		 *
		 * @param array $linkmod_classes array of any link modifier classes.
		 *
		 * @return string                empty for default, a linkmod type string otherwise.
		 */
		private function get_linkmod_type( $linkmod_classes = array() ) {
			$linkmod_type = '';
			// Loop through array of linkmod classes to handle their $atts.
			if ( ! empty( $linkmod_classes ) ) {
				foreach ( $linkmod_classes as $link_class ) {
					if ( ! empty( $link_class ) ) {

						// Check for special class types and set a flag for them.
						if ( 'dropdown-header' === $link_class ) {
							$linkmod_type = 'dropdown-header';
						} elseif ( 'dropdown-divider' === $link_class ) {
							$linkmod_type = 'dropdown-divider';
						} elseif ( 'dropdown-item-text' === $link_class ) {
							$linkmod_type = 'dropdown-item-text';
						}
					}
				}
			}
			return $linkmod_type;
		}

		/**
		 * Update the attributes of a nav item depending on the limkmod classes.
		 *
		 * @since 4.0.0
		 *
		 * @param array $atts            array of atts for the current link in nav item.
		 * @param array $linkmod_classes an array of classes that modify link or nav item behaviors or displays.
		 *
		 * @return array                 maybe updated array of attributes for item.
		 */
		private function update_atts_for_linkmod_type( $atts = array(), $linkmod_classes = array() ) {
			if ( ! empty( $linkmod_classes ) ) {
				foreach ( $linkmod_classes as $link_class ) {
					if ( ! empty( $link_class ) ) {
						/*
						 * Update $atts with a space and the extra classname
						 * so long as it's not a sr-only class.
						 */
						if ( 'sr-only' !== $link_class ) {
							$atts&#x5B;'class'] .= ' ' . esc_attr( $link_class );
						}
						// Check for special class types we need additional handling for.
						if ( 'disabled' === $link_class ) {
							// Convert link to '#' and unset open targets.
							$atts&#x5B;'href'] = '#';
							unset( $atts&#x5B;'target'] );
						} elseif ( 'dropdown-header' === $link_class || 'dropdown-divider' === $link_class || 'dropdown-item-text' === $link_class ) {
							// Store a type flag and unset href and target.
							unset( $atts&#x5B;'href'] );
							unset( $atts&#x5B;'target'] );
						}
					}
				}
			}
			return $atts;
		}

		/**
		 * Wraps the passed text in a screen reader only class.
		 *
		 * @since 4.0.0
		 *
		 * @param string $text the string of text to be wrapped in a screen reader class.
		 * @return string      the string wrapped in a span with the class.
		 */
		private function wrap_for_screen_reader( $text = '' ) {
			if ( $text ) {
				$text = '&lt;span class=&quot;sr-only&quot;&gt;' . $text . '&lt;/span&gt;';
			}
			return $text;
		}

		/**
		 * Returns the correct opening element and attributes for a linkmod.
		 *
		 * @since 4.0.0
		 *
		 * @param string $linkmod_type a sting containing a linkmod type flag.
		 * @param string $attributes   a string of attributes to add to the element.
		 *
		 * @return string              a string with the openign tag for the element with attribibutes added.
		 */
		private function linkmod_element_open( $linkmod_type, $attributes = '' ) {
			$output = '';
			if ( 'dropdown-item-text' === $linkmod_type ) {
				$output .= '&lt;span class=&quot;dropdown-item-text&quot;' . $attributes . '&gt;';
			} elseif ( 'dropdown-header' === $linkmod_type ) {
				/*
				 * For a header use a span with the .h6 class instead of a real
				 * header tag so that it doesn't confuse screen readers.
				 */
				$output .= '&lt;span class=&quot;dropdown-header h6&quot;' . $attributes . '&gt;';
			} elseif ( 'dropdown-divider' === $linkmod_type ) {
				// This is a divider.
				$output .= '&lt;div class=&quot;dropdown-divider&quot;' . $attributes . '&gt;';
			}
			return $output;
		}

		/**
		 * Return the correct closing tag for the linkmod element.
		 *
		 * @since 4.0.0
		 *
		 * @param string $linkmod_type a string containing a special linkmod type.
		 *
		 * @return string              a string with the closing tag for this linkmod type.
		 */
		private function linkmod_element_close( $linkmod_type ) {
			$output = '';
			if ( 'dropdown-header' === $linkmod_type || 'dropdown-item-text' === $linkmod_type ) {
				/*
				 * For a header use a span with the .h6 class instead of a real
				 * header tag so that it doesn't confuse screen readers.
				 */
				$output .= '&lt;/span&gt;';
			} elseif ( 'dropdown-divider' === $linkmod_type ) {
				// This is a divider.
				$output .= '&lt;/div&gt;';
			}
			return $output;
		}

		/**
		 * Flattens a multidimensional array to a simple array.
		 *
		 * @param array $array a multidimensional array.
		 *
		 * @return array a simple array
		 */
		public function flatten( $array ) {
			$result = array();
			foreach ( $array as $element ) {
				if ( is_array( $element ) ) {
					array_push( $result, ...$this-&gt;flatten( $element ) );
				} else {
					$result&#x5B;] = $element;
				}
			}
			return $result;
		}

	}

endif;
</pre>
<h3 class="step_code">Step 2: Bootstrap menu function:</h3>
<p><strong>funcation.php</strong></p>
<pre class="brush: php; title: ; notranslate">
/**
 * Register Custom Navigation Walker
 */
function register_navwalker(){
    require_once get_template_directory() . '/class-wp-bootstrap-navwalker.php';
}
add_action( 'after_setup_theme', 'register_navwalker' );
</pre>
<h3 class="step_code">Step 3: Add the code below to your theme&#8217;s header.php file.</h3>
<pre class="brush: php; title: ; notranslate">
&lt;nav class=&quot;navbar navbar-expand-md navbar-light bg-light&quot; role=&quot;navigation&quot;&gt;
  &lt;div class=&quot;container&quot;&gt;
    &lt;!-- Brand and toggle get grouped for better mobile display --&gt;
    &lt;button class=&quot;navbar-toggler&quot; type=&quot;button&quot; data-toggle=&quot;collapse&quot; data-target=&quot;#bs-example-navbar-collapse-1&quot; aria-controls=&quot;bs-example-navbar-collapse-1&quot; aria-expanded=&quot;false&quot; aria-label=&quot;&lt;?php esc_attr_e( 'Toggle navigation', 'your-theme-slug' ); ?&gt;&quot;&gt;
        &lt;span class=&quot;navbar-toggler-icon&quot;&gt;&lt;/span&gt;
    &lt;/button&gt;
    &lt;a class=&quot;navbar-brand&quot; href=&quot;#&quot;&gt;Navbar&lt;/a&gt;
        &lt;?php
        wp_nav_menu( array(
            'theme_location'    =&gt; 'primary',
            'depth'             =&gt; 2,
            'container'         =&gt; 'div',
            'container_class'   =&gt; 'collapse navbar-collapse',
            'container_id'      =&gt; 'bs-example-navbar-collapse-1',
            'menu_class'        =&gt; 'nav navbar-nav',
            'fallback_cb'       =&gt; 'WP_Bootstrap_Navwalker::fallback',
            'walker'            =&gt; new WP_Bootstrap_Navwalker(),
        ) );
        ?&gt;
    &lt;/div&gt;
&lt;/nav&gt;
</pre>
<p><strong>If you are facing any problem then you can also watch the video</strong></p>
<p><strong>I hope it will assist you…</strong></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/how-to-add-bootstrap-menu-in-wordpress/">How To Add Bootstrap Menu In WordPress</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://codeplaners.com/how-to-add-bootstrap-menu-in-wordpress/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Custom Post Type Form Send In WordPress</title>
		<link>https://codeplaners.com/custom-post-type-form-send-in-wordpress/</link>
					<comments>https://codeplaners.com/custom-post-type-form-send-in-wordpress/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Wed, 02 Mar 2022 05:18:51 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[wordpress]]></category>
		<guid isPermaLink="false">https://codeplaners.com/?p=1406</guid>

					<description><![CDATA[<p>Hi Dev, Today, i we will show you custom post_type form send in wordpress. This article will give you simple example of custom post_type form send in wordpress. you will custom post_type form send in wordpress. In this article, we will implement a custom post_type form send in wordpress. So let’s follow few step to &#8230; <a href="https://codeplaners.com/custom-post-type-form-send-in-wordpress/" class="more-link">Continue reading<span class="screen-reader-text"> "Custom Post Type Form Send In WordPress"</span></a></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/custom-post-type-form-send-in-wordpress/">Custom Post Type Form Send In WordPress</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Hi Dev,</p>
<p>Today, i we will show you custom post_type form send in wordpress. This article will give you simple example of custom post_type form send in wordpress. you will custom post_type form send in wordpress. In this article, we will implement a custom post_type form send in wordpress. </p>
<p>So let’s follow few step to create example of custom post_type form send in wordpress.</p>
<h3 class="step_code">Example</h3>
<pre class="brush: php; title: ; notranslate">
&lt;?php

		 if(isset($_POST&#x5B;'submit'])){
            date_default_timezone_set(&quot;Asia/Calcutta&quot;); 

            $title=$_POST&#x5B;'name'].&quot;_&quot;.date('YmdHis');
            $name=$_POST&#x5B;'name'];            
            $email=$_POST&#x5B;'email'];
            


            $content .= '&lt;p&gt; Name:- '.$name.'&lt;/p&gt;';            
            $content .= '&lt;p&gt; Email Address:- '.$email.'&lt;/p&gt;';
            
        
        // Create post object
        $post = array(
            'post_title'    =&gt; $title,
            'post_content'  =&gt; $content,
            'post_type'     =&gt;'post',
            'post_status'   =&gt; 'publish',
            'post_author'   =&gt; 1
        );


        

$pid = wp_insert_post( $post, $wp_error='' );

if($pid!=0){

    if ($_FILES) {
        foreach ($_FILES as $file =&gt; $array) {
        $newupload = insert_attachment($file,$pid);
        // $newupload returns the attachment id of the file that
        // was just uploaded. Do whatever you want with that now.
        }
    }
          ////////////////////
            echo &quot;&lt;span class='message'&gt;successfully send&lt;/span&gt;&quot;;
        }	
        
    }
?&gt;

&lt;form id=&quot;myForm&quot; action=&quot;&quot;  method=&quot;post&quot; enctype=&quot;multipart/form-data&quot;&gt;
  
       &lt;input type=&quot;text&quot; placeholder=&quot;Name&quot;  name=&quot;name&quot;&gt;
       &lt;input type=&quot;text&quot; placeholder=&quot;Email&quot;  name=&quot;email&quot;&gt;


&lt;/form&gt;
</pre>
<p>I hope it will assist you…</p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/custom-post-type-form-send-in-wordpress/">Custom Post Type Form Send In WordPress</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://codeplaners.com/custom-post-type-form-send-in-wordpress/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How To Search By post_type In WordPress</title>
		<link>https://codeplaners.com/how-to-search-by-post_type-in-wordpress/</link>
					<comments>https://codeplaners.com/how-to-search-by-post_type-in-wordpress/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Tue, 01 Mar 2022 05:00:46 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[post type search]]></category>
		<category><![CDATA[wordpress]]></category>
		<guid isPermaLink="false">https://codeplaners.com/?p=1403</guid>

					<description><![CDATA[<p>Hi Dev, Today, i we will show you how to search by post_type in wordpress. This article will give you simple example of how to search by post_type in worpress. you will how to search by post_type in wordpress. In this article, we will implement a how to search by post_type in wordpress. So let’s &#8230; <a href="https://codeplaners.com/how-to-search-by-post_type-in-wordpress/" class="more-link">Continue reading<span class="screen-reader-text"> "How To Search By post_type In WordPress"</span></a></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/how-to-search-by-post_type-in-wordpress/">How To Search By post_type In WordPress</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Hi Dev,</p>
<p>Today, i we will show you how to search by post_type in wordpress. This article will give you simple example of how to search by post_type in worpress. you will how to search by post_type in wordpress. In this article, we will implement a how to search by post_type in wordpress. </p>
<p>So let’s follow few step to create example of how to search by post_type in wordpress.</p>
<h3 class="step_code">Example</h3>
<pre class="brush: php; title: ; notranslate">
&lt;form role=&quot;search&quot; action=&quot;&lt;?php echo site_url('/'); ?&gt;&quot; method=&quot;get&quot; id=&quot;searchform&quot;&gt;
    &lt;h3 style=&quot;color: #333;text-align: center;&quot;&gt;Search Loan Id&lt;/h3&gt;
    &lt;input type=&quot;text&quot; name=&quot;s&quot; placeholder=&quot;Search Loan Id&quot; style=&quot;margin: 0 0 20px;&quot;/&gt;
    &lt;input type=&quot;hidden&quot; name=&quot;post_type&quot; value=&quot;loanpost&quot; /&gt; &lt;!-- // hidden 'products' value --&gt;
    &lt;input type=&quot;submit&quot; alt=&quot;Search&quot; value=&quot;Search&quot; /&gt;
&lt;/form&gt;
</pre>
<p>I hope it will assist you…</p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/how-to-search-by-post_type-in-wordpress/">How To Search By post_type In WordPress</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://codeplaners.com/how-to-search-by-post_type-in-wordpress/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Sort by Filter Without Page Refresh  In WordPress</title>
		<link>https://codeplaners.com/sort-by-filter-without-page-refresh-in-wordpress/</link>
					<comments>https://codeplaners.com/sort-by-filter-without-page-refresh-in-wordpress/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Thu, 13 Jan 2022 09:56:29 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[wordpress]]></category>
		<guid isPermaLink="false">https://codeplaners.com/?p=1379</guid>

					<description><![CDATA[<p>Hi Dev, Today, i we will show you sort by filter in wordpress. This article will give you simple example of sort by filter in wordpress. you will sort by filter in wordpress. In this article, we will implement a sort by filter in wordpress. So let’s follow few step to create example of sort &#8230; <a href="https://codeplaners.com/sort-by-filter-without-page-refresh-in-wordpress/" class="more-link">Continue reading<span class="screen-reader-text"> "Sort by Filter Without Page Refresh  In WordPress"</span></a></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/sort-by-filter-without-page-refresh-in-wordpress/">Sort by Filter Without Page Refresh  In WordPress</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Hi Dev,</p>
<p>Today, i we will show you sort by filter in wordpress. This article will give you simple example of sort by filter in wordpress. you will sort by filter in wordpress. In this article, we will implement a sort by filter in wordpress. </p>
<p>So let’s follow few step to create example of sort by filter in wordpress.</p>
<h3 class="step_code">Example</h3>
<pre class="brush: php; title: ; notranslate">
&lt;div class=&quot;filter-wrap&quot;&gt;
   

    &lt;div class=&quot;date&quot;&gt;
        &lt;div class=&quot;field-title&quot;&gt;Sort by&lt;/div&gt;
        &lt;select class=&quot;js-date&quot;&gt;
            &lt;option value=&quot;new&quot;&gt;Newest&lt;/option&gt;
            &lt;option value=&quot;old&quot;&gt;Oldest&lt;/option&gt;
        &lt;/select&gt;
    &lt;/div&gt;
&lt;/div&gt;

&lt;div class=&quot;filtered-posts&quot;&gt;
&lt;?php
 $args = array(
    'post_type' =&gt; 'post',
    'post_status' =&gt; 'publish',
    'posts_per_page' =&gt; -1,
    'orderby' =&gt; 'date',
    'order' =&gt; 'DESC'
);
$the_query = new WP_Query( $args );

if ($the_query-&gt;have_posts() ) :
	while ($the_query-&gt;have_posts() ) : $the_query-&gt;the_post();
?&gt;

&lt;h3&gt;&lt;?php the_title(); ?&gt;&lt;/h3&gt;


&lt;?php
	endwhile;
endif;
 
?&gt;
&lt;/div&gt;


&lt;script&gt;

jQuery(document).ready(function($){
	jQuery( &quot;.js-category, .js-date&quot; ).on( &quot;change&quot;, function() {
		var category = $( '.js-category' ).val();
		var date = $( '.js-date' ).val()

		data = {
			'action': 'filterposts',
			'category': category,
			'date': date
		};

		$.ajax({
			url : 'http://localhost/encorearc/wp-admin/admin-ajax.php',
			data : data,
			type : 'POST',
            success: function (response) {
                        alert(response);
                    },
                    fail: function (err) {
                        alert(&quot;There was an error: &quot; + err);
                    },
			beforeSend : function ( xhr ) {
				$('.filtered-posts').html( 'Loading...' );
				$('.js-category').attr( 'disabled', 'disabled' );
				$('.js-date').attr( 'disabled', 'disabled' );
			},
			success : function( data ) {
				if ( data ) {
					$('.filtered-posts').html( data.posts );

					$('.js-category').removeAttr('disabled');
					$('.js-date').removeAttr('disabled');
				} else {
					$('.filtered-posts').html( 'No posts found.' );
				}
			}
		});
	});
});
&lt;/script&gt;


</pre>
<h3 class="step_code">function.php</h3>
<pre class="brush: php; title: ; notranslate">

/*------------------*/

function ajax_filterposts_handler() {
	$category = esc_attr( $_POST&#x5B;'category'] );
	$date = esc_attr( $_POST&#x5B;'date'] );

	$args = array(
		'post_type' =&gt; 'post',
        'post_status' =&gt; 'publish',
        'posts_per_page' =&gt; -1,
        'meta_key' =&gt; 'date_of_auction',
        'paged' =&gt; $paged,
        
		
	);

	if ( $category != 'all' )
		$args&#x5B;'cat'] = $category;

	if ( $date == 'new' ) {
		$args&#x5B;'order'] = 'DESC';
	} else {
		$args&#x5B;'order'] = 'ASC';
	}

	$posts = 'No posts found.';

	$the_query = new WP_Query( $args );
 
	if ( $the_query-&gt;have_posts() ) :
		ob_start();
		
        while ( $the_query-&gt;have_posts() ) : $the_query-&gt;the_post();
            the_title();
        endwhile;
		
		$posts = ob_get_clean();
	endif;

	$return = array(
		'posts' =&gt; $posts
	);

	wp_send_json($return);
	
}
add_action( 'wp_ajax_filterposts', 'ajax_filterposts_handler' );
add_action( 'wp_ajax_nopriv_filterposts', 'ajax_filterposts_handler' );

</pre>
<p>I hope it will assist you…</p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/sort-by-filter-without-page-refresh-in-wordpress/">Sort by Filter Without Page Refresh  In WordPress</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://codeplaners.com/sort-by-filter-without-page-refresh-in-wordpress/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Sort By Dropdown Custom wp_query In WordPress</title>
		<link>https://codeplaners.com/sort-by-dropdown-custom-wp_query-in-wordpress/</link>
					<comments>https://codeplaners.com/sort-by-dropdown-custom-wp_query-in-wordpress/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Wed, 12 Jan 2022 15:37:01 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[wordpress]]></category>
		<guid isPermaLink="false">https://codeplaners.com/?p=1375</guid>

					<description><![CDATA[<p>Hi Dev, Today, i we will show you sort by dropdown custom wp_query in wordpress. This article will give you simple example of sort by dropdown custom wp_query in wordpress. you will sort by dropdown custom wp_query in wordpress. In this article, we will implement a sort by dropdown custom wp_query in wordpress. So let’s &#8230; <a href="https://codeplaners.com/sort-by-dropdown-custom-wp_query-in-wordpress/" class="more-link">Continue reading<span class="screen-reader-text"> "Sort By Dropdown Custom wp_query In WordPress"</span></a></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/sort-by-dropdown-custom-wp_query-in-wordpress/">Sort By Dropdown Custom wp_query In WordPress</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Hi Dev,</p>
<p>Today, i we will show you sort by dropdown custom wp_query in wordpress. This article will give you simple example of sort by dropdown custom wp_query in wordpress. you will sort by dropdown custom wp_query in wordpress. In this article, we will implement a sort by dropdown custom wp_query in wordpress. </p>
<p>So let’s follow few step to create example of sort by dropdown custom wp_query in wordpress.</p>
<h3 class="step_code">Example 1:- Search by Category</h3>
<pre class="brush: php; title: ; notranslate">
&lt;?php if ( is_search() &amp;&amp; is_category() ) { ?&gt;

	&lt;select name=&quot;sort-posts&quot; id=&quot;sortbox&quot; onchange=&quot;document.location.href='?s=&lt;?php the_search_query(); ?&gt;&amp;cat=&lt;?php echo $_GET&#x5B;'cat'] ;?&gt;&amp;'+this.options&#x5B;this.selectedIndex].value;&quot;&gt;

&lt;?php } elseif ( is_category() || is_archive() ) { ?&gt;

	&lt;select name=&quot;sort-posts&quot; id=&quot;sortbox&quot; onchange=&quot;document.location.href='?'+this.options&#x5B;this.selectedIndex].value;&quot;&gt;

&lt;?php } else { ?&gt;

	&lt;select name=&quot;sort-posts&quot; id=&quot;sortbox&quot; onchange=&quot;document.location.href='?s=&lt;?php the_search_query(); ?&gt;&amp;'+this.options&#x5B;this.selectedIndex].value;&quot;&gt;

&lt;?php } ?&gt;

		&lt;option value=&quot;&quot; disabled&gt;Sort by&lt;/option&gt;
		&lt;option value=&quot;orderby=date&amp;order=dsc&quot;&gt;Newest&lt;/option&gt;
		&lt;option value=&quot;orderby=date&amp;order=asc&quot;&gt;Oldest&lt;/option&gt;
		&lt;option value=&quot;orderby=title&amp;order=asc&quot;&gt;Title Asc&lt;/option&gt;
		&lt;option value=&quot;orderby=title&amp;order=dsc&quot;&gt;Title Desc&lt;/option&gt;
		&lt;option value=&quot;orderby=comment_count&amp;order=dsc&quot;&gt;Most Comments&lt;/option&gt;
		&lt;option value=&quot;orderby=comment_count&amp;order=asc&quot;&gt;Least Comments&lt;/option&gt;

	&lt;/select&gt;

&lt;script type=&quot;text/javascript&quot;&gt;

	&lt;?php if (( $_GET&#x5B;'orderby'] == 'date') &amp;&amp; ( $_GET&#x5B;'order'] == 'dsc')) { ?&gt;
		document.getElementById('sortbox').value='orderby=date&amp;order=dsc';
	&lt;?php } elseif (( $_GET&#x5B;'orderby'] == 'date') &amp;&amp; ( $_GET&#x5B;'order'] == 'asc')) { ?&gt;
		document.getElementById('sortbox').value='orderby=date&amp;order=asc';
	&lt;?php } elseif (( $_GET&#x5B;'orderby'] == 'title') &amp;&amp; ( $_GET&#x5B;'order'] == 'asc')) { ?&gt;
		document.getElementById('sortbox').value='orderby=title&amp;order=asc';
	&lt;?php } elseif (( $_GET&#x5B;'orderby'] == 'title') &amp;&amp; ( $_GET&#x5B;'order'] == 'dsc')) { ?&gt;
		document.getElementById('sortbox').value='orderby=title&amp;order=dsc';
	&lt;?php } elseif (( $_GET&#x5B;'orderby'] == 'comment_count') &amp;&amp; ( $_GET&#x5B;'order'] == 'dsc')) { ?&gt;
		document.getElementById('sortbox').value='orderby=comment_count&amp;order=dsc';
	&lt;?php } elseif (( $_GET&#x5B;'orderby'] == 'comment_count') &amp;&amp; ( $_GET&#x5B;'order'] == 'asc')) { ?&gt;
		document.getElementById('sortbox').value='orderby=comment_count&amp;order=asc';
	&lt;?php } else { ?&gt;
		document.getElementById('sortbox').value='orderby=date&amp;order=desc';
	&lt;?php } ?&gt;

&lt;/script&gt;
</pre>
<h3 class="step_code">Example 2:- Without Search by Category</h3>
<pre class="brush: php; title: ; notranslate">
&lt;?php if ( is_search() ) { ?&gt;

	&lt;select name=&quot;sort-posts&quot; id=&quot;sortbox&quot; onchange=&quot;document.location.href='?s=&lt;?php the_search_query(); ?&gt;&amp;'+this.options&#x5B;this.selectedIndex].value;&quot;&gt;

&lt;?php } else { ?&gt;

	&lt;select name=&quot;sort-posts&quot; id=&quot;sortbox&quot; onchange=&quot;document.location.href='?'+this.options&#x5B;this.selectedIndex].value;&quot;&gt;

&lt;?php } ?&gt;

		&lt;option value=&quot;&quot; disabled&gt;Sort by&lt;/option&gt;
		&lt;option value=&quot;orderby=date&amp;order=dsc&quot;&gt;Newest&lt;/option&gt;
		&lt;option value=&quot;orderby=date&amp;order=asc&quot;&gt;Oldest&lt;/option&gt;
		&lt;option value=&quot;orderby=title&amp;order=asc&quot;&gt;Title Asc&lt;/option&gt;
		&lt;option value=&quot;orderby=title&amp;order=dsc&quot;&gt;Title Desc&lt;/option&gt;
		&lt;option value=&quot;orderby=comment_count&amp;order=dsc&quot;&gt;Most Comments&lt;/option&gt;
		&lt;option value=&quot;orderby=comment_count&amp;order=asc&quot;&gt;Least Comments&lt;/option&gt;

	&lt;/select&gt;

&lt;script type=&quot;text/javascript&quot;&gt;

	&lt;?php if (( $_GET&#x5B;'orderby'] == 'date') &amp;&amp; ( $_GET&#x5B;'order'] == 'dsc')) { ?&gt;
		document.getElementById('sortbox').value='orderby=date&amp;order=dsc';
	&lt;?php } elseif (( $_GET&#x5B;'orderby'] == 'date') &amp;&amp; ( $_GET&#x5B;'order'] == 'asc')) { ?&gt;
		document.getElementById('sortbox').value='orderby=date&amp;order=asc';
	&lt;?php } elseif (( $_GET&#x5B;'orderby'] == 'title') &amp;&amp; ( $_GET&#x5B;'order'] == 'asc')) { ?&gt;
		document.getElementById('sortbox').value='orderby=title&amp;order=asc';
	&lt;?php } elseif (( $_GET&#x5B;'orderby'] == 'title') &amp;&amp; ( $_GET&#x5B;'order'] == 'dsc')) { ?&gt;
		document.getElementById('sortbox').value='orderby=title&amp;order=dsc';
	&lt;?php } elseif (( $_GET&#x5B;'orderby'] == 'comment_count') &amp;&amp; ( $_GET&#x5B;'order'] == 'dsc')) { ?&gt;
		document.getElementById('sortbox').value='orderby=comment_count&amp;order=dsc';
	&lt;?php } elseif (( $_GET&#x5B;'orderby'] == 'comment_count') &amp;&amp; ( $_GET&#x5B;'order'] == 'asc')) { ?&gt;
		document.getElementById('sortbox').value='orderby=comment_count&amp;order=asc';
	&lt;?php } else { ?&gt;
		document.getElementById('sortbox').value='orderby=date&amp;order=desc';
	&lt;?php } ?&gt;

&lt;/script&gt;
</pre>
<p>I hope it will assist you…</p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/sort-by-dropdown-custom-wp_query-in-wordpress/">Sort By Dropdown Custom wp_query In WordPress</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://codeplaners.com/sort-by-dropdown-custom-wp_query-in-wordpress/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
