Many times adding the custom pagination in wordpress blog is very important. In this article I will show you how to add the simple pagination in wordpress.

You need to open the your index.php file from wordpress theme and put following code in that file.


<div class="navigation">
  <div class="alignleft"><? next_posts_link('&laquo; Previous') ?>
  </div>
  <div class="alignright"><? previous_posts_link('Next') ?>
  </div>
</div>

If you want the pagination in single post then you can use the following code:

<?php next_posts_link($label , $max_pages); ?>
<?php prev_posts_link($label , $max_pages); ?>

There are some very nice wordpress plugin available for wordpress pagination.
WP-PageNavi

PageNavi wordpress plugin is really nice. I personally like this plugin so much. With this plugin you can apply your custom css also.

Changing the CSS

If you need to configure the CSS style of WP-PageNavi, you can copy the pagenavi-css.css file from the plugin directory to your theme’s directory and make your modifications there. This way, you won’t lose your changes when you update the plugin.

Alternatively, you can uncheck the “Use pagenavi.css?” option from the settings page and add the styles to your theme’s style.css file directly.

When ever we write some code in post. That code need to visible very easily. There are some useful wordpress plugins for highlighting the code in wordpress post.

While WordPress.com doesn’t allow you to use potentially dangerous code on your blog, there is a way to post source code for viewing. We have created a shortcode you can wrap around source code that preserves its formatting and even provides syntax highlighting for certain languages, like so:

To accomplish the above, just wrap your code in these tags:

 your code here
 

The language parameter controls how the code is syntax highlighted. The following languages are supported:

  • actionscript3
  • bash
  • coldfusion
  • cpp
  • csharp
  • css
  • delphi
  • erlang
  • fsharp
  • diff
  • groovy
  • javascript
  • java
  • javafx
  • matlab (keywords only)
  • objc
  • perl
  • php
  • text
  • powershell
  • python
  • ruby
  • scala
  • sql
  • vb
  • xml

If the language parameter is not set, it will default to “text” (no syntax highlighting).

Code in between the source code tags will automatically be encoded for display, you don’t need to worry about HTML entities or anything.

There are some free plugins also helpful for syntax highlighting.  I specially like the SyntaxHighlighter Evolved wordpress plugin. SyntaxHighlighter Evolved allows you to easily post syntax-highlighted code to your site without loosing it’s formatting or making any manual changes.

You can download this plugin form here:

SyntaxHighlighter Evolved

There is another plugin for syntax highlighting which also really nice.

WP-Syntax provides clean syntax highlighting using GeSHi — supporting a wide range of popular languages. It supports highlighting with or without line numbers and maintains formatting while copying snippets of code from the browser.

It avoids conflicts with other 3rd party plugins by running an early pre-filter and a late post-filter that substitutes and pulls the code snippets out first and then pushes them back in with highlighting at the end. The result is source code formatted and highlighted the way you intended.

You can download the this from here:

WP-Syntax

Many people want to show the latest posts from there selected categories or all categories on home page.
I this article I will show how easily you can achieve this.
Please following code in your home page which is your theme’s index.php file.

<?php
$categories=get_categories($all_categories);
 foreach($categories as $category) {
 $post_args=array(
 'showposts' => 1, // you can fetch number of articles from each category
 'category__in' => array($category->term_id),
 'caller_get_posts'=>1
 );
 $posts=get_posts($post_args);
 if ($posts) {
 echo '<p>Category: <a href="' . get_category_link( $category->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $category->name ) . '" ' . '>' . $category->name.'</a> </p> ';
 foreach($posts as $post) {
 setup_postdata($post); ?>
 <div>
 <p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">
 <?php the_title(); ?></a></p>
 <p><?php the_excerpt(); ?>
 </div>
 <?php
 } // foreach($posts
 } // if ($posts
 } // foreach($categories
?>

if you want to show the posts from specific articles then use following code.

<?php
$selected_categories=array(
 'include' => '1,4,9',
 'order' => 'ASC'
 );

