Category Archives: Word Press

Word Press

change the howdy Text in wordpress

Copy and paste Below code in your function.php file

add_action( 'admin_bar_menu', 'wp_admin_bar_my_custom_account_menu', 11 );

function wp_admin_bar_my_custom_account_menu( $wp_admin_bar )
{
      $user_id = get_current_user_id();
      $current_user = wp_get_current_user();
      $profile_url = get_edit_profile_url( $user_id );
      if ( 0 != $user_id )
      {

            $avatar = get_avatar( $user_id, 28 );
            $howdy = sprintf( __('Welcome, %1$s'), $current_user->display_name );
            $class = empty( $avatar ) ? '' : 'with-avatar';
            $wp_admin_bar->add_menu( array(
                                         'id' => 'my-account',
                                         'parent' => 'top-secondary',
                                         'title' => $howdy . $avatar,
                                         'href' => $profile_url,
                                         'meta' => array('class' => $class)
                                           ) );

      }
}
Word Press

How to Add Custom Dashboard Widgets in WordPress?

Copy and paste Below code in your function.php file


add_action('wp_dashboard_setup', 'my_own_custom_dashboard_widgets');

function my_own_custom_dashboard_widgets() 
{
    global $wp_meta_boxes;
    wp_add_dashboard_widget('custom_help_widget', 'Theme Support', 'custom_dashboard_help');
}
// This Function is chaining function for my_own_custom_dashboard_widgets
// This is display custom widget text.
function custom_dashboard_help() 
{
      echo '<p>Welcome to Custom Blog <a href="https://shahkeyul.wordpress.com/">Web Expert Developers</a>.</p>';
}

How to Change the Footer in WordPress Admin Panel?

Copy and paste Below code in your function.php file


function footer_admin () 
{
  echo 'Powered  by <a href="https://shahkeyul.wordpress.com/" target="_blank">Web Expert Developers</a> | Designed by <a href="https://shahkeyul.wordpress.com/" target="_blank">Web Expert Developers</a> </p>';
}

add_filter('admin_footer_text', 'footer_admin');