wordpress pagination style without wordpress plugin

wp-pagenavi is most popular. wordpress pagination style without wordpress plugin, We need to install wp-pagenavi wordpress plugin for pagination styling.  When we think wordpress pagination style then first thing came in mind which is. We need to install wp-pagenavi wordpress plugin for pagination styling. There are multiple pagination plugins available for pagination styling but wp-pagenavi is most popular.

wordpress pagination style without wordpress plugin

I always recommend wordpress theme developers to not to use the wordpress plugins as much possible because any wordpress plugin will install the extra unuseful code also.

wordpress pagination style without wordpress plugin
wordpress pagination style without wordpress plugin

Here in this article I am giving you the example about wordpress pagination without using any wordpress plugin.

Just open your functions.php file and put following code.


function wpapi_pagination($pages = '', $range = 4)
{
 $showitems = ($range * 2)+1;

 global $paged;
 if(empty($paged)) $paged = 1;

 if($pages == '')
 {
 global $wp_query;
 $pages = $wp_query->max_num_pages;
 if(!$pages)
 {
 $pages = 1;
 }
 }

 if(1 != $pages)
 {
 echo "</pre>
<div class="\&quot;wpapi_pagination\&quot;">Page ".$paged." of ".$pages."";
 if($paged > 2 && $paged > $range+1 && $showitems < $pages) echo "<a href="&quot;.get_pagenum_link(1).&quot;">« First</a>";
 if($paged > 1 && $showitems < $pages) echo "<a href="&quot;.get_pagenum_link($paged - 1).&quot;">‹ Previous</a>";

 for ($i=1; $i <= $pages; $i++)
 {
 if (1 != $pages &&( !($i >= $paged+$range+1 || $i <= $paged-$range-1) || $pages <= $showitems ))
 {
 echo ($paged == $i)? "<span class="\&quot;current\&quot;">".$i."</span>":"<a class="\&quot;inactive\&quot;" href="&quot;.get_pagenum_link($i).&quot;">".$i."</a>";
 }
 }

 if ($paged < $pages && $showitems < $pages) echo "<a href="\&quot;&quot;.get_pagenum_link($paged">Next ›</a>";
 if ($paged < $pages-1 &&  $paged+$range-1 < $pages && $showitems < $pages) echo "<a href="&quot;.get_pagenum_link($pages).&quot;">Last »</a>";
 echo "</div>
<pre>\n";
 }
}

Above function will give the wordpress pagination style like google search engine.

Then open style.css file from your wordpress theme file and put following code in that file.


.wpapi_pagination {
clear:both;
padding:20px 0;
position:relative;
font-size:11px;
line-height:13px;
}

.wpapi_pagination span, .wpapi_pagination a {
display:block;
float:left;
margin: 2px 2px 2px 0;
padding:6px 9px 5px 9px;
text-decoration:none;
width:auto;
color:#fff;
background: #555;
}

.wpapi_pagination a:hover{
color:#fff;
background: #3279BB;
}

.wpapi_pagination .current{
padding:6px 9px 5px 9px;
background: #3279BB;
color:#fff;
}

Then finally where you want to show the wordpress pagination there in area put following code (index.php, etc..)


if (function_exists("wpapi_pagination")) {
 wpapi_pagination($additional_loop->max_num_pages);

 

wordpress pagination style without wordpress plugin
wordpress pagination style without wordpress plugin

If you are having any issues or question about adding the wordpress pagination without plugin then please write me.

 

 

convert plain text URI to HTML links in wordpress themes

When you put some URL and email address you need to manually add the link URL to that text. This action always takes the some time of wordpress blogger. WordPress has facility to add the links to your URL and email address automatically.

 

convert plain text URI to HTML links in wordpress

This facility is available in wordpress since wordpress 2.7 version but many wordpress theme and plugin developers never used this functionality.

WordPress provides the make_clickable() function for convert plain text URI to HTML links. This function able to convert URI, www, ftp, and email addresses. Finishes by fixing links within links. You just need to pass the string parameter to this method.

More detail information you can find in following file.
wp-includes/formatting.php.

You can use this method in your functions.php file also. Use the following code.

add_filter('the_content', 'make_clickable');

By using this code you are able to covert the URI, www, ftp, and email addresses in to link.

If you are having any issues or question about make_clickable method then please write to me.

most popular posts wordpress without plugin

Many times you want to show the popular posts in your wordpress theme and you use popular post wordpress plugin or widget for showing the popular posts in your wordpress theme. As much possible you need to avoid the wordpress plugins for minimal code.

most popular posts wordpress without plugin

With very easy steps you can fetch the most popular posts from your wordpress. Most common trick or technique is on comments base you can fetch the popular posts.

You just need to open your functions.php file from wordpress posts and put following code in file.


// Get Most Popular Posts in theme
function popular_posts_by_comments( $posts = 5) {
 $popular = new WP_Query('orderby=comment_count&posts_per_page='.$posts);
 while ($popular->have_posts()) : $popular->the_post();
?>
<li>
<div>
 <a title="<?php the_title(); ?>" href="<?php the_permalink() ?>"><?php the_title(); ?></a>
 <span><?php comments_popup_link('0 Comment', '1 Comment', '% Comments', 'comments-link', ''); ?></span>
 </div> <!--end .info-->
 <div></div>
</li>
<?php endwhile;
}

This is very easy code to fetch you wordpress popular posts. Here I am fetching only 5 popular posts from wordpress. You can fetch the multiple popular posts by changing the $post variable value.

In wordpress theme sidebar or footer section if you want to show the popular post then just use following code.

popular_posts_by_comments();

most popular posts wordpress without plugin
most popular posts wordpress without plugin

where you want to show the popular posts.

show popular posts without wordpress plugin in theme
show popular posts without wordpress plugin in theme

Remove Unwanted Meta Boxes from wordpress dashboard through wordpress theme

When we login to wordpress admin area that time we first saw the admin dashboard. Many tabs and section are not useful in admin dashboard section for wordpress admin and sometimes we don’t know what is that sections.

Remove Unwanted Meta Boxes from wordpress dashboard through wordpress theme

We saw the right now, recent comments, quick press, stat, recent drafts, incoming links, wordpress development blog, other wordpress news, plugins and more sections in wordpress dashboard section. Most of that section are not useful to wordpress admin. So is that better to remove unwanted section from dashboard.

Remove Unwanted Meta Boxes from wordpress dashboard through wordpress theme
Remove Unwanted Meta Boxes from wordpress dashboard through wordpress theme

For disable the dashboard section we are going to use the wp_dashboard_setup method. In wordpress dashboard there are multiple meta boxes listed. some of them as follows:

//Main column
$wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']
$wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']
$wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']
$wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']

//Side Column
$wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']
$wp_meta_boxes['dashboard']['side']['core']['dashboard_recent_drafts']
$wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']
$wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']

For removing the widgets or meta boxes from dashboard you need to open your functions.php file from wordpress theme folder and put following code in that file.

function remove_dashboard_meta_boxes(){
  global$wp_meta_boxes;
  unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']);
  unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']);
  unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);
  unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']);
  unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);
  unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);
}