$categories=get_categories($selected_categories);
 foreach($categories as $category) {
 $post_args=array(
 'showposts' => 1, // you can fetch number of articles from each category
 'category__in' => array($category->term_id),
 'caller_get_posts'=>1
 );
 $posts=get_posts($post_args);
 if ($posts) {
 echo '<p>Category: <a href="' . get_category_link( $category->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $category->name ) . '" ' . '>' . $category->name.'</a> </p> ';
 foreach($posts as $post) {
 setup_postdata($post); ?>
 <div>
 <p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">
 <?php the_title(); ?></a></p>
 <p><?php the_excerpt(); ?>
 </div>
 <?php
 } // foreach($posts
 } // if ($posts
 } // foreach($categories
?>

Photo Gallery, picture gallery, or slideshow are the best way to showcase your images/photos to your readers. There are a lot of different methods to create them, and the alternative you’re most likely to be using Flash or JavaScript

Below is the most downloaded image gallery plugins that we have choosen directly from thewordpress plugin directory. To make it even easier for you to choose, I also added live demo link under every image plugin! All of the resources in this post are categorized and hopefully you will find a number of new plugin that will be practical for your own work.

Using Lightbox, Thickbox, and Fancybox Effect

NextGEN Gallery

DemoDownload (Version 1.5.5 | Updated 2010-6-14 | Downloads 2,007,702)

NextGEN Gallery is a full integrated Image Gallery plugin for WordPress with a Flash slideshow option.

 

 

Lightbox 2

 

DemoDownload (Version 2.9.2 | Updated 2010-2-10 | Downloads 385,160)

Used to overlay images on the current page. Lightbox JS v2.2 by Lokesh Dhakar. Now with better regular expressions, courtesy of Michael Tyson!

 

 

Shadowbox JS

 

DemoDownload (Version 3.0.3.2 | Updated 2010-4-6 | Downloads 175,656)

Shadowbox is an online media vieiwing application similar to Lightbox and Thickbox but with more functionality. Supports all types of media.

 

Lightbox Plus

DemoDownload (Version 2.0.5 | Updated 2010-7-2 | Downloads 112,323)

Lightbox Plus permits users to view larger versions of images, simple slide shows, videos and content all in an overlay.

 

Lightbox Gallery

DemoDownload (Version 0.6.2 | Updated 2009-12-20 | Downloads 87,964)

This plugin changes the view of galleries to the lightbox.

 

jQuery Lightbox

DemoDownload (Version 0.10 | Updated 2010-6-29 | Downloads 69,992)

Used to overlay images on the current page.

 

Shutter Reloaded

DemoDownload (Version 2.4.1 | Updated 2009-12-17 | Downloads 64,557)

Darkens the current page and displays an image (like Lightbox, Thickbox, etc.), but is a lot smaller (10KB) and faster.

 

FancyBox for WordPress

DemoDownload (Version 2.7.2 | Updated 2009-12-20 | Downloads 58,120)

Seamlessly integrates FancyBox into your blog: Upload, activate, and you’re done. No further configuration needed.

 

Lightview Plus

DemoDownload (Version 2.5 | Updated 2010-5-13 | Downloads 54,341)
Seamless integration of Lightview (similar to Lightbox, Thickbox, Floatbox, Thickbox, Fancybox) to create a nice overlay to display images and videos.

 

Using Flip Effect


Page Flip Image Gallery

DemoDownload (Version 0.5.11.1 | Updated 2010-6-25 | Downloads 469,854)
FlippingBook WordPress Gallery plugin helps you to create Image Gallery with Page Flip effects on your blog.

Simple Image Gallery

Post videos and photo galleries

DemoDownload (Version 1.67 | Updated 2010-6-30 | Downloads 341,511)

Post your videos and photo galleries/flash slideshows easily and in seconds.

 

Yet Another Photoblog


