Different single post template per category wordpress

Different single post template per category wordpress
If you want to display single post page using different single post template, then wordpress in_category() function will help to create different single post template. First thing you have to create different single post template like single_portfolio.php single_news.php single_wordpress.php single_default.php...

Wordpress get all subpages of current page’s parent page

Wordpress get all subpages of current page’s parent page
Following code will display all the subpages of same parent page. also displays the subpages of current page if it is not a subpage. <?php // Get Parent of current page.... $parents_id = $wpdb->get_row("SELECT post_parent FROM $wpdb->posts WHERE id = ".$post->ID." AND post_type...

get all file names from folder PHP

get all file names from folder PHP
Following code will retrieve all file names from a specified folder. <?php $filePath = "/var/www/public_html/mysite/images";/* Enter path to the folder */ $string=""; $fileCount=0; $dir = opendir($filePath); while ($file = readdir($dir)) { if (eregi("\.png",$file))...

Jquery Dynamic SelectBox

Jquery Dynamic SelectBox
On Internet you would have come across many html forms where the value of certain fields depends on the values selected in the first select box. So if we create this using server side script then many page loads will be needed. So if you want to create this at client side then you can create this using...

Wordpress – File type does not meet security guidelines. Try another. Error

Wordpress – File type does not meet security guidelines. Try another. Error
This Error message comes when you are trying to upload image,music or video files which are not supported by wordpress. Wordpress have some whitelist of file types which are allowed to upload, Other files are not allowed to upload due to the security reasons. Accepted Filetypes Images .jpg .jpeg .png .gif For...

Wordpress Popular Post

Wordpress Popular Post
If you want to display most commented post or most popular post on your blog, you can display that using following code. Wordpress Popular Post or Most Commented Post without a Plugin <h2>Popular Posts</h2> <ul> <?php $result = $wpdb->get_results("SELECT comment_count,ID,post_title...

Get Image width height type using PHP

Get Image width height type using PHP
This is excellent php function which can be used to get Width,Height,Type of a Image using PHP. for more information read PHP.net list($width, $height, $type, $attr) = getimagesize("image_name.jpg"); echo "Image Properties"; echo "Width " .$width; echo "<br/>"; echo...

Jquery Slideshow / Gallery Plugins

Jquery Slideshow / Gallery Plugins
JQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript. Below you will find most powerful, the most creative and most versatile...