Recently I read the awesome solution of Chris Coyier from css-tricks. There are total 8 possible ways to centering content.
Add WordPress admin notices
Following code add notice on admin panel. Note that: if we dismiss once it hide forever. For new notice we have to change ‘example_ignore_notice’
add_action('admin_notices', 'example_admin_notice');
function example_admin_notice() {
global $current_user ;
$user_id = $current_user->ID;
/* Check that the user hasn't already clicked to ignore the message */
if ( ! get_user_meta($user_id, 'example_ignore_notice') ) {
echo '
‘
;
printf(__('This is an annoying nag message. Why do people make these? | Hide Notice'), '?example_nag_ignore=0');
echo "
”
;
}
}
add_action('admin_init', 'example_nag_ignore');
function example_nag_ignore() {
global $current_user;
$user_id = $current_user->ID;
/* If user clicks to ignore the notice, add that to their user meta */
if ( isset($_GET['example_nag_ignore']) && '0' == $_GET['example_nag_ignore'] ) {
add_user_meta($user_id, 'example_ignore_notice', 'true', true);
}
}
How to change excerpt title and description
function change_excerpt_title_description( $translation, $original )
{
if ( 'Excerpt' == $original ) {
return 'Service Summary';
}else{
$pos = strpos($original, 'Excerpts are optional hand-crafted summaries of your');
if ($pos !== false) {
return 'Service description summary';
}
}
return $translation;
}
add_filter( 'gettext', 'change_excerpt_title_description', 10, 2 );
Multiple the_date() Functions Return Empty Date
Instead of multiple the_date() functions it’s really awesome to use the_time() function like the following code snippet
the_time(get_option('date_format'));
PHP Basics
PHP stands for PHP:Hypertext Prepocessor.
PHP was invented by Rasmus Lerdorf in 1995 as PHP version 1.0. OOP was introduced in PHP5. PHP7 will be released in mid-October 2015. Continue reading “PHP Basics”