DemoDownload (Version 1.9.24 | Updated 2009-12-27 | Downloads 109,879)

Convert your WordPress Blog into a full featured photoblog in virtually no time.

 

WP-SimpleViewer

DemoDownload (Version 1.5.4 | Updated 2010-1-9 | Downloads 91,836)

Add SimpleViewer Flash image galleries to your posts and pages. Easy to use and several options to make it fit your needs.

 

WP Photo Album

DemoDownload (Version 1.5.1 | Updated 2008-9-25 | Downloads 54,185)

This plugin is designed to easily manage and display your photo albums within your WordPress site.

 

Lazyest Gallery

DemoDownload (Version 0.16.3 | Updated 2010-6-21 | Downloads 54,160)
Lazyest Gallery is an integrated image gallery with automatic thumb and slide creation, comments on images, and a slide show.

Flickr Gallery

flickrRSS

DemoDownload (Version 5.1 | Updated 2009-4-29 | Downloads 184,471)

Allows you to integrate Flickr photos into your site. It supports user, set, favorite, group and community photostreams.

 

Flickr Photo Album

DemoDownload (Version 1.1 | Updated 2008-10-6 | Downloads 99,638)

This Flickr plugin for WordPress will allow you to pull in your Flickr photosets and display them as albums on your WordPress site.

 

Flickr Gallery

Release PageDownload (Version 1.4.0 | Updated 2010-7-4 | Downloads 62,143)

Quickly and easily add Flickr galleries, photos, and even custom search results into your WordPress pages and posts.

 

WordPress Flickr Manager

DemoDownload (Version 2.3 | Updated 2009-2-15 | Downloads 58,330)
Handles uploading, modifying images on Flickr, and insertion into posts.

Image Tools

Scissors

DemoDownload (Version 1.3.7 | Updated 2010-2-8 | Downloads 99,029)
Scissors enhances WordPress’ handling of images by introducing cropping, resizing, rotating, and watermarking functionality.
For WordPress 2.9 – 3.0 please download here :http://dev.huiz.net/2010/01/03/wordpress-plugin-scissors-for-v2-9/

 

Using Flash

GRAND Flash Album Gallery

DemoDownload (Version 0.49 | Updated 2010-6-28 | Downloads 85,050)

GRAND Flash Album Gallery is a full integrated (flash skin based, slideshow) Image Gallery plugin with a powerfull admin back end.

 

NextGEN-FlashViewer

DemoDownload (Version 1.3 | Updated 2009-2-1 | Downloads 79,004)
The famous Adobe Flash Plugins from Airtight Interactive for NextGEN Gallery.
Other Demo :

Slideshow


Featured Content Gallery

DemoDownload (Version 3.2.0 | Updated 2009-3-9 | Downloads 212,344)

Used to create a customizable rotating image gallery anywhere within your WordPress site.

 

WP PicLens

DemoDownload (Version 1.0.5 | Updated 2008-1-29 | Downloads 72,379)

Creates an immersive, full-screen slideshow presentation of photos and images in your blog.

 

Dynamic Content Gallery

DemoDownload (Version 3.2.3 | Updated 2010-4-11 | Downloads 54,089)
Creates a dynamic gallery of images for latest or featured content selected from one category, a mix of categories, or pages.

Source Link

Keeping your wordpress database is very important for wordpress database. This will improve your site speed aslo.
Many times you install the wordpress plugins and some time you dont want that plugins and you delete that plugins. There is very nice wordpress plugin is avilable for database backup.

WP-DB-Backup

WP-DB-Backup allows you easily to backup your core WordPress database tables. You may also backup other tables in the same database.
But that plugins create some tables in your wordpress database. You need to remove that tables from your wordpress database.
Imp note: when ever you are cleaning the database or deleting the unwanted tables from wordpress database. Please consult with your web administrator.
Dont forget to take a full backup of your database.

This tutorial should be forward-compatible with WordPress 3.0

1. Install WP-DB-Backup by Austin Matzko

