Display Current Time using shortcode

Add this code in Theme function file functions.php function timeZone_funch( $atts ) { extract(shortcode_atts(array(‘timezone’ => ‘Asia/Kolkata’), $atts)); /* Asia/Kolkata is default Timezone */ $output=””; if (in_array($timezone, DateTimeZone::listIdentifiers())) { date_default_timezone_set($timezone); $currentTime = date( ‘d-m-Y h:i:s A’); $output = $currentTime; } else { $output = “Invalid Timezone”; } return $output; } add_shortcode( ‘current_time’, ‘timeZone_funch’ ); USAGE: [current_time … Read more

Standard API for rendering a date form

Could this work for you? <link type=”text/css” href=”http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.10/themes/base/jquery-ui.css” rel=”stylesheet” /> <script type=”text/javascript” src=”http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js”></script> <script type=”text/javascript” src=”https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.11/jquery-ui.min.js”></script> <script type=”text/javascript”> $(document).ready(function(){ $(“#datepicker”).datepicker({ onSelect: function(dateText, inst) { $(“#thedate”).val(dateText); } }); }); </script> <table> <tr> <td style=”vertical-align:top;”> <h3>End Date</h3> </td> <td> <ul> <li><p>(Pick a date from the calendar below)</p></li> <li> <div style=”margin-bottom:5px;” type=”text” id=”datepicker”></div> </li> <li> Date Selected: <input … Read more

Show monthly or daily archives

Before WordPress 4.1, you can show the date archive page titles with the following code: (Taken and slightly modified from the twentyfourteen theme) if ( is_day() ) { printf( __( ‘Daily Archives: %s’, ‘twentyfourteen’ ), get_the_date() ); } elseif ( is_month() ) { printf( __( ‘Monthly Archives: %s’, ‘twentyfourteen’ ), get_the_date( _x( ‘F Y’, ‘monthly … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)