All codes in this article will be added to the functions.php theme file.
To edit the code you need to open functions.php theme file of your theme with any code editor like Dreamweaver.
1. Add Google Analytics
Simply paste the code below and insert your Google Analytics where it says paste your Google Analytics. You can paste the code once in your functions.php file and never have to worry about it again. We are adding an action to the wp_footer, so it will automatically insert adsense codes wherever on all pages you have the wp_footer string.
[code type=php]// Paste your Google Analytics code from Step 6 here
[/code]
2. Add a Favicon to your Blog
Every blog deserves to have its own identity. You can add this identity by adding the favicon code in your header.php file, or you can make it easier for yourself by simply adding the following code in your functions.php file.
[code type=php]// add a favicon to your
function blog_favicon() {
echo ‘ ‘;
}
add_action(‘wp_head’, ‘blog_favicon’);[/code]
3. Remove WordPress Version Number
You should always encourage your clients to upgrade to the latest version, so you don’t have this problem. But if you are working with a client that does not want to upgrade, then it is essential that you remove your WordPress version number from your WordPress header, RSS feeds, and all other locations. To do this, add the following code:
[code type=php]
function wpbeginner_remove_version() {
return ”;
}
add_filter(‘the_generator’, ‘wpbeginner_remove_version’);[/code]
4. Add a Custom Dashboard Logo
When creating themes for a client, you can use this as one of the perks to the theme. All you have to do is paste the following code below:
[code type=php]
//hook the administrative header output
add_action(‘admin_head’, ‘my_custom_logo’);
function my_custom_logo() {
echo ‘
‘;
}[/code]
5. Change the Footer in WordPress Admin Panel
[code type=php] function remove_footer_admin () {echo ‘Fueled by Powered By Aditya Infotech
‘;
}
add_filter(‘admin_footer_text’, ‘remove_footer_admin’);[/code]
6. Add Custom Dashboard Widgets in WordPress
You probably have seen widgets that numerous plugins and themes add in the WordPress dashboard. As a theme developer, you can add one yourself by pasting the following codes:
[code type=php]
add_action(‘wp_dashboard_setup’, ‘my_custom_dashboard_widgets’);
function my_custom_dashboard_widgets() {
global $wp_meta_boxes;
wp_add_dashboard_widget(‘custom_help_widget’, ‘Theme Support’, ‘custom_dashboard_help’);
}
function custom_dashboard_help() {
echo ‘
Welcome to Custom Blog Theme! Need help? Contact the developer