WordPress is an online, open-source website creation tool written in PHP. It is the easiest and most powerful blogging and website content management system (CMS) existing today.
Basic requirements to install Wordpress are:-
Few advantages of using WordPress:-
With WordPress.org, you host your own blog or website. WordPress.org is where you'll find the free WordPress software that you can download and install on your own web server.
WordPress.com, on the other hand, takes care of all of the hostings for you. You don’t have to download software, pay for hosting, or manage a web server.
WordPress was released on May 27, 2003, by its founders, Matt Mullenweg and Mike Little, as a fork of b2/cafelog. The software is released under the GPLv2 (or later) license.
Wordpress user different roles are enlisted as follows
A subscriber is just like a regular user of the website. If you provide a subscriber role to your user, they can log in to your WordPress website, update their profiles and change their passwords. They cannot write posts, view comments, modify the WordPress theme or anything else inside your WordPress admin area. This type of role suits when you want your users to log in to your website to view posts or leave a comment. Being a subscriber, they may also enroll for Email subscriptions like newsletters and promotions if you provide one on your website.
Contributors are the users who prominently aim for getting recognition by contributing their work on your website. A contributor can add a new post, edit their post but they cannot publish any post, not even their personal ones. Apart from that, they have no access to the admin functionalities like altering the website design, uploading the plugins or creating new categories.
Contributors can, however, choose from the existing categories and add the relevant tags to their posts. They can also view all the comments, even which are in moderation but, they cannot alter, approve or delete them. They are even restricted to upload any external files on the website, not even the images for their posts.
As the name states, users who have been assigned the role of an author can write, edit and publish their posts. They have full freedom to upload media files to use within their posts.
Coming to the things which are restricted for a user assigned an author role, they cannot create any new categories. They can only choose an existing category and create new tags for their posts. They can view all the comments including the ones which are awaiting moderation from the admin but, they cannot alter, moderate, approve or delete any comments.
The author does not have the freedom to change the theme, plugin and other settings of the website.
The biggest disadvantage or fear of assigning an author role is, even after publishing the posts, they can delete any of their posts. While it is not a major issue for many but, it can create a problem in some instances. Like, an author can delete the posts after publishing them, even if they are paid for this task or, may delete their posts after resigning from your company. The consequences of such situations cannot be imagined and can be dangerous for your website.
Thus, it is always better to keep a WordPress backup for your website.
In this post, we would also see how to resolve this issue by restricting an author from deleting a post.
As the name suggests, an editor sits at the top position of handling the content of your website. Thus, a user with an editor role can do anything with the content of your website. They have access to add, edit, publish and delete any posts on your WordPress website. This includes all the posts, even the ones written by others (Author, Contributor, Admin). An editor can view all the comments and also moderate, alter, and delete them as well.
Having access to all the content aspects of the website, the editor cannot change the site’s settings, remove or change plugins or add any new users.
An administrator role is the most dominant role and is mainly reserved for the site owners only.
As an administrator, the user can add, edit and delete any post on the website. This includes posts by editors, authors, and contributors as well.
A user with an administrator (abbreviated as admin) role can change the structure of the website including its theme, plugins, and other user settings. An administrator is the only user which can create new users and modify and delete any existing ones including other administrators also.
An administrator’s role provides the user with a full hold over the website and thus regarded as the most powerful role of a WordPress website.
The biggest concern while assigning the admin role is when you are working in a multi-partner WordPress website. In such a case, you should always have the proper legal documents to prevent any future dispute.
WordPress uses MySQL as its main DBMS. It stores and fetches almost all of its information including user-profiles and credentials and post contents etc., in MySQL databases. MySQL being open-sourced and a part of LAMP development stacks turns out to be the default database choice for WordPress.
WordPress's general setting is used to set the basic configuration settings for your site. In the setting administration screen, it is a default setting screen.
Following are the steps to access the general settings −
A plugin is a piece of software containing a group of functions that can be added to a WordPress website. They can extend functionality or add new features to your WordPress websites.
WordPress plugins are written in the PHP programming language and integrate seamlessly with WordPress. In the WordPress community, there is a saying that goes around: “there’s a plugin for that”. They make it easier for users to add features to their website without knowing a single line of code.
As a site administrator, you can install/uninstall plugins from the admin area. You can also download and manually install them using an FTP client.
Permalinks are the permanent URLs to your individual pages and blog posts, as well as your category and tag archives. A permalink is the web address used to link to your content. The URL to each post should be permanent and never change — hence the name permalink.
Custom fields also referred to as post meta, are a feature in WordPress which allows users to add additional information when writing a post. WordPress stores this information as metadata. Users can display this metadata by using template tags in their WordPress themes.
Examples of custom fields can be:
Yoast SEO is the best WordPress SEO plugin on the market. It offers a complete website optimization tool that helps you improve your website.
It lets you easily add SEO titles and descriptions to all posts and pages on your website. You can also use it to add Open Graph metadata and social media images to your articles.
Yoast SEO automatically generates an XML sitemap for all your website content which makes it easier for search engines to crawl your website. It also helps you easily import your SEO data if you have been using another other SEO plugins
To do that, go to Settings » Discussion from the left sidebar of your WordPress admin panel. On this page, you need to uncheck the option that says “Allow people to post comments on new articles” and then click on the Save Changes button to store your settings. This will disable comments on all your future posts.
The WordPress Importer will import the following content from a WordPress export file:
A taxonomy within WordPress is a way of grouping posts together based on a select number of relationships. By default, a standard post will have two taxonomy types called Categories and Tags which are a handy way of ensuring related content on your website is easy for visitors to find. These two types of taxonomies are included in WordPress by default, but just like any other taxonomy, can be removed or changed and you can even add more if you like. you can create your own taxonomies for use on your website or blog with a small amount of code.
WordPress has a built-in object class for dealing with database queries. It’s called wpdb and it’s found in the includes/wp-db.php file. When you’re running queries you should always use this class to execute them. To use this class you first need to define $wpdb as a global variable before you can use it. Just place this line of code before every $wpdb function:
Within your wpdb functions, you should use the prepare() function. This secures your query, preventing SQL injections.
$wpdb->query – any query function
The $wpdb->query method is used mainly for SELECT and DELETE statements but can actually be used for any SQL statement.
$wpdb->query($wpdb->prepare ("DELETE FROM $wpdb->custom_table WHERE ID = 1" ));
In WordPress, all objects are passed by value.
When browsing different web sites, you may notice that many users have a picture next to their name. These pictures are called “avatars.” WordPress, however, uses a specific type of avatar called “Gravatars“–short for “Globally Recognized Avatar.” ... WordPress integrates Gravatars into every WordPress site.
It allows developers to store additional information about registered users in the WordPress database.
A child theme is a theme that “get the functionality and styling of another theme, called the parent theme.” Child themes are recommended to modify existing themes while still maintaining their design and code.
These themes provide a way for designers or developers to create new designs that inherit the functionality of a parent theme. For us at Woo, that means we can release a bunch of fresh new designs that are all based on our robust and reliable WooCommerce parent theme.
A cookie is a text-only string of information that a website transfers to the cookie file of the browser on your computer's hard disk so that the website can recognize you when you revisit and remember certain information about you. This can include which pages you have visited, the choices you have made from menus, any specific information you have entered into forms and the time and date of your visit. There are two main types of cookies:
Session cookies: these are temporary cookies that expire at the end of a browser session; that is when you leave the site. Session cookies allow the website to recognize you as you navigate between pages during a single browser session and allow you to use the website most efficiently. For example, session cookies enable a website to remember that a user has placed items in an online shopping basket.
Persistent cookies: in contrast to session cookies, persistent cookies are stored on your equipment between browsing sessions until expiry or deletion. They, therefore, enable the website to "recognize" you on your return remember your preferences and tailor services to you.
In addition to session cookies and persistent cookies, there may be other cookies that are set by the website which you have chosen to visit, such as this website, in order to provide us or third parties with information.
You can use WordPress default functionality like global $wpdb to set a global variable
global $blog_pageId; $blog_pageId = 34;
Then one can call it by
$blog_pageId = get_blog_page_id();
WordPress is basically safe. It is created by a group of well-trained developers, which review the code every day. If they find a bug, they report it or fix it. So there is a chance, that every security issue will be fixed before somebody will try to use it.
WordPress Stores data in two locations
Posts and Pages are the two content types in WP.
Posts are timed and listed in chronological order with the latest posts at the top. Posts are meant to be shared and commented on.
Pages are static are static content, so an about us, contact us page, etc. They are permanent and timeless entries.
Hooks are functions that can be applied to an Action or a Filter in WordPress. These functions can be modified by theme and plugin developers to change the default WordPress functionality.
Two types of hooks:
Action Hooks are a very useful tool in WordPress and they are used to perform functions (actions) in specific places of a theme or plugin. Many themes and plugins, such as Total, use action hooks as an easy way for users to modify the output of the project or to add their own custom code.
Filters are passed code or markup by their filter hooks; they modify what they are passed, and must return the result back for WordPress to use in its regular processing. A Filter in WordPress allows you to get and modify WordPress data before it is sent to the database or the browser. Some examples of filters would include customizing how excerpts are displayed or adding some custom code to the end of a blog post.
The default table prefix is wp_ or WordPress.
The wp_head() function introduced in WordPress 1.2.0, it fires the wp_head action that adds data to the <head> tag.
There is 11 table in wordpress as :
‘Featured Image’ meta box that is not hidden by default on Post and Page screen.
In WordPress, template tags are PHP functions that are used to display information dynamically or customize the blog template.
Below is the list of some generally used template tags in WordPress:-
Function named get_site_url() is used to get website url in wordpress.
wp_title() function is for use outside the Loop to display the title Of a Page.
the_title() on the other hand is used within the Loop.
Get_page_by_path() function is quite handy in such a case that retrieves a page given its path.
next_posts_link() usually points to older entries (toward the end of the set) and previous_posts_link() usually points to newer entries (toward the beginning of the set).
$wp_session = WP_Session::get_instance() can use to get session in wordpress.
Both wp_reset_query() and wp_reset_postdata() reset the query object by restoring the global $post variable, but wp_reset_query takes it a step further and actually destroys the previous query before doing so.
__() and _e() are the simplest functions: they return or echo the translated string. Their usage should be obvious: one string, one translation.
The Loop is a PHP code used by WordPress to display posts. Using The Loop, WordPress processes each post to be displayed on the current page, and formats it according to how it matches specified criteria within The Loop tags. Any HTML or PHP code in the Loop will be processed on each post.
The Loop displays the following information by default for each post:
Tag is one of the pre-defined taxonomy in WordPress. Users can add tags to their WordPress posts along with categories. However, while a category may cover a broad range of topics, tags are smaller in scope and focused on specific topics. Think of them as keywords used for topics discussed in a particular post
To enable debugging mode, add the following line to the wp-config.php file: define('WP_DEBUG', true); When this setting is enabled, WordPress displays all PHP errors, notices, and warnings.
Wordpress is used by millions of non-English websites around the world. We can use WordPress to create a website in any language of our choice. TranslatePress is the considerably best multilingual plugin in WordPress. It is a full-fledged WordPress multilingual plugin to translate every aspect of our website. The main feature of TranslatePress is that it allows you to translate directly from the front-end.
We can improve security on a WordPress site following method:-
It is a WordPress Function used for localization. The function __( 'My Text', 'my-text-domain' ); assigns a string "My Text" that is translateable. 'my-text-domain' is the text-domain the string is referenced to. This function does not echo anything!
The function _e( 'My Text', 'my-text-domain' ); is almost the same but it echoes your string directly.
A shortcode is a WordPress-specific code that lets you do nifty things with very little effort. Shortcodes can embed files or create objects that would normally require lots of complicated, ugly code in just one line. Shortcode = shortcut.
Example of Shortcode :
[dailymotion], [flickr],[audio],[instagram],[gallary] etc
There is no limit to the number of posts or pages you can create in a free hosted WordPress.com blog. The support documentation is all found at the Support link
http://en.support.wordpress.com which is also on the bottom of your Admin page. You can create a custom menu and add Pages and sub-pages to it.