Get customize categories in wordpress

The following example will show the categories with checkbox <?php $args=array( ‘child_of’ => ‘1’, ‘hide_empty’ => ‘0’ ); $categories ...

Calculate average and sum from Mysql query

The AVG function return the average value of the specified column. For example I have a table of product list and now I want the total of price and average price of all the products. id name price 43245 Jeans 19.99 43246 Top 3.99 43247 Playstation 89.95 43248 Men’s ...

How to get number of days between two dates in PHP

By the given blow script we can find the number of days between two dates <?php $first_date = strtotime("2010-08-01"); // or current date as well $second_date = strtotime("1988-08-01"); ...

Show Top Comments or Commentators In WordPress Without A Plugin

Here is a simple code snippet to show the top commentators or comments in the wordpres without any plugin. The code are given blow. function top_comment_authors($amount = 5){ global ...

Get current URL in PHP

Sometime, you need to get a current page URL that is shown in the browser address bar. Here is a small code to get the current url. $url = (!empty($_SERVER['HTTPS'])) ? "https://".$_SERVER['SERVER_NAME'] .$_SERVER['REQUEST_URI'] ...
© 2017 Sumit Bansal. All rights reserved. Site Admin · Entries RSS · Comments RSS
Powered by WordPress · Designed by Theme Junkie