add_action('wp_dashboard_setup', 'remove_dashboard_meta_boxes')

This code will remove the incoming link, right now, plugins, recent comments and secondary section from wordpress dashboard section.

Remove Unwanted Meta Boxes from wordpress dashboard through wordpress theme
Remove Unwanted Meta Boxes from wordpress dashboard through wordpress theme

If you want the more information about wordpress dashboard widget then check following URL
http://codex.wordpress.org/Dashboard_Widgets_API

If you are having any issue or questions about wordpress dashboard then please write to me.

wordpress 3.0.2 released

On November 30, 2010, WordPress 3.0.2 was released to the public. In this release they introduced the major security updates. The WordPress development team has released version 3.0.2 of their popular open source blogging and publishing platform, a maintenance and security update for the 3.0.x branch of WordPress.

wordpress 3.0.2 released.

 

You can download new wordpress version from.

http://wordpress.org/download/

WordPress has released a new version, 3.0.2, to fix a SQL injection flaw.  This flaw is in all previous versions of the codebase according to reports, which means that if you are running WordPress, you must update.  This exploit is possible with author-level permissions but personally I would not depend on this to protect myself.

The WordPress development team has released version 3.0.2 of their popular open source blogging and publishing platform, a maintenance and security update for the 3.0.x branch of WordPress

With the 3.0.2 version wordpress fixed following issues.

  • Fix moderate security issue where a malicious Author-level user could gain further access to the site. (r16625)

