<?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/tag/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>https://codeplaners.com/tag/wordpress/</link>
	<description>Code Solution</description>
	<lastBuildDate>Sat, 13 Jul 2024 00:32:49 +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/tag/wordpress/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<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>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>
		<item>
		<title>How to Create Duplicate Posts Without Plugins In WordPress</title>
		<link>https://codeplaners.com/how-to-create-duplicate-posts-without-plugins-in-wordpress/</link>
					<comments>https://codeplaners.com/how-to-create-duplicate-posts-without-plugins-in-wordpress/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Wed, 07 Jul 2021 07:53:13 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[wordpress]]></category>
		<guid isPermaLink="false">https://codeplaners.com/?p=1050</guid>

					<description><![CDATA[<p>Today, i we will show you how to create duplicate posts without plugins in wordpress. This article will give you simple example of how to create duplicate posts without plugins in wordpress. you will learn how to create duplicate posts without plugins in wordpress. So let’s follow few step to create example of how to &#8230; <a href="https://codeplaners.com/how-to-create-duplicate-posts-without-plugins-in-wordpress/" class="more-link">Continue reading<span class="screen-reader-text"> "How to Create Duplicate Posts Without Plugins In WordPress"</span></a></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/how-to-create-duplicate-posts-without-plugins-in-wordpress/">How to Create Duplicate Posts Without Plugins In WordPress</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Today, i we will show you how to create duplicate posts  without plugins in wordpress. This article will give you simple example of how to create duplicate posts  without plugins in wordpress. you will learn how to create duplicate posts  without plugins in wordpress. So let’s follow few step to create example of how to create duplicate posts  without plugins in wordpress.</p>
<p>Copy the code and add it to your <strong>functions.php</strong> file:</p>
<pre class="brush: php; title: ; notranslate">
/*
 * Function creates post duplicate post 
 */
function rd_duplicate_post_as_draft(){
	global $wpdb;
	if (! ( isset( $_GET&#x5B;'post']) || isset( $_POST&#x5B;'post'])  || ( isset($_REQUEST&#x5B;'action']) &amp;&amp; 'rd_duplicate_post_as_draft' == $_REQUEST&#x5B;'action'] ) ) ) {
		wp_die('No post to duplicate has been supplied!');
	}
	/*
	 * Nonce verification
	 */
	if ( !isset( $_GET&#x5B;'duplicate_nonce'] ) || !wp_verify_nonce( $_GET&#x5B;'duplicate_nonce'], basename( __FILE__ ) ) )
		return;
 
	/*
	 * get the original post id
	 */
	$post_id = (isset($_GET&#x5B;'post']) ? absint( $_GET&#x5B;'post'] ) : absint( $_POST&#x5B;'post'] ) );
	/*
	 * and all the original post data then
	 */
	$post = get_post( $post_id );
 
	/*
	 * 
	 */
	$current_user = wp_get_current_user();
	$new_post_author = $current_user-&gt;ID;
 
	/*
	 * if post data exists, create the post duplicate
	 */
	if (isset( $post ) &amp;&amp; $post != null) {
 
		/*
		 * new post data array
		 */
		$args = array(
			'comment_status' =&gt; $post-&gt;comment_status,
			'ping_status'    =&gt; $post-&gt;ping_status,
			'post_author'    =&gt; $new_post_author,
			'post_content'   =&gt; $post-&gt;post_content,
			'post_excerpt'   =&gt; $post-&gt;post_excerpt,
			'post_name'      =&gt; $post-&gt;post_name,
			'post_parent'    =&gt; $post-&gt;post_parent,
			'post_password'  =&gt; $post-&gt;post_password,
			'post_status'    =&gt; 'draft',
			'post_title'     =&gt; $post-&gt;post_title,
			'post_type'      =&gt; $post-&gt;post_type,
			'to_ping'        =&gt; $post-&gt;to_ping,
			'menu_order'     =&gt; $post-&gt;menu_order
		);
 
		/*
		 * insert the post by wp_insert_post() function
		 */
		$new_post_id = wp_insert_post( $args );
 
		/*
		 * get all current post terms ad set them to the new post draft
		 */
		$taxonomies = get_object_taxonomies($post-&gt;post_type); // returns array of taxonomy names for post type, ex array(&quot;category&quot;, &quot;post_tag&quot;);
		foreach ($taxonomies as $taxonomy) {
			$post_terms = wp_get_object_terms($post_id, $taxonomy, array('fields' =&gt; 'slugs'));
			wp_set_object_terms($new_post_id, $post_terms, $taxonomy, false);
		}
 
		/*
		 * duplicate all post meta just in two SQL queries
		 */
		$post_meta_infos = $wpdb-&gt;get_results(&quot;SELECT meta_key, meta_value FROM $wpdb-&gt;postmeta WHERE post_id=$post_id&quot;);
		if (count($post_meta_infos)!=0) {
			$sql_query = &quot;INSERT INTO $wpdb-&gt;postmeta (post_id, meta_key, meta_value) &quot;;
			foreach ($post_meta_infos as $meta_info) {
				$meta_key = $meta_info-&gt;meta_key;
				if( $meta_key == '_wp_old_slug' ) continue;
				$meta_value = addslashes($meta_info-&gt;meta_value);
				$sql_query_sel&#x5B;]= &quot;SELECT $new_post_id, '$meta_key', '$meta_value'&quot;;
			}
			$sql_query.= implode(&quot; UNION ALL &quot;, $sql_query_sel);
			$wpdb-&gt;query($sql_query);
		}
		/*
		 * finally, redirect to the edit post screen for the new draft
		 */
		wp_redirect( admin_url( 'post.php?action=edit&amp;post=' . $new_post_id ) );
		exit;
	} else {
		wp_die('Post creation failed, could not find original post: ' . $post_id);
	}
}
add_action( 'admin_action_rd_duplicate_post_as_draft', 'rd_duplicate_post_as_draft' );
/*
 * Add the duplicate link to action list for post_row_actions
 */
function rd_duplicate_post_link( $actions, $post ) {
	if (current_user_can('edit_posts')) {
		$actions&#x5B;'duplicate'] = '&lt;a href=&quot;' . wp_nonce_url('admin.php?action=rd_duplicate_post_as_draft&amp;post=' . $post-&gt;ID, basename(__FILE__), 'duplicate_nonce' ) . '&quot; title=&quot;Duplicate this item&quot; rel=&quot;permalink&quot;&gt;Duplicate&lt;/a&gt;';
	}
	return $actions;
}
add_filter( 'post_row_actions', 'rd_duplicate_post_link', 10, 2 );
</pre>
<p>The post <a rel="nofollow" href="https://codeplaners.com/how-to-create-duplicate-posts-without-plugins-in-wordpress/">How to Create Duplicate Posts Without Plugins 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-duplicate-posts-without-plugins-in-wordpress/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to Remove Version Number In WordPress</title>
		<link>https://codeplaners.com/how-to-remove-version-number-in-wordpress-2/</link>
					<comments>https://codeplaners.com/how-to-remove-version-number-in-wordpress-2/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Mon, 28 Jun 2021 22:20:12 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[wordpress]]></category>
		<guid isPermaLink="false">https://codeplaners.com/?p=1026</guid>

					<description><![CDATA[<p>Today, i we will show you remove version number in WordPress. This article will give you simple example of remove version number in WordPress. you will learn remove version number in WordPress. So let&#8217;s follow few step to create example of remove version number in WordPress. Example 1 Remove WordPress version number from WP_Head &#60;?php &#8230; <a href="https://codeplaners.com/how-to-remove-version-number-in-wordpress-2/" class="more-link">Continue reading<span class="screen-reader-text"> "How to Remove Version Number In WordPress"</span></a></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/how-to-remove-version-number-in-wordpress-2/">How to Remove Version Number In WordPress</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Today, i we will show you remove version number in WordPress. This article will give you simple example of remove version number in WordPress. you will learn remove version number in WordPress. So let&#8217;s follow few step to create example of remove version number in WordPress.</p>
<h3>Example 1</h3>
<p>Remove WordPress version number from WP_Head</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
   function remove_or_hide_wordpress_version_number() {
        return '';
   }
   add_filter('the_generator', 'remove_or_hide_wordpress_version_number');
?&gt;
</pre>
<h3>Example 2</h3>
<p>Removes WordPress version number from all enqueued or included CSS and JS files</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
function remove_or_hide_wordpress_version_number( $src ) {
       if ( strpos( $src, 'ver=' ) )
           $src = remove_query_arg( 'ver', $src );
       return $src;
   }
   add_filter( 'style_loader_src', 'remove_or_hide_wordpress_version_number', 9999 );
   add_filter( 'script_loader_src', 'remove_or_hide_wordpress_version_number', 9999 );
?&gt;
</pre>
<h3>Example 3</h3>
<p>Remove all wordpress version number from all enqueued.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
function remove_or_hide_wordpress_version_number( $src ) {
       if ( strpos( $src, 'ver=' . get_bloginfo( 'version' ) ) )
           $src = remove_query_arg( 'ver', $src );
       return $src;
   }
   add_filter( 'style_loader_src', 'remove_or_hide_wordpress_version_number', 9999 );
   add_filter( 'script_loader_src', 'remove_or_hide_wordpress_version_number', 9999 );
?&gt;
</pre>
<p>The post <a rel="nofollow" href="https://codeplaners.com/how-to-remove-version-number-in-wordpress-2/">How to Remove Version Number 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-remove-version-number-in-wordpress-2/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How To Get Related Post In WordPress</title>
		<link>https://codeplaners.com/how-to-get-related-post-in-wordpress/</link>
					<comments>https://codeplaners.com/how-to-get-related-post-in-wordpress/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Wed, 02 Jun 2021 23:55:13 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[wordpress]]></category>
		<guid isPermaLink="false">https://codeplaners.com/?p=950</guid>

					<description><![CDATA[<p>Today, i we will show you how to get related post in wordpress. This article will give you simple example of how to get related post in wordpress. you will learn how to get related post in wordpress. So let&#8217;s follow few step to create example of how to get related post in wordpress. Example: &#8230; <a href="https://codeplaners.com/how-to-get-related-post-in-wordpress/" class="more-link">Continue reading<span class="screen-reader-text"> "How To Get Related Post In WordPress"</span></a></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/how-to-get-related-post-in-wordpress/">How To Get Related Post In WordPress</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Today, i we will show you how to get related post in wordpress. This article will give you simple example of how to get related post in wordpress. you will learn how to get related post in wordpress. So let&#8217;s follow few step to create example of how to get related post in wordpress.</p>
<p>Example:</p>
<pre class="brush: php; title: ; notranslate">
&lt;ul&gt;
   &lt;?php
         $tags = wp_get_post_tags($post-&gt;ID); if ($tags) { echo 'Related Posts';
         $first_tag = $tags&#x5B;0]-&gt;term_id; $args=array('tag__in' =&gt; array($first_tag),'post__not_in' =&gt; array($post-&gt;ID),'posts_per_page'=&gt;5,'caller_get_posts'=&gt;1);
        $my_query = new WP_Query($args);
        if( $my_query-&gt;have_posts() ) { while ($my_query-&gt;have_posts()) : $my_query-&gt;the_post(); 
   ?&gt;
   &lt;li&gt;
      &lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot;  title=&quot;&lt;?php the_title_attribute(); ?&gt;&quot;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;
   &lt;/li&gt; 
   &lt;?php endwhile; } wp_reset_query(); } ?&gt;
&lt;/ul&gt;
</pre>
<p>The post <a rel="nofollow" href="https://codeplaners.com/how-to-get-related-post-in-wordpress/">How To Get Related Post 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-related-post-in-wordpress/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Custom Pagination Add In WordPress</title>
		<link>https://codeplaners.com/custom-pagination-add-in-wordpress/</link>
					<comments>https://codeplaners.com/custom-pagination-add-in-wordpress/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Sun, 30 May 2021 07:49:08 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[wordpress]]></category>
		<guid isPermaLink="false">https://codeplaners.com/?p=921</guid>

					<description><![CDATA[<p>Hi, Today, i we will show you custom pagination add in wordpress. This article will give you simple example of custom pagination add in wordpress. you will learn custom pagination add in wordpress. In this example, I am telling you how you can set custom pagination without a plugin, we use this custom pagination in &#8230; <a href="https://codeplaners.com/custom-pagination-add-in-wordpress/" class="more-link">Continue reading<span class="screen-reader-text"> "Custom Pagination Add In WordPress"</span></a></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/custom-pagination-add-in-wordpress/">Custom Pagination Add In WordPress</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Hi,</p>
<p>Today, i we will show you custom pagination add in wordpress. This article will give you simple example of custom pagination add in wordpress. you will learn custom pagination add in wordpress. </p>
<p>In this example, I am telling you how you can set custom pagination without a plugin, we use this custom pagination in post and product. So let&#8217;s follow few step to create example of custom pagination add in wordpress.</p>
<p>Copy the code and add  it to your <strong>functions.php</strong> file:</p>
<pre class="brush: php; title: ; notranslate">
////////////////////pagination
if ( ! function_exists( 'post_pagination' ) ) :
   function post_pagination() {
     global $wp_query;
     $pager = 999999999; // need an unlikely integer
 
        echo paginate_links( array(
             'base' =&gt; str_replace( $pager, '%#%', esc_url( get_pagenum_link( $pager ) ) ),
             'format' =&gt; '?paged=%#%',
             'current' =&gt; max( 1, get_query_var('paged') ),
             'total' =&gt; $wp_query-&gt;max_num_pages
        ) );
   }
endif;

function pagination($pages = '', $range = 4)
{ 
     $showitems = ($range * 2)+1; 
     global $paged;
     if(empty($paged)) $paged = 1;
     if($pages == '')
     {
         global $wp_query;
         $pages = $wp_query-&gt;max_num_pages;
         if(!$pages)
         {
             $pages = 1;
         }
     }  
     if(1 != $pages)
     {
         echo &quot;
Page &quot;.$paged.&quot; of &quot;.$pages.&quot;&quot;;
         if($paged &gt; 2 &amp;&amp; $paged &gt; $range+1 &amp;&amp; $showitems &lt; $pages) echo &quot;« First&quot;;
         if($paged &gt; 1 &amp;&amp; $showitems &lt; $pages) echo &quot;‹ Previous&quot;;
 
        // for ($i=1; $i = $paged+$range+1 || $i &lt;= $paged-$range-1) || $pages &lt;= $showitems ))
             {
                 echo ($paged == $i)? &quot;&quot;.$i.&quot;&quot;:&quot;&quot;.$i.&quot;&quot;;
             }
        
 
         if ($paged &lt; $pages &amp;&amp; $showitems &lt; $pages) echo &quot;Next ›&quot;; 
         if ($paged &lt; $pages-1 &amp;&amp;  $paged+$range-1 &lt; $pages &amp;&amp; $showitems &lt; $pages) echo &quot;Last »&quot;;
         echo &quot;
\n&quot;;
     }
}
</pre>
<p>You can get content by doing this function in your file:</p>
<pre class="brush: php; title: ; notranslate">
post_pagination();
</pre>
<p>The post <a rel="nofollow" href="https://codeplaners.com/custom-pagination-add-in-wordpress/">Custom Pagination Add In WordPress</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://codeplaners.com/custom-pagination-add-in-wordpress/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
