Simple add the below code in your active theme’s functions.php file

In WordPress there are mainly 4 kinds of roles. Which are listed below :

Administrator – Somebody who has access to all the administration features
Editor – Somebody who can publish posts, manage posts as well as manage other people’s posts, etc.
Author – Somebody who can publish and manage their own posts
Contributor – Somebody who can write and manage their posts but not publish posts
Subscriber – Somebody who can read comments/comment/receive news letters, etc.

CAPABILITIES AND ADMINISTRATION MENUS

CHECKING A USER’S CAPABILITY

ADDING CUSTOM USER ROLES

ADDING CUSTOM USER CAPABILITIES

Below are useful wp_query arguments used to build WordPress query

Simply add the below code in your active theme’s functions.php

Add this code in your active theme’s functions.php file

In WordPress you can also have your own gravtar and to make you new gravtar. Just copy the following code and put it into your theme’s functions.php file.

In order to you the above code make sure you are having your avtar file  with “wtu_avatar.png” name and this file should be in your active theme’s root directory. If not then give the appropriate url & file name in the above function.

To get your blog information use get_bloginfo() which returns information about your site.

Here $filter is optional.
You can pass different available parameters in place of $parameter

‘name’ – Returns the “Site Title”

‘description’ – Returns the “Tagline”

‘wpurl’ – Returns the “WordPress address (URL)”

‘url’ – Returns the “Site address (URL)”

‘admin_email’ – Returns the “E-mail address”

‘charset’ – Returns the “Encoding for pages and feeds”

‘version’ – Returns the WordPress Version you use. This data is retrieved from the $wp_version variable set in wp-includes/version.php.

‘html_type’ – Returns the Content-Type of WordPress HTML pages (default: “text/html”).

‘text_direction’ – Returns the Text Direction of WordPress HTML pages. Consider using is_rtl() instead.

‘language’ – Returns the language of WordPress.

‘stylesheet_url’ – Returns the primary CSS (usually style.css) file URL of the active theme. You can also use get_stylesheet_uri(

‘stylesheet_directory’ – Returns the stylesheet directory URL of the active theme. You can also use get_stylesheet_directory_uri()

‘template_url’ / ‘template_directory’ – URL of the active theme’s directory. You can also use get_template_directory_uri() (for the parent template directory) or get_stylesheet_directory_uri() (for the child template directory)

‘pingback_url’ – Returns the Pingback XML-RPC file URL (xmlrpc.php)

‘atom_url’ – Returns the Atom feed URL (/feed/atom)

‘rdf_url’ – Returns the RDF/RSS 1.0 feed URL (/feed/rfd)

‘rss_url’ – Returns the RSS 0.92 feed URL (/feed/rss)

‘rss2_url’ – Returns the RSS 2.0 feed URL (/feed)

‘comments_atom_url’ – Returns the comments Atom feed URL (/comments/feed)

‘comments_rss2_url’ – Returns the comments RSS 2.0 feed URL (/comments/feed)

‘siteurl’ – Deprecated since version 2.2. Use home_url(), or get_bloginfo(‘url’)

‘home’ – Deprecated since version 2.2. Use home_url(), or get_bloginfo(‘url’)

Put the above code in your active theme’s functions.php file and change the function name from “create_CUSTOM_FUNTION_NAME”  to you desired name and also change the function attributes according to your need.

While developing a website in WordPress, You might be wondering how to add favicon to the website using functions.php file.
Here is the code for this.

Put the above code in you active theme’s functions.php file.
Make sure you are having your favicon with “favicon.ico” name and this file should be in your active theme’s root directory. If not then give the appropriate url & file name in the above function.

Copy the below code and put it in your active theme’s functions.php file

Put the below code in your active theme’s functions.php file

Copy the below code and put it in your active theme’s functions.php file

You can put your own text instead of Welcome in the above code.