Archive for the ‘PHP’ Category

How to find multiple occurance of a string in a target text

How to find multiple occurance of a string in a target  text May be  all of you know the pros and cons of  strpos() function. Why we use this function? Actually sometimes we need to track the position of a search string in a long text or a paragraph. And  so we  use it. echo strpos($targetstring,$searched_string); And it it will  always show the first occurance of the searched text but what we will do when we want to get the multiple occurance. One solution is that we can use the offset as a third parameter for strpos();...

Very interesting Feature Late Static Bindings(LSB) in php 5.3.0

Very interesting Feature  Late Static Bindings(LSB) in php 5.3.0 Php is now widening its scope and solving its limitation to achieve the pure OOP(Object Oriented Programmng). Now we will learn the LSB by observing the code: <?php class parentclass { public static $c_name = __class__; /*this will store the name of the class in $_cname*/ function get_class_name(){ echo”This is the object of “; return self::$c_name.’<br/>’; } } class subclass1 extends parentclass{public static $c_name = __class__;} class...

Secure File and Folder permissions for WordPress

Secure File and Folder permissions for Wordpress File and folder permissions is very important in terms of web security. In most of the cases hackers are some how manage to get the access of your server and can upload/write/ edit your script and compromise your website. Common form of security regarding this is never allow write permissions to group user and public user. In some cases at the time of uploading or activating a plugin you need to change the file permission to even 777, the most vulnerable permission....

Secure your wp-admin folder in WordPress

Secure your wp-admin folder in Wordpress Sometimes you will see that your site has been compromised by hacker. You may have seen that they do it by hacking your wp-admin folder. Your site might be public but you can restrict your wp-admin folder by providing little extra security with a htaccess file. You can limit access to this folder for some IP addresses. Any attempts at accessing any file within this folder will be greeted with a Forbidden error message. You have to create a .htaccess file in your wp-admin...

How to Secure your wordpress site from Hackers

How to Secure your wordpress site from Hackers Several of my websites are hacked today. All of my sites are hosted in Hostgator VPS server and my sites are hacked by “Prishtina Hackers Group”. Thanks to this group who insisted me to seriously thinking about the security of my sites. My sites are hacked that does not means that those hacker group is extraordinary actually as a developer I was less careful about the security of my sites. This is the main offense and security gap from my end. I want to share...

Nice procedure to create a wordpress widget plugin in step by step

Nice procedure to create a wordpress widget plugin in step by step You want to access in the wordpress core development. Really you are a greeks. This nice procedure for you and it will amazed your structural plan and enthusiasm. In the following article we will learn—>How to make a widget plugin? –>How to show the effect  of widget in the content? [...]

Rss feed for Custom Post Type – WordPres

Rss feed for Custom Post Type - WordPres Custom Post Types was one of the most hyped feature of WordPress 3.0. This feature alone expanded the horizon of WordPress usage as a Content Management System (CMS). If you are using Custom Post Types, or thinking of custom post types, then you may have the urge to add it into your main RSS Feed. This option is not built-in by default because your main WordPress RSS feed only includes “Posts” not even pages, so custom post types are a long shot. In this article,...

Switch Blog in WPmu

Switch Blog in WPmu Some time we need to make some common header,sitebar and footer in wpmu site sub-domain . We can do this easily by make a common template in root site and use those header,sitebar and footer on that sub-domain site . To use root’s header in sub-domain by wordpress default function , we just set the switch_to_blog() function after that reset the blog by restore_current_blog(); Example : suppose we use the wp_get_pages() in theme header . when any sub-domain site...

Read more link tips in Wp

Read more link tips in Wp 1 . Some time read more link not working in the_content() to fix this problem we can apply this procedure . < ?php global $more; // Declare global $more (before the loop). $more = 0; // Set (inside the loop) to display content above the more tag. the_content("More..."); ?> 2. if u don’t want to show the read more link and want show the full content the we need to do following thing < ?php global $more; // Declare global $more (before the loop). $more...

Blog on Template Page

Blog on Template Page In WordPress some time we need to show the Blog on Different Page .We can do this by using the following code . First we make template page called blog.php After that we can put the following main code on the blog.php .I ignore the header footer and sidebar portion . < ?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $total_post=get_option("posts_per_page"); query_posts("posts_per_page=$total_post&paged=".$paged);...
Page 1 of 1712345NextLast »