2. Mouse over Tools so that the down arrow appears

3. Click the down arrow

4. Click Backup

5. You’ll see something like this:

On the left are the default database tables included with WordPress. All of these are included every time you backup. The only thing you have to decide here is whether to exclude spam comments from being backed up (I recommend this) and whether to exclude post revisions (I recommend excluding these too, unless you have a specific reason for keeping revisions).

On the right is a list of additional database tables, most of which were probably created by plugins. There’s also a table called that will end with the name “commentmeta” – this can be used by plugins.

If your plugins have created a lot of data that you would like to save, or you’ve spent a lot of time configuring particular plugins, you’ll want to backup these tables. Otherwise, you can keep your database backups smaller by not checking them.

7. Next we see the Backup Option. There are three choices here:

A. Save to the server

This will save a backup of your database as a file on your web server. I don’t recommend this.

B. Download to your computer.

This will create a database backup file that you can save to your local computer.

C. Email backup to:

This allows you to send a copy of the backup to any e-mail address you’d like.

8. Let’s go ahead and download a copy to our hard drives now.

Check options you want in the Tables section then click “Backup now!”

You should see a progress bar, and when that’s done your browser will prompt you to save the file. You can save this file wherever you’d like.

9. There’s another section called “Scheduled Backup.” This is where this program gets really great.

Here we can schedule a backup to be e-mailed to a particular e-mail address however often we’d like. I recommend checking selecting “Once Daily.”

10. On the right, you’ll see that list of optional tables again. Check the ones you want to backup every time the backup runs.

11. Enter the e-mail address you want the backups delivered to in the “Email backup to:” field.

12. Click “Schedule backup.”

13. You should now get a backup file as an e-mail attachment every day. You should save these attachments to your local computer. If you’re using Gmail or another web mail host that has a lot of storage space, you might want to leave your databases on their server as an additional off-site backup. Be aware that that’s an additional security risk – if your e-mail account is ever compromised, the would have access to all of your database backups.

Many times you website content is not suitable for all the age group. There is very nice wordpress free plugin available.

Restricted to Adults

