WordPress Training
WordPress Training
WordPress Training
● FSE
● Patterns
● FSE Theme creation
● Gutenberg
● Contribution
● Working with MD Prime theme ( Using class based method )
● Working with MD Prime Plugin ( Using class based method )
WordPress Theme & Plugin Overview
■ It separates the presentation styles and template files from the system files so the site will upgrade
without drastic changes to the visual presentation of the site.
■ It allows for customization of the site functionality unique to that Theme.
■ It allows for quick changes of the visual design and layout of a WordPress site.
■ It removes the need for a typical WordPress site owner to have to learn CSS, HTML, and PHP in order
to have a great-looking website.
Plugins
If there’s one cardinal rule in WordPress development, it’s this: Don’t touch WordPress core. This means that
you don’t edit core WordPress files to add functionality to your site. This is because WordPress overwrites core
files with each update. Any functionality you want to add or modify should be done using plugins.
WordPress plugins can be as simple or as complicated as you need them to be, depending on what you want
to do. The simplest plugin is a single PHP file. The Hello Dolly plugin is an example of such a plugin. The plugin
PHP file just needs a Plugin Header, a couple of PHP functions, and some hooks to attach your functions to.
Plugins allow you to greatly extend the functionality of WordPress without touching WordPress core itself.
Build a Simple WordPress website with Readymade theme and plugins so that
you can get overview about plugins,themes, shortcode (Ex. Contact form 7)
- Live Example
WordPress Templates overview (Live Demo)
- Page
- Post/Post detail
- Posts page (posts list)
- Category Archive
- Tags Archive
- Author page
https://codex.wordpress.org/Database_Description
Theme File Structure
Template structure:
https://i0.wp.com/developer.wordpress.org/files/2014/10/Screenshot-2019-01-23-00.20.04.png?ssl=1
Exercise / Practice
1. Different 2 footers , Different 2 headers , page header footer (Layout 1), Post - header footer
(layout 2)
2. Add 2 styles , 2 javascript ( Javascript in footer and styles in header)
3. Menu Register (3 menu 1 Header, 2 Footer, 3 Custom), Menu Display in Footer/header
4. Register Sidebar - Custom sidebar
5. Theme customizer settings explorer ( Add some settings for ex: to change color, Add Footer logo,
Add footer Copyright text and etc)
6. Learn about Child themes
Theme Development from scratch
● Go to Wp-content / themes
● Ref: https://codex.wordpress.org/Theme_Development
● Theme Stylesheet
/*
Theme Name: ABC
Theme URI: http://abc.com
Author: WordPress Trainees
Author URI: http://wordpress.org/
Description: This is theme description.
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: black, brown, orange, tan, white, yellow, light, one-column, two-columns, right-sidebar,
flexible-width, custom-header, custom-menu, editor-style, featured-images, microformats, post-formats,
rtl-language-support, sticky-post, translation-ready
Text Domain: cstm-domain
● do_action
● add_action
● apply_filters
● add_filter
● Arguments
● Priority
Hooks ( Actions & Filters )
Hooks are a way for one piece of code to interact/modify another piece of code at specific, pre-defined spots. They
make up the foundation for how plugins and themes interact with WordPress Core, but they’re also used extensively by
Core itself.
There are two types of hooks: Actions and Filters. To use either, you need to write a custom function known as a
Callback, and then register it with a WordPress hook for a specific action or filter.
Actions allow you to add data or change how WordPress operates. Actions will run at a specific point in the execution of
WordPress Core, plugins, and themes. Callback functions for Actions can perform some kind of a task, like echoing
output to the user or inserting something into the database. Callback functions for an Action do not return anything back
to the calling Action hook.
Filters give you the ability to change data during the execution of WordPress Core, plugins, and themes. Callback
functions for Filters will accept a variable, modify it, and return it. They are meant to work in an isolated manner, and
should never have side effects such as affecting global variables and output. Filters expect to have something returned
back to them.
WordPress provides many hooks that you can use, but you can also create your own so that other developers can
extend and modify your plugin or theme.
Admin menu-submenu pages/Options pages
add_menu_page( string $page_title, string $menu_title, string $capability,
string $menu_slug, callable $function = '', string $icon_url =
'', int $position = null )
https://developer.wordpress.org/reference/functions/add_menu_page/
https://developer.wordpress.org/reference/functions/add_submenu_page/
https://codex.wordpress.org/Creating_Options_Pages
Child Theme ( Self Study)
- https://developer.wordpress.org/themes/advanced-topics/child-themes/
Demo - Creating theme from scratch
https://codex.wordpress.org/Theme_Customization_API
https://developer.wordpress.org/themes/customize-api/
Exercise / Practice
https://developer.wordpress.org/reference/functions/add_shortcode/
https://developer.wordpress.org/reference/functions/do_shortcode/
https://codex.wordpress.org/Shortcode_API
https://developer.wordpress.org/reference/functions/register_post_type/
https://wordpress.org/support/article/post-types
https://developer.wordpress.org/reference/functions/register_taxonomy/
https://wordpress.org/support/article/custom-fields/
https://developer.wordpress.org/plugins/metadata/custom-meta-boxes/
https://developer.wordpress.org/reference/functions/add_meta_box/
https://developer.wordpress.org/themes/basics/template-hierarchy/
https://wphierarchy.com/
WP Query, Meta Query, get/set_options
https://developer.wordpress.org/reference/classes/wp_query/
https://developer.wordpress.org/reference/functions/get_option/
https://developer.wordpress.org/plugins/intro/
https://wppb.me/
REST API
https://developer.wordpress.org/rest-api/
https://wp-cli.org/
https://make.wordpress.org/cli/handbook/guides/installing/
WordPress Multisite
https://wordpress.org/support/article/create-a-network/
Plugins/Themes in multisite