These pieces of code are all for wordpress

Code for a date picker

<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css" />
<script>
$(function() {
$( "#datepicker" ).datepicker();
});
</script>
<h3>Date:<input type="text" id="datepicker" /></h3>

 

PHP  Code to give users a personal message when logged in

$t=date("H");
if ($t<"12")
{
echo "Welcome and Have a good morning!";
}
else if ($t<"18")
{
echo "Welcome and Have a good afternoon!";
}
else
{
echo "Welcome and Have a good evening!";
}

PHP Code to give a welcome message with the users name

 $current_user = wp_get_current_user();
      
$t=date("H");
 if ($t<"12") { echo ' Have a good morning! ' . $current_user->display_name . ' ';
   }
 else if ($t<"18") { echo ' Have a good afternoon! ' . $current_user->display_name . ' ';
   }
else
{
   echo 'Have a good evening! ' . $current_user->display_name . ' ';
     }

Comments

code snippits — No Comments

Leave a Reply

Your email address will not be published. Required fields are marked *