PHP have mosts of functions available to create a image on the fly. You can use these functions to create a captcha image or a add banner on the fly.
<?php
$new_image = imagecreate( 400, 200 );
$apply_background = imagecolorallocate( $my_img, 0, 0, 255 );
$text_colour = imagecolorallocate( $new_image,...
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...
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...
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))...
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...
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...
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...
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...