There’s a lot of content which isn’t appropriate for all ages. The [Association of Sites Advocating Child Protection (ASACP)](http://www.asacp.org/ “ASACP) has developed the Restricted to Adults (RTA) tag which most online protection software respects.

Installing the RTA tag on a WordPress install can be somewhat complicated, so the Restricted to Adults plugin makes it one click — activate the plugin and your site is restricted to adults.

What is persistent database connection?

Persistent connections are links that do not close when the execution of your script ends. When a persistent connection is requested, PHP checks if there’s already an identical persistent connection (that remained open from earlier) – and if it exists, it uses it. If it does not exist, it creates the link. An ‘identical’ connection is a connection that was opened to the same host, with the same username and the same password (where applicable).

If you want to use the persistent database connection then you should follow my steps:

First Open the wp-db.php file from wp-includes folder. In that file find following words:


// @mysql_connect( $dbhost, $dbuser, $dbpassword, true );

//Change that to

@mysql_pconnect( $dbhost, $dbuser, $dbpassword, true );

comment the mysql_connect line. This line you will find two times in that file. You need to change the line both the times. Then upload this file to your wordpress installation.

Persistent database connection will open only one connection and for every query that will check for connection is present or not. If connection is alreadypresent then your query will execute using that persistent database connection.

There are cupple of issues with persistent database connection, When you are using the persistent connection you should keep following things in mind.

Imp: There are a couple of additional caveats to keep in mind when using persistent connections. One is that when using table locking on a persistent connection, if the script for whatever reason cannot release the lock, then subsequent scripts using the same connection will block indefinitely and may require that you either restart the httpd server or the database server. Another is that when using transactions, a transaction block will also carry over to the next script which uses that connection if script execution ends before the transaction block does. In either case, you can use register_shutdown_function() to register a simple cleanup function to unlock your tables or roll back your transactions. Better yet, avoid the problem entirely by not using persistent connections in scripts which use table locks or transactions (you can still use them elsewhere).

Now WordPress 3.0 is released and the new post thumbnail function will not changed until.

You can provide 4 picture formats to the function (change the width and height values to your need):

// the thumbnail
the_post_thumbnail(array(100,100));

// medium resolution
the_post_thumbnail(array(300,200));

// large resolution
the_post_thumbnail(array(600, 400));

// original
the_post_thumbnail();

You can set how the images should align. It is also possible to assign an own class:

//  left align
the_post_thumbnail(array(100,100), array('class' => 'alignleft'));

//  right align
the_post_thumbnail(array(100,100), array('class' => 'alignright'));

//  center
the_post_thumbnail(array(100,100), array('class' => 'aligncenter'));

// align right and the class  'my_own_class'
the_post_thumbnail(array(100,100), array('class' => 'alignright my_own_class'));

The 3rd possibility is the control of the images size with an array of height and width:
For this purpose we suppose that the settings for thumbnail is 150×150, for medium 300×200 and for large 600×400.

// thumbnail scaled to 60x60 pixel
the_post_thumbnail(array(60,60), array('class' => 'alignleft'));

// original thumbnail
the_post_thumbnail(array(150,150), array('class' => 'alignleft'));

// medium resolution scaled to 200x133 pixel
the_post_thumbnail(array(200,200), array('class' => 'alignleft'));

// large resolution scaled to 400x266 Pixel
the_post_thumbnail(array(400,345), array('class' => 'alignleft'));

We see that the image proportions are always maintained, even if one specifies crooked values.

For the Theme Designers is this not necessarily easier, because no one knows what the user will put in his settings o his library. One way to approach this problem, to query the options for the various sizes:

// width of the thumbnails
get_option('thumbnail_size_w');

//  height of the thumbnails
get_option('thumbnail_size_h');

//  height of the medium resolution
get_option('medium_size_h');

//  width of the large resolution
get_option('large_size_w');

//  1 = Crop thumbnail to exact dimensions, 0 = Crop off
get_option('thumbnail_crop')

You can change these values in your theme.

$w = get_option('thumbnail_size_w') / 2;
$h = get_option('thumbnail_size_h') /2;

the_post_thumbnail(array($w, $h), array('class' => 'alignleft'));

Here another example: If the size of a thumbnail is bigger than 100×100 and crop is activated, then the thumbnail should be resized to 100×100, otherwise use the original thumbnail.

if(get_option('thumbnail_size_w') > 100 && get_option('thumbnail_crop') == 1) {
    the_post_thumbnail(array(100,100));
}else{
    the_post_thumbnail('thumbnail');
}

What Matt is saying?

I wouldn’t recommend anyone use the named arguments for the_post_thumbnail, like ‘thumbnail’, could you remove those from your tutorial.

Inspired by

In last few years wordpress become most popular CMS in the world. WordPress has great support of wordpress plugins which are free.
Many people many types of wordpress plugins as per there use.

Here I am going to give you the list of most popular wordpress plugins which are downloaded millions times.
I recommend if you hosted your website with wordpress you must use following wordpress plugins.

Akismet

Akismet checks your comments against the Akismet web service to see if they look like spam or not.
This Plugins is downloaded 8,477,963 times.

All in One SEO Pack

Automatically optimizes your WordPress blog for Search Engines (Search Engine Optimization).
This Plugins is downloaded 5,291,396 times.

Google XML Sitemaps

This plugin will generate a special XML sitemap which will help search engines to better index your blog.
This Plugins is downloaded 3,935,776 times.

WP Super Cache

A very fast caching engine for WordPress that produces static html files.
This Plugins is downloaded 94,084 times.

WPtouch iPhone Theme

WPtouch automatically transforms your WordPress blog into an iPhone application-style theme, complete with ajax loading articles and effects, when vie
This Plugins is donwloaded 876,885 times.

NextGEN Gallery

NextGEN Gallery is a full integrated Image Gallery plugin for WordPress with a Flash slideshow option.
This Plugins is downloaded 1,988,926 times.

Contact Form 7

Just another contact form plugin. Simple but flexible.
This Plugins is downloaded 2,021,419 times.

WordPress.com Stats

You can have simple, concise stats with no additional load on your server by plugging into WordPress.com’s stat system.
This Plugins is donwloaded 1,688,181 times.

Fast and Secure Contact Form

A super customizable contact form that lets your visitors send you email. Blocks all common spammer tactics. Spam is no longer a problem.
This Plugins is downloaded 343,069 times.

ourSTATS Widget

create a widget for the ourstats.de counter service
This Plugins is downloaded 80,348 times.

Post videos and photo galleries

Post your videos and photo galleries/flash slideshows easily and in seconds.
This Plugins is downloaded 326,804 times.

AddToAny: Share/Bookmark/Email Button

Help people share, bookmark, and email your posts & pages using any service, such as Facebook, Twitter, Google Buzz, Digg and many more.
This Plugins is downloaded 995,509 times.

WP-PageNavi

Adds a more advanced paging navigation to your WordPress site.
This Plugins is downloaded 868,432 times.

Google Analyticator

Adds the necessary JavaScript code to enable Google Analytics. Includes widgets for Analytics data display.
This Plugins is downloaded 936,897 times.

WordPress Related Posts

WordPress Related Posts Plugin will generate a related posts via WordPress tags, and add the related posts to feed.
This Plugins is donwloaded 220,359 times.

When you publish your post,the feed an published to the whole world.That’s very annoying thing.

Some times you need to change the content or change the url, that time you got the errors

The following example publishs the post 10 minutes later in your feed:


/**
 * puplish the content in the feed later
 * $where ist default-var in WordPress (wp-includes/query.php)
 * // Apply filters on where and join prior to paging so that any
 * This function an a SQL-syntax
 */
function publish_later_on_feed($where) {
 global $wpdb;

 if ( is_feed() ) {
 // timestamp in WP-format
 $now = gmdate('Y-m-d H:i:s');

 // value for wait; + device
 $wait = '10'; // integer

 // http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_timestampdiff
 $device = 'MINUTE'; //MINUTE, HOUR, DAY, WEEK, MONTH, YEAR

 // add SQL-sytax to default $where
 $where .= " AND TIMESTAMPDIFF($device, $wpdb->posts.post_date_gmt, '$now') > $wait ";
 }
 return $where;
}

add_filter('posts_where', 'publish_later_on_feed');

You need to open the your wordpress themes functions.php file and put above code in that file. Using this function your feed will publish after 10 minute of your wordpress post publishing.

Wordpressapi is developer code book.
wordpressapi on Facebook

Who am I?

Sony Kumari founded Wordpressapi in Feb 2010. She started writing since Aug 2006 in wordpress blog. Later on She moved her blog to wordpressapi.com.

Sony Kumari is dubble gradute and earned M.C.A. in Computers. Sony Kumari handled the so many projects in many different technology. She worked on Java, PHP, Ruby on Rails, Javascript, Web services, Social applications, Ad campaigns.

Mahesh is the Author of Wordpressapi, as well as a serial web entrepreneur, sci-fi author, and aspiring world changer. He has been writing for Wordpressapi since Dec 2009. His previous experience includes Photoshop Design, CSS design, Web design and wordpress themes development.

Mahesh is a graduate and earned a B.E. in Electronics. He is having three years of experience in Web design and Wordpress application development.

Rahul is the Author of Wordpressapi, as well as a web designer and photoshop artist. His previous experience includes Photoshop Design, CSS design, Web design and wordpress themes development.

Rahul is a graduate and earned a B.A. in History. He is having Five years of experience in Web design and Wordpress application development.

© 2010 Wordpressapi. All Rights Reserved. Reproduction without explicit permission is prohibited.