Latest Posts
PHP Pagination
I have look for php pagination source. I got one very nice source code from Stranger Studio. That very nice code if your have a lot of records. You can see at sample preview.
![]()
However, this is a lot of lines in the file. If you want to put into a lot of pages, all of code you need to put into those pages. We have to take care about this. That’s while I have changed to class and functions. That’s very easy to use. I will share it back.
How to parse xml in php?
When I started and learn php programming language. I have wanted to get data from xml file and read with php. I searched with Google. I got a lot of source codes. Some of codes are working in my local machine but when I upload and test it. It doesn’t work. I have found some codes are work with almost all of server. I will share it back.
Useful WordPress Hacks
Show related post without a plugin
If you want to show related post in you current post , you can use simple way to show. You just need to copy and paste under following codes into single.php file of your theme. This code will display related posts based on the current post tag(s). It must be pasted within the loop.
<?php
//for use in the loop, list 5 post titles related to first tag on current post
$tags = wp_get_post_tags($post->ID);
if ($tags) {
echo 'Related Posts';
$first_tag = $tags[0]->term_id;
$args=array(
'tag__in' => array($first_tag),
'post__not_in' => array($post->ID),
'showposts'=>5,
'caller_get_posts'=>1
);
$my_query = new WP_Query($args);
if( $my_query->have_posts() ) {
while ($my_query->have_posts()) : $my_query->the_post(); ?>
<p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>
<?php
endwhile;
}
}
?>
Free IP address geolocation tool
If you are looking for geographical location of an IP address, I would like to recommend you to use IPInfoDB .
This is the free web tool that you can detect geographical location of an IP address.
IP Info DB is offering free services based on their IP address geolocation database.
- Web based IP geolocation lookup
- IP geolocation API (XML, JSON and CSV format)
- API that generate IP CIDR by country for iptables or htaccess blocklist
- E-commerce fraud detection API
- Free version of our SQL database updated monthly!



Made by Symmetric Web
Distributed by Smashing Magazine