Other bugs and security hardening:

  • Remove pingback/trackback blogroll whitelisting feature as it can easily be abused. (#13887)
  • Fix canonical redirection for permalinks containing %category% with nested categories and paging. (#13471)
  • Fix occasional irrelevant error messages on plugin activation. (#15062)
  • Minor XSS fixes in request_filesystem_credentials() and when deleting a plugin. (r16367, r16373)
  • Clarify the license in the readme (r15534)
  • Multisite: Fix the delete_user meta capability (r15562)
  • Multisite: Force current_user_can_for_blog() to run map_meta_cap() even for super admins (#15122)
  • Multisite: Fix ms-files.php content type headers when requesting a URL with a query string (#14450)
  • Multisite: Fix the usage of the SUBDOMAIN_INSTALL constant for upgraded WordPress MU installs (#14536)

How to display custom post type on wordpress page

From wordpress 3.0 version we got the custom_post_type method introduced in wordpress api.  Here we shown, How to display custom post type on wordpress page If you want to know how use this method or create the custom post type then use following URL:

How to display custom post type on wordpress page

https://purabtech.in/how-to-use-the-custom-post-type-in-wordpress-3-0/

In this tutorial I will show how to show the custom post type in wordpress theme page. First create custom-post.php page in your wordpress theme folder and use following code.

[/php]

php

/*Template Name: custom post*/

?>

php get_header(); ?>

<div id=”container”>

<div id=”content” role=”main”>

php the_ID(); ?>”

php $recent = new WP_Query(‘post_type=custom_post′); while($recent->have_posts()) : $recent->the_post();?>

php the_title( ‘

‘, ‘

‘ ); ?>

<div>

php the_content(); ?>

php

the_content();
global $post;
$custom = get_post_custom($post->ID);
echo $custom_meta = $custom[“custom_meta”][0];

?>

php wp_link_pages( array( ‘before’ => ‘

‘ . __( ‘Pages:’, ‘wordpressapi’ ), ‘after’ => ‘

‘ ) ); ?>

php edit_post_link( __( ‘Edit’, ‘wordpressapi’ ), ”, ” ); ?>

</div><!– .entry-content –>

php comments_template( “, true ); ?>

php endwhile; ?>

</div><!– #content –>

</div><!– #container –>

php get_sidebar(); ?>

php get_footer(); ?>

[/php]

Then go to your wordpress admin panel and create page called custom page and from right side panel you will find the page attribute section use the template drop down and choose the custom post option.

How to display custom post type on wordpress page
How to display custom post type on wordpress page

Now you are set for showing your custom post type in custom page. Open your custom page on that page you will see all the entries of custom post type.

For more detail information about custom post type and using this check above URL.

WordPress changed the statistic graph

Today when I logged to my wordpress blog account and looked at dashboard, I saw the new changed statistic graph.
The new statistic graph is looking really very cool. New graph version is better for those who are visually improved so nicely.

WordPress changed the statistic graph

For wordpress blogger and website users this news is really great.

Seeing this graph I must say you will miss having the grand total of both syndicated and on-site views for an entry.

As we know we need to updgrade the “WordPress.com Stats” wordpress plugin to see the updated stats in your hosted wordpress blogs.
You can download or update the wordpress stat plugin using following URL
http://wordpress.org/extend/plugins/stats/

Wordpress changed the statistic graph
WordPress changed the statistic graph

What wordpress is saying about changed Stat in Twitter.
Sexy Stats: http://wp.me/pf2B5-1n9

As per wordpress:
Each module can be opened and closed, moved, or hidden completely. If you don’t want to see a module, minimize it with one click or use the Screen Options to keep it out of sight. Customize everything and view stats the way you want to.

As you hover over each bar in the chart it changes color and displays a tooltip, giving you more information about the data. If the chart is showing data by day, Saturdays and Sundays have a light gray background to make it easier to see weekly patterns. Under the chart you’ll notice a new area, called “fortune cookies,” where we’ll highlight key stats.

During the redesign we went with bar charts because the end of one day and the beginning of another shouldn’t be connected. Each day starts at zero and we think bar charts work much better for this type of data. We hope you’ll agree once you get used to the change.

In this first phase of the stats redesign we’ve focused on the main page. This will allow us to collect feedback from you so we can tweak everything as we go. We’ve only mentioned a few of the highlights here, so take your stats for a drive around town to get used to the feel. Let us know what you like and what you might change. As we gather feedback we’ll apply a bit of sexy to the other stat pages.

Windows or MSN Space is migrating to wordpress.com

Few time ago wordpress just announced the partnership with  Microsoft. Microsoft is saying “WordPress as the new default blogging platform on Windows Live Spaces!” WordPress as the new default blogging platform on Windows Live Spaces!”

Windows or MSN Space is migrating to wordpress.com

Windows or MSN Space is migrating to wordpress.com
Windows or MSN Space is migrating to wordpress.com

Microsoft is saying “Over the last few weeks, we’ve spent a good bit of time talking about our approach to partnering with the web, and as part of that, how we’re deeply integrating with the leading consumer services that you find most valuable. Earlier today, I had the opportunity to get on stage at TechCrunch Disrupt, and with Toni Schneider, CEO of Automattic (the parent company of WordPress.com), announce an exciting partnership between our companies.”

Using this step more than 30 million users of windows space will migrate to wordpress.com.

In detail Matt is also written in his article.

MSN Spaces Closing, becomes WP.com

As we looked at how we brought Windows Live and WordPress.com together, there were three big things we wanted to deliver:

  • Giving existing Windows Live Spaces customers an easy upgrade of their blogging experience to WordPress.com
  • Letting anyone connect their WordPress.com blog to Messenger so their Messenger friends are updated when they publish a new post on WordPress.com
  • Allowing Windows Live customers to easily create new blogs on WordPress.com
Windows or MSN Space is migrating to wordpress.com
Windows or MSN Space is migrating to wordpress.com

For detail information for windows space user can use the following article for checking this further information about migrating the blog to wordpress.com

WordPress.com and Windows Live partnering together and providing an upgrade for 30 million Windows Live Spaces customers

WordPress.com is welcoming all the windows and live space users through Twitter. WordPress.com written the following tweet in Tweeter.

Welcome Windows Live Spaces Bloggers to WordPress.com! http://wp.me/pf2B5-1lU

Dont use WP-Robot plugin ever in WordPress blog

First reason I must say that google does not like the wp-robot wordpress plugin. Unique and good quality contents are what you need to RANK. Dont use WP-Robot plugin ever in WordPress blog.

What is Wp-Robot?

WP Robot is an autoblogging plugin for WordPress weblogs. It will enable the user to create targeted blog posts on any topic without having to write anything. Blogs will be set on auto-pilot and fresh content will be entered on a schedule that the user specifies and the posts can be on any topic and will be targeted to any keyword desired. Content can be taken from any source including Amazon, Ebay, ClickBank, and YouTube.

Many People think they will earn money easily from this plugin. But that is not true. If you use wp-robot plugin for month you will get to know. Not single article is indexed by google.
Because Google will check the article title and content and That content is duplicate then google never index that page.
Your articles will never comes in picture. It might be possible in that blog you will right the your own articles but still due to wp-robot google will never index your article.
Google might ban your domain name due to wp-robots. Earlier this is happened with some domain names due to wp-robots.
So My advice to all bloggers dont use wp-robots ever.

WordPress.com announcement: Like a Post? Well Then, “Like” It!

Yesterday When I logged to my wordpress blog account I saw the following announcement under my dashboard.

WordPress.com announcement: Like a Post? Well Then, “Like” It!

I checked the that link and I got the news about like button. When I checked the post in my blog then I am able to see the like button under my each post.

Note: This functionality is enabled with self hosted wordpress blogs.

What features Like button is having?

A ‘like’ button will be present at the end of every blog post, similar to the feature on social networking site, Facebook. If a viewer ‘likes’ a post, the author can browse through the blog profile of the viewer. This is designed to promote interaction between bloggers who share similar ideas and interests.

When you “like” a post two core things happen. First, the blog post’s author sees your “like” and can click-through to your Gravatar profile. Second, clicking “like” saves the post in your homepage dashboard (in the “Posts I Like” section), so you can share it with others, or just keep it around for future reference. If you’re interested in keeping track of how many likes your own blog posts are receiving, there’s a new “like count” column on the “Posts > Edit Post” screen. This will show you the total like count on each of your posts, right next to the total comment count.

We’re hoping this will be an awesome new way to discover other interesting bloggers, and start new conversations with people who — literally! — like you. If you haven’t updated your Gravatar profile yet, now would be a great time to upload a picture, a link to your blog, and any other details. Editing your profile is easy, just remember that all of your profile information is public.

If you dont want to show the like button then follow the bellow steps

If you’d prefer not to display likes on any of your blog posts we’ve provided an option to turn them off under “Appearance > Extras.” You can still enable or disable likes selectively on individual posts through the “Show likes on this post” checkbox when editing or writing a new post.

I love the wordpress they are keep adding very interesting stuff in wordpress blogs.