| 1 |
1. Dashboard Overview |
| 2 |
++++++++++++++++++++++++++++++++++++++++++ |
| 3 |
Log in: |
| 4 |
- yoursite/wp-admin/; |
| 5 |
- enter username and password; |
| 6 |
- tick 'Remember me' if i'm going to use non-public computer (for automatically logging in); |
| 7 |
- if i forget my password, click on 'Lost your password?', then enter your email or username, so i'll get a new password on my email. |
| 8 |
------------------------------------------------------------------------------------ |
| 9 |
------------------------------------------------------------------------------------ |
| 10 |
Admin Bar: |
| 11 |
- it's a dark-grey menu that appears across the top of the dashboard; |
| 12 |
- it also appears across the top of the site itself, when you're logged in (not visible to public visitors). |
| 13 |
- if hover over the top-left icon of the admin bar, it appears 5 links: |
| 14 |
a) about wordpress; |
| 15 |
b) wordpress.org -- links to the main wordpress site which contains downloads and documentation for the wordpress application; |
| 16 |
c) documentation -- links to the wordpress Codex, which is the official documentation for wordpress; |
| 17 |
d) support -- links to official forum support area of wordpress.org; |
| 18 |
e) feedback -- links to the support forum on wordpress.org that is dedicated to requests and feedback. |
| 19 |
------------------------------------------------------------------------------------ |
| 20 |
Home icon: |
| 21 |
- click on the home icon, then it takes you to your homepage site |
| 22 |
- click again, takes you back to Dashboard |
| 23 |
- maybe it's useful to keep them in different tabs |
| 24 |
------------------------------------------------------------------------------------ |
| 25 |
Notification icons: |
| 26 |
- there are two Notification icons |
| 27 |
- Comments icon's always visible, click on this takes you to Comments |
| 28 |
- Update icon's visible only then, when appeared some updates of plugins, themes or wordpress core files |
| 29 |
- if hover over +New, it brings up submenu: |
| 30 |
a) post |
| 31 |
b) media |
| 32 |
c) page |
| 33 |
d) user |
| 34 |
e) actual visible content depends on user's role |
| 35 |
------------------------------------------------------------------------------------ |
| 36 |
User Name and Avatar: |
| 37 |
- in the right-top corner |
| 38 |
- click on either 'your name' or 'edit my profile' takes you to the edit profile page. |
| 39 |
- click on 'log out' log you out. |
| 40 |
------------------------------------------------------------------------------------ |
| 41 |
Below the admin bar just two tabs: |
| 42 |
- Screen Options |
| 43 |
- Help |
| 44 |
------------------------------------------------------------------------------------ |
| 45 |
Screen Options Tab: |
| 46 |
- they appear on most administrative pages (more confident to control elements) |
| 47 |
- they can look different from other users who logged in the dashboard |
| 48 |
------------------------------------------------------------------------------------ |
| 49 |
Help Tab: |
| 50 |
- contains information about current page |
| 51 |
- in it 'overview' which gives relevant information about current page |
| 52 |
------------------------------------------------------------------------------------ |
| 53 |
------------------------------------------------------------------------------------ |
| 54 |
Page Body: |
| 55 |
------------------------------------------------------------------------------------ |
| 56 |
Dashboard: |
| 57 |
- some administrative widgets and panels |
| 58 |
- they can be shown and hidden using the checkboxes in 'screen options' |
| 59 |
- widgets's position can be changed by dragging and dropping them |
| 60 |
- dashboardview depends on plugins you have acitve, hosting company, personal configuration |
| 61 |
------------------------------------------------------------------------------------ |
| 62 |
A number of widgets of Dashboard: |
| 63 |
- At a glance: |
| 64 |
a) this widget gives information about a number of posts, pages and comments on your site |
| 65 |
b) it displays title of current theme |
| 66 |
c) at a glance will note if search engines are discouraged from indexing the site |
| 67 |
- Quick Draft: |
| 68 |
a) everything (title and content) will be saved as a draft post, so won't be published on your site |
| 69 |
b) a link of saved post will be underneath this form |
| 70 |
c) it's for handy jotting down, so for curren ideas which you can note, but finish later |
| 71 |
- Activity: |
| 72 |
a) shows you most recent posts and comments, linked to the respective editors |
| 73 |
WordPress Events and News: |
| 74 |
- it's obvious |
| 75 |
------------------------------------------------------------------------------------ |
| 76 |
------------------------------------------------------------------------------------ |
| 77 |
Left Sidebar: |
| 78 |
- the most common way of moving around in the admin area is by using the navigation links in the left sidebar. |
| 79 |
- posts, pages and comment are used a lot more frequently. |
| 80 |
- when there are items in sub-menu, they are displayed in dynamic fly-out menus. |
| 81 |
- after you've clicked on a menu item with sub-menus, the submenus will be displayed in the sidebar under parent menu. |
| 82 |
- the menu item in the sidebar can vary, depending on role of user |
| 83 |
a) author can't see any of menu items that are unrelated to editing posts and pages |
| 84 |
b) administrator sees everything |
| 85 |
- plugins add items to menu, that are controlled by the plugin author in position |
| 86 |
------------------------------------------------------------------------------------ |
| 87 |
Posts list: |
| 88 |
- in WP lost of collection of items in a tabular format, but some plugin authors aren't (it can be confusing) |
| 89 |
- if click on the title of a post, it will open in the editor |
| 90 |
- if hover over any title, it appear some links: |
| 91 |
a) Edit: the same as click on the title |
| 92 |
b) Quick edit: allows to change much of meta-information about the post, without opening it in the editor. i can quickly change the post's categories, tags and several other items. |
| 93 |
c) Trash: moves the post to the trash. i can recover is for up 30 days, unless i've intentionally deleted it there or WP's designated different length of time. |
| 94 |
d) Preview: links to the publicly visible post on the site. |
| 95 |
- next to titles we can use checkboxes to perform actions on multiple items: |
| 96 |
a) Edit -- like 'Quick edit', but on all ticked items simultaneously |
| 97 |
b) Move to Trash |
| 98 |
c) after selecting 'edit' or 'move to trash' we have to click 'apply'. |
| 99 |
- links above the table (after clicking) will filter: All, Published, Draft, Trash or Private (not always all links) |
| 100 |
------------------------------------------------------------------------------------ |
| 101 |
Post list > Trash: |
| 102 |
- acceptable underneath links 'Restore' and 'Delete Permanently' |
| 103 |
------------------------------------------------------------------------------------ |
| 104 |
Post list: |
| 105 |
- we can also filter posts by 'dates' (month and year) or 'categories' |
| 106 |
- Screen Options > Pagination: allows you to control a number of posts per page |
| 107 |
- you can search for words of phrases in 'Search Posts' that may be contained in your posts. any posts with needed words will be displayed |
| 108 |
------------------------------------------------------------------------------------ |
| 109 |
Pages List: |
| 110 |
- it's similar to 'Post list', but has fewer columns. |
| 111 |
- simpler pages list vs post list |
| 112 |
------------------------------------------------------------------------------------ |
| 113 |
Media library: |
| 114 |
- can display items in a grid view, as thumbnails only, or a list view, which is more like the page and post lists. |
| 115 |
- the only bulk action for media library is 'delete permanently'. |
| 116 |
- a column (in a list view) that's unique to media library is 'uploaded to' |
| 117 |
a) this tells you on which page or list a particular item is being used (via 'attached') |
| 118 |
------------------------------------------------------------------------------------ |
| 119 |
'Tools' and 'Settings': |
| 120 |
- in left-hand sidebar |
| 121 |
- content are dependent upon role user and plugins which are installed on the site. |
| 122 |
------------------------------------------------------------------------------------ |
| 123 |
Conclusion: |
| 124 |
- if view of the Dashboard is different from standard, it's because of bad plugins |
| 125 |
------------------------------------------------------------------------------------ |
| 126 |
++++++++++++++++++++++++++++++++++++++++++ |
| 127 |
2. Pages vs Posts |
| 128 |
++++++++++++++++++++++++++++++++++++++++++ |
| 129 |
------------------------------------------------------------------------------------ |
| 130 |
- pages are static: once you make it, the page stays in one spot until you physically change it |
| 131 |
- posts are dynamic: it can be used and shown in many different ways (in a blog page, shared on a social media and so on) |
| 132 |
------------------------------------------------------------------------------------ |
| 133 |
Post |
| 134 |
- Visibility: |
| 135 |
a) Public -- can see everyone |
| 136 |
b) Private -- only administrator and editors |
| 137 |
c) Password Protected -- only viewers who know password can see post |
| 138 |
- Publish: |
| 139 |
a) immediately |
| 140 |
b) schedule a post |
| 141 |
- Permalink: shows a link of your current post |
| 142 |
- Tags |
| 143 |
- didn't understand about visibility part of post, like summary |
| 144 |
------------------------------------------------------------------------------------ |
| 145 |
Page |
| 146 |
- Visibility: the same as Post |
| 147 |
- Publish: the same as Post |
| 148 |
- Pages don't have tags or categories |
| 149 |
- you can change the template |
| 150 |
- you can use a menu to make you pages stand out for readers, or you can use the pages widget. |
| 151 |
- some themes show pages in tabs at the top of a blog |
| 152 |
- here are some popular uses for pages: |
| 153 |
a) category page |
| 154 |
b) contact page |
| 155 |
c) about page |
| 156 |
d) home page |
| 157 |
------------------------------------------------------------------------------------ |
| 158 |
Post |
| 159 |
- as discussed earlier, posts are a bit different from pages |
| 160 |
- posts can be found in archives, categories, recent posts, various widgets and RSS feeds of your blog |
| 161 |
- you can create a sticky post, which means that the post will show before all other posts. |
| 162 |
- you can limit the number of posts shown by going to Dashboard > Settings > Reading > Blog pages show at most |
| 163 |
- you can display them on your site in different ways, such as by using the 'blog posts block' or by setting a posts page at 'customize > homepage settings' |
| 164 |
------------------------------------------------------------------------------------ |
| 165 |
Convert Post to Page (Vice Versa) |
| 166 |
a) in page or post editor > options > copy all content |
| 167 |
b) in new page or post editor > options > Code editor (ctrl+alt+shift+M), then Ctrl+V |
| 168 |
------------------------------------------------------------------------------------ |
| 169 |
How to post to a page (3 methods) |
| 170 |
a) insert the blog posts block |
| 171 |
b) designate a posts page at customize > homepage settings |
| 172 |
c) use 'category pages' to show posts with a specific category only |
| 173 |
------------------------------------------------------------------------------------++++++++++++++++++++++++++++++++++++++++++ |
| 174 |
Blocks > Blog Posts Block |
| 175 |
++++++++++++++++++++++++++++++++++++++++++ |
| 176 |
------------------------------------------------------------------------------------ |
| 177 |
- The 'blog posts block' allows you to insert a list or gird of up to 100 blog posts on any page. |
| 178 |
- you can choose to show posts based on category, author, or tag, display featured images or excerpts, change the text color, and more |
| 179 |
- the 'blog posts block' is replacing the 'blog listing block'. if you still have the 'blog listing block' on your site, you'll see an option to upgrade to the 'blog posts block' |
| 180 |
------------------------------------------------------------------------------------ |
| 181 |
Add the 'blog posts block' |
| 182 |
- can't find 'blog posts' in blog (perhaps it's old-fashioned) |
| 183 |
------------------------------------------------------------------------------------ |
| 184 |
++++++++++++++++++++++++++++++++++++++++++ |
| 185 |
WordPress Editor: Working With Blocks |
| 186 |
++++++++++++++++++++++++++++++++++++++++++ |
| 187 |
------------------------------------------------------------------------------------ |
| 188 |
- WP Editor is what you'll use to create the pages and posts on your website |
| 189 |
- WP Editor is made up of 3 main areas: |
| 190 |
a) the top menu |
| 191 |
b) sidebar menu |
| 192 |
c) main content area |
| 193 |
------------------------------------------------------------------------------------ |
| 194 |
WP Editor Top menu |
| 195 |
- Add blocks -- browse all of the available blocks, block patterns and reusable blocks |
| 196 |
- Modes -- tools offer different interactions for block selection and editing. |
| 197 |
- Undo and Redo -- undo an action, or redo an undone action |
| 198 |
- Details -- the number of characters, words, headings, paragraphs, and blocks used in the document |
| 199 |
- Outline -- a list view of all of the blocks used on the page. Useful for navigating to different blocks. |
| 200 |
- Before you've published page or post, you'll see these options: |
| 201 |
a) Save draft -- save a draft of your page or post |
| 202 |
b) Preview -- see what your page|post looks like with the theme applied |
| 203 |
c) Publish -- publish your page|post |
| 204 |
- After you've published your page or post, you'll see these options: |
| 205 |
a) Switch to draft -- unpublish a page or post and switch it to a draft |
| 206 |
b) Preview -- like 'before you've published' |
| 207 |
c) Update -- update your published page|post with the newly added content |
| 208 |
- Settings -- display or hide the Page, Document, and Block Settings sidebar menu (hide only Block Settings sidebar menu) |
| 209 |
- Global Styles -- it allows change font of your entire site (it's not on all themes) |
| 210 |
- Options -- opens View options, Editor style, and additional tools |
| 211 |
------------------------------------------------------------------------------------ |
| 212 |
++++++++++++++++++++++++++++++++++++++++++ |
| 213 |
How to create Reusable Blocks |
| 214 |
++++++++++++++++++++++++++++++++++++++++++ |
| 215 |
------------------------------------------------------------------------------------ |
| 216 |
- if you often use the same content blocks in your WP, Reusable Block can help you |
| 217 |
- it allows you to save blocks and use them in other posts, pages and even export on other sites |
| 218 |
- a reusable block in WP editor is a content block that you create, save and reuse later |
| 219 |
- if you want to create social icons, call-to-action, thank you note, feedback forms, tables or any type of banner |
| 220 |
- Example |
| 221 |
a) create any block |
| 222 |
b) highlight and click on Kobra menu (on centre top) |
| 223 |
c) Add to Reusable blocks |
| 224 |
d) we can do same with groupped several blocks. |
| 225 |
e) perhaps, current theme doesn't allow to give title's Reusable blocks, but we can do it in Add block > Reusable > Manage all reusable blocks |
| 226 |
f) don't forget about 'Convert to Regular blocks' (if i don't convert it, changes will be globally) |
| 227 |
g) you can manage (add, edit, view, delete) all your Reusable Blocks: |
| 228 |
- simply visit Kobra menu on the right most in the toolbar |
| 229 |
- click on it > manage all reusable blocks |
| 230 |
- or 'add block' > reusable > manage all reusable blocks |
| 231 |
------------------------------------------------------------------------------------ |
| 232 |
Exporty-import Reusable Block to use into other WP websites |
| 233 |
- Go to 'manage all reusable blocks' > hover on needed block > expor as JSON |
| 234 |
- go to the website where you want to import > on the page 'Manage all Reusable blocks' > Import from JSON |
| 235 |
- after importing file you can use reusable block on a new website |
| 236 |
------------------------------------------------------------------------------------ |
| 237 |
++++++++++++++++++++++++++++++++++++++++++ |
| 238 |
How to create a Post or Page with the WP Block Editor |
| 239 |
++++++++++++++++++++++++++++++++++++++++++ |
| 240 |
------------------------------------------------------------------------------------ |
| 241 |
- with blocks, you can quickly add and customize multiple media and visual elements that used to require shortcodes, custom HTML code, and embeds |
| 242 |
- blocks make it easier to create media-rich layouts on your pages and posts |
| 243 |
------------------------------------------------------------------------------------ |
| 244 |
++++++++++++++++++++++++++++++++++++++++++ |
| 245 |
High-level overview |
| 246 |
++++++++++++++++++++++++++++++++++++++++++ |
| 247 |
------------------------------------------------------------------------------------ |
| 248 |
Advantages of self-hosting |
| 249 |
- control: from the very beginning you choose where your site lives, what it looks like, how it is configures, and what it can do. |
| 250 |
- if you become unhappy with your current host, you can easily pack up and move your site somewhere else |
| 251 |
- flexibility: wordpress.com offers only a handful of themes, but there are nearly 5000 themes in the WordPress.org repository |
| 252 |
- when you want to add to the functionality of your wordpress site, there are almost 50000 plugins there as well, almost all of them free |
| 253 |
- Community: because WP has its roots in open source, there's a huge community of people contributing to its development and sharing their knowledge |
| 254 |
- you'll find a multitude of blogs, forums, and classes like this one devoted to helping users at all levels. |
| 255 |
- A thriving marketplace: lots of professionals deliver servises to site owners |
| 256 |
------------------------------------------------------------------------------------ |
| 257 |
WordPress Permissions |
| 258 |
- there are levels of permissions that allow site visitors and administrators to access different parts of a WordPress site |
| 259 |
- in most cases, visitors who arrive at a site by clicking a link or typing the site's url into their browser are known as Anonymous users. |
| 260 |
- they see only the front end, or public-facing part of the site, which allows them by default to view the posts and pages. |
| 261 |
- if they have an account on the site (in other words, they have a username and password), they can be given varying levels of access to the WordPress administration panel beyond reading site content. |
| 262 |
- Roles: |
| 263 |
a) Subscriber -- sb who can only manage profile |
| 264 |
b) Contributor -- sb who can write and manage their own posts, but can't publish them |
| 265 |
c) Author -- sb who can publish and manage their own posts |
| 266 |
d) Editor -- like author, but can manage of other ones |
| 267 |
e) Administrator -- sb who has access to all of the administration features within a single site |
| 268 |
f) Super Admin (multi-site installations only) -- sb with access to the site network administration features and all other features |
| 269 |
g) when you install the single-site version, you'll automaticalle be assigned to the administrator role, having full control of the site and access to all of the administrative pages |
| 270 |
h) if you choose to add more users you can assign them to whatever role is appropriate. |
| 271 |
------------------------------------------------------------------------------------ |
| 272 |
WordPress Building Blocks |
| 273 |
1. WordPress Core |
| 274 |
- the WP core consists of all of the files that make up the WP application |
| 275 |
- these files are placed on a server computer, which may or may not be attached to the internet |
| 276 |
- for the purposes of this discussion, let's assume that the server is on a hosting service |
| 277 |
- you can obtain these files in a couple of ways: download from official site or click install on a hosting |
| 278 |
- WP is written in a programming language called PHP |
| 279 |
- that's why many of the core files have the .php file extension |
| 280 |
- except in very unusual cases, you should never edit the core files |
| 281 |
- when you want to make changes to the way WP behaves, it should be done by editing your site's theme - or preferably child theme - files. |
| 282 |
------------------------------------------------------------------------------------ |
| 283 |
2. Database |
| 284 |
- all of the data about your site, including all text content, is stored in MySQL database |
| 285 |
- this database is automatically created when you use a one-click install. |
| 286 |
- if you're uploading the core files yourself, you will also need to create this database and enter information about it inton a special configuration file, called wp-config.php, in the root directory of your installation. |
| 287 |
- making changes to this file is one of the few exceptions to the 'never edit the core files' rule |
| 288 |
- if you suspect a problem with your WP database and haven't worked with databases before, it's probably best to contact your hosting service's tech support department for assistance |
| 289 |
------------------------------------------------------------------------------------ |
| 290 |
3. Theme |
| 291 |
- everything about the way your WP site appears in the browser, including its layout, colors and fonts, is controlled by its theme. |
| 292 |
- there are thousands of themes available around the web, both free and paid. |
| 293 |
- if you're going to use a free theme, i recommend using the official theme repository on wordpress.ord |
| 294 |
- the reason is that all of the themes there have been reviewed against a set of guidelines that include code quality, security, licensing, and documentation. |
| 295 |
- it's not unfortunate but true that some free themes that don't come from wordpress.org have been purposely infected with malware or hame simply been coded insecurely. |
| 296 |
- in the theme repository, you can search for themes by color, the number of columns, layout, and features |
| 297 |
- you can browse the most popular or newest themes |
| 298 |
- use a theme, it must be installed and activated |
| 299 |
- this is easily done from the 'Themes menu' of the WP administration area |
| 300 |
- once a theme is activated, it may include features such as changing colors or layouts |
| 301 |
- the documentation for the theme will describe all of these options |
| 302 |
- there's nothing wrong with trying out as many themes as you like before settling on the best one for your site |
| 303 |
- there's also subset of themes known as child themes |
| 304 |
- a child theme inherits the functionality of another one, called the parent theme |
| 305 |
- child themes allow you to modify or add to the functionality of the parent |
| 306 |
- a child theme can be created from any theme and using one will prevent changes that you make from being lost if you update the parent theme |
| 307 |
- if you're using a child theme, note that both child and parent themes need to be installed, but that only the child will be activated |
| 308 |
------------------------------------------------------------------------------------ |
| 309 |
4. Plugins |
| 310 |
- if themes control how your site looks, plugins control what it does |
| 311 |
- plugins are software modules that work with the WP core to make your site do everything from e-commerce to photo slideshows |
| 312 |
- as with themes, the best place to find free plugins is in the WP.org plugin repository |
| 313 |
- you can search for the type of plugin that you're looking for and read descriptions and reviews of those available |
| 314 |
- a few suggestions on selecting plugins: |
| 315 |
a) look for those with large numbers of positive reviews |
| 316 |
b) a plugin with a 5-star rating and 100 downloads may not be as good as a one with a 4-star rating and 100 000 downloads |
| 317 |
c) look for those that are compatible with the current version of WP and have a recent 'last updated' date. that indicates that the plugin is under active development |
| 318 |
d) click the 'support' link and see what kind of problems users are reporting |
| 319 |
e) all software has bugs, but make sure that the plugin you're planning to use isn't crippled by them |
| 320 |
- some plugins are built on a freemium model. this means that a basic version of the plugin is provided for free, but that more advanced or add-on features are available for a fee |
| 321 |
- make sure that you read the descriptions carefully to see what, if any, paid features you will want to use |
| 322 |
- like themes, you can always try out multiple plugins before settling on one that best meets your needs |
| 323 |
------------------------------------------------------------------------------------ |
| 324 |
5. Domains |
| 325 |
- to host your own WP site, you'll need a domain name |
| 326 |
- these are the unique names that end in .com, .org, .net, or any the other available extensions |
| 327 |
- these extensions are actually called 'top-level domains' (TLD) |
| 328 |
- domains are registered and managed through companies called domain registrars |
| 329 |
- every domain name must be unique, which is why it can be so hard to find one that is short and memorable in the most common TLDs |
| 330 |
- recently, a whole slew of new tlds have been created including .computer, .dating, .gift, .pizza |
| 331 |
- most people try and stick with .com, especially for a business, because it's what people are most used to and find easiest to remember |
| 332 |
- once you find an available domain name, you'll need to register it. |
| 333 |
- during this process, you'll be asked to designate four contacts: |
| 334 |
a) registrant |
| 335 |
b) admin |
| 336 |
c) technical |
| 337 |
d) billing |
| 338 |
- these can all be the same person or different people |
| 339 |
- registrant and admin are the most important because they have the most control over the domain registration record and the approval process for how the domain is used |
| 340 |
- the other important setting in the domain registration is for the nameservers used by the domain |
| 341 |
- nameservers are computers on the internet that act like address books, mapping domain names to the address of computers that host services like websites and email |
| 342 |
- when you first register a name, it will use the nameserver of the domain registrar itself. |
| 343 |
- at this point, if you type the domain name into a browser, you'll probably get a 'this page under construction' page, branded with the registrar's name and logo |
| 344 |
- if the company you've registered with is also your webhosting company, you may not need to change the nameservers |
| 345 |
- however, if the companies are different, you'll need to change the nameservers (there are always at least 2 of them for redundancy) to those of the company where your WP site is hosted |
| 346 |
- make sure that you write down the account access information for your domain registrar |
| 347 |
- the information there tends to be of the set-and-forget type, people often lose track of their username and password or change email address without updating it at the registrar. |
| 348 |
- eventually, you'll need to log back into this account and there's nothing more frustrating than trying to retrieve the password for an account that was set up by someone whose email address no longer exists. |
| 349 |
------------------------------------------------------------------------------------ |
| 350 |
6. Web Hosting |
| 351 |
- Web Hopsting companies provide space on their computers for the files and databases that make up most websites, including your WP site. |
| 352 |
- these computers are usually located in large data centers with multiple power sources and large networks connecting them to the internet |
| 353 |
- there are two main types of hosting services: shared hosting and dedicated hosting |
| 354 |
- shared hosting is the most common configuration since it's the least expensive, and means that you share computer hardware with many other websites but that all of these sites are all kept separate by special software |
| 355 |
- no one is able to access anyone else's site |
| 356 |
- each shared hosting account has its own 'control panel' that lets you control various aspects of your site |
| 357 |
- this is where the 'one-click install' for WP is found, provided that the hosting company offers it |
| 358 |
- 'dedicated hosting' means that your website is hosted on a computer that has the sole function of hosting your website. |
| 359 |
- with a dedicated server, you don't share hardware with other websites |
| 360 |
- when selecting a web hosting company, it's a good idea to go online and look for reviews about the different companies. |
| 361 |
- you want to choose one that's in your price range but that also has a good reputation for customer service and performance |
| 362 |
- once you have a web host with WP installed and a domain name that is pointed to the hosts nameservers, you're online |
| 363 |
- you can then move on to the actual business of setting up your self-hosted WP site. |
| 364 |
------------------------------------------------------------------------------------ |
| 365 |
++++++++++++++++++++++++++++++++++++++++++ |
| 366 |
WordPress Features |
| 367 |
++++++++++++++++++++++++++++++++++++++++++ |
| 368 |
------------------------------------------------------------------------------------ |
| 369 |
- WP is a powerful semantic publishin platform, and it comes with a great set of features designed to make your experience as a publisher on the internet as easy, pleasant, and appealing as possible |
| 370 |
- WP organize your content by date, by month, by year, by author, by category. |
| 371 |
- WP intelligently convert web-unfriendly characters like quotes, apostrophes, ellipses, em and en dashes, multiplication symbols, and ampersands into typographycally correct HTML entities. |
| 372 |
- WP uses wordpress.com's 20 million users to beta test releases before they come out, so that by the time new versions are released, stakeholder can be confident in their stability. |
| 373 |
- WP supporst an extended version of the Blogger API, MetaWeblog API, and finally the Movable Type API |
| 374 |
------------------------------------------------------------------------------------ |
| 375 |
Moderation |
| 376 |
- for the control freak in all of us, WP provides an array of moderation options. you can moderate: |
| 377 |
a) all comments before they appear on the blog |
| 378 |
b) comments with specific words in them |
| 379 |
c) comments posted from specific IP addresses |
| 380 |
d) comments containing more than some specified number of links |
| 381 |
- all these moderation options keep spammers and vandals in check |
| 382 |
- WP can keep you in the loop by sending you an email each time there's a new comment or a comment awaiting moderation |
| 383 |
------------------------------------------------------------------------------------ |
| 384 |
++++++++++++++++++++++++++++++++++++++++++ |
| 385 |
Content Creation in WordPress using Gutenberg |
| 386 |
++++++++++++++++++++++++++++++++++++++++++ |
| 387 |
------------------------------------------------------------------------------------ |
| 388 |
- paragraph is a default block |
| 389 |
- | backslash for quicker to choose a block |
| 390 |
- we can change just media into media&text |
| 391 |
- Remove block (delete; shift+alt+z) |
| 392 |
- if you click on any block, it's highlighted tab 'block' |
| 393 |
- if you click outside any block, it's highlighted tab 'post' |
| 394 |
- path in address bar is created by title's page or post, but we can change it in Post > Permalink |
| 395 |
- pullquote is useful |
| 396 |
- Cover block allows to type on any image: |
| 397 |
a) we can fixed background (lift's effect) |
| 398 |
- block Column (useful) |
| 399 |
- block Table (useful) |
| 400 |
- we can type, for instance, carousel (it will find in 'add block', although it doesn't have in gutenberg editor) |
| 401 |
------------------------------------------------------------------------------------ |
| 402 |
++++++++++++++++++++++++++++++++++++++++++ |
| 403 |
How to use WordPress patterns |
| 404 |
++++++++++++++++++++++++++++++++++++++++++ |
| 405 |
------------------------------------------------------------------------------------ |
| 406 |
Lesson Overiview |
| 407 |
- Review what the block editor is, and what block patterns are for |
| 408 |
- Demonstrate how to find, add, and modify a block pattern |
| 409 |
- Clarify the use cases for block patterns vs reusable blocks |
| 410 |
- have participants complete the exercises to practice adding and modifying block patterns |
| 411 |
------------------------------------------------------------------------------------ |
| 412 |
Example lesson |
| 413 |
- in the block editor, block patterns are predefined groups of blocks that you can insert into posts, pages, or custom post types |
| 414 |
- block patterns include individual blocks - like the paragraph block, button block, or image block - that are then grouped together into a predefined layout |
| 415 |
- you can use block patterns with individual blocks when writing a post or page for your site |
| 416 |
- block patterns can be inserted wherever the block editor is used |
| 417 |
- by default, block patterns are available for posts and pages |
| 418 |
- add a block pattern, click on the + icon (inserter) and open the Patterns tab. they're organised into: |
| 419 |
a) Buttons -- add predefined|designed buttons to a post a page |
| 420 |
b) Columns -- add predefined columns to a post a page |
| 421 |
c) Gallery -- add a gallery of images |
| 422 |
d) Headers -- for cover or header image styles |
| 423 |
e) Text -- for pre-formatted text options |
| 424 |
f) Themes -- may add specific types of patterns as well |
| 425 |
- browse available block patterns, click on the drop-down menu in the inserter to navigate to the type of block pattern you would like to insert |
| 426 |
- example, if you'd like to add columns to your post or pages, click on the Columns block pattern group from the drop-down menu |
| 427 |
- once, you've navigated to the block pattern type that you'd like to use, click directly on the block pattern |
| 428 |
- this will insert it into the post or page |
| 429 |
- when a block pattern is inserted, it includes some default text and images, if applicable |
| 430 |
- this is designed to be changed |
| 431 |
- customize the block pattern, you can edit or replace text and images just like in any other block |
| 432 |
- to edit the block, click directly on the part you'd like to edit |
| 433 |
- if there's an image included in the block pattern you're using, clicking on the image will display a toolbar with a number of options to replace or edit the content |
| 434 |
- once you've updated all the relevant portions of the block pattern you selected, you can continue to edit your post or page normally. |
| 435 |
- you can add as many block patterns to a post or page as you'd like by following this same process |
| 436 |
------------------------------------------------------------------------------------ |
| 437 |
Block Patterns vs. Reusable Blocks |
| 438 |
- if block pattern are pre-defined and re-usable, what's the difference between block patterns and reusable blocks? |
| 439 |
- Reusable blocks: |
| 440 |
a) reusable blocks are blocks or groups of blocks that are centrally managed within a site |
| 441 |
b) making changes to a reusable block affects all instances used accross the site |
| 442 |
c) this is particularly helpful if you have content that will be used in multiple locations accross your site and want to be able to manage updates from a single location |
| 443 |
d) another good way to think of reusable blocks is as custom user blocks since they are created and managed by the site user or owner |
| 444 |
- Block patterns: |
| 445 |
a) block patterns, on the other hand, are registered through WP Core software, themes, or plugins. |
| 446 |
b) block patterns are created by WP developers with the intention that the site owner or user will update, customize, and change these patterns once inserted into a post or page |
| 447 |
c) changes made to a block pattern don't affect the registered block pattern on any other content that using that particular block pattern |
| 448 |
------------------------------------------------------------------------------------ |
| 449 |
Lesson Wrap Up |
| 450 |
- now, you should be familiar with what block patterns are, how to use them, and how to customize them for your posts and pages |
| 451 |
- as you develop new content for your site, check the block patterns list to see if there are any new options available or if there's a pattern that already exists that can help you with building your content |
| 452 |
------------------------------------------------------------------------------------ |
| 453 |
++++++++++++++++++++++++++++++++++++++++++ |
| 454 |
Block Patterns |
| 455 |
++++++++++++++++++++++++++++++++++++++++++ |
| 456 |
------------------------------------------------------------------------------------ |
| 457 |
- Block Patterns are a collection of predefined blocks that you can insert into posts and pages and then customize with your own content |
| 458 |
- Using a block pattern can reduce the time required to create content on your site, as well as being a great way to learn how different blocks can be combined to produce interesting effects |
| 459 |
------------------------------------------------------------------------------------ |
| 460 |
How to use a block pattern |
| 461 |
- click the + icon to add a new block |
| 462 |
- click on the patterns tab |
| 463 |
- click on the pattern you wish to insert and the pattern is inserted in the document at the location of your cursor |
| 464 |
- always use own images instead defaults |
| 465 |
------------------------------------------------------------------------------------ |
| 466 |
Hot to customize a block pattern |
| 467 |
- once you insert a block pattern, the block can be edited in the same way as any other blocks |
| 468 |
- click in any block to edit the content within the block |
| 469 |
- you can also add more blocks (and block patterns) to your page anywhere you want |
| 470 |
------------------------------------------------------------------------------------ |
| 471 |
++++++++++++++++++++++++++++++++++++++++++ |
| 472 |
Add New Blocks to Your Site Using the Block Directory |
| 473 |
++++++++++++++++++++++++++++++++++++++++++ |
| 474 |
------------------------------------------------------------------------------------ |
| 475 |
- the block directory helps WP users discover, test and install new blocks for their website. |
| 476 |
- the WP block directory searches the free WP plugin directory for third-party WP block plugins, or those that aren't part of a standard WP installation |
| 477 |
- users can seamlessly install a new WP block into their site without leaving their current editing location |
| 478 |
- the block directory is only available to content creators who also have the capabilities to install and activate plugins |
| 479 |
- it's possible to install a block from the add plugin page, but not efficent |
| 480 |
------------------------------------------------------------------------------------ |
| 481 |
How to search the WP block directory: |
| 482 |
a) to add the block from the block directory, navigate to the post editor |
| 483 |
b) select the 'add block' button in the top-left area of the editor screen |
| 484 |
c) type, for example, map. in a short time we'll see results |
| 485 |
- this is a helpful time to point out reviewing how many active installs this plugin has, and how to see other plugins that this plugin author has in the plugin directory |
| 486 |
------------------------------------------------------------------------------------ |
| 487 |
What is the difference between regular plugins and a block plugin? |
| 488 |
- you may have noticed that adding a block to your website also displays as a plugin |
| 489 |
- if i want to remove a block from block directory, in installed plugin deactgivate, then delete |
| 490 |
------------------------------------------------------------------------------------ |
| 491 |
Why should i delete unused block plugins? |
| 492 |
- if you have tested found block and you no longer want this on your website, you can delete block from your website |
| 493 |
- having unused plugins adds to additional maintenance for your site |
| 494 |
- it's best to only have what you're atively using |
| 495 |
------------------------------------------------------------------------------------ |
| 496 |
What happens to content after a block plugin directory is removed? |
| 497 |
- generally, after you have deleted a plugin from your site, the content that block had displayed will continue to be visible |
| 498 |
- you'll no longer be able to add this block again on your website until you reinstall the block or plugin |
| 499 |
- if you wish to keep the content, you can simply leave it as is |
| 500 |
- if you'd like to delete the content created with the block, you will need to manually delete the block in each location that it has been used |
| 501 |
------------------------------------------------------------------------------------ |
| 502 |
There's a block i want to install, but i get a message saying 'no blocks found in your library' |
| 503 |
- if you don't have an administrator role in your WP site, you don't have permission to add plugins, nor can you add new blocks directly from the block directory |
| 504 |
- you'll need to ask your site administrator to install any new blocks |
| 505 |
------------------------------------------------------------------------------------ |
| 506 |
Lesson Wrap Up |
| 507 |
- the block directory can help you quickly customize the look and functionality of the content on your website |
| 508 |
- remember to test for conflicts and delete any unused block directory plugins from your website |
| 509 |
------------------------------------------------------------------------------------ |
| 510 |
++++++++++++++++++++++++++++++++++++++++++ |
| 511 |
Creating|Joining WordPress Slack, orientation to channels and etiquette |
| 512 |
++++++++++++++++++++++++++++++++++++++++++ |
| 513 |
------------------------------------------------------------------------------------ |
| 514 |
i need to joing WP Slack. |
| 515 |
didn't wait for a message for confirmation |
| 516 |
------------------------------------------------------------------------------------ |
| 517 |
++++++++++++++++++++++++++++++++++++++++++ |
| 518 |
Speaker Training Workshop |
| 519 |
++++++++++++++++++++++++++++++++++++++++++ |
| 520 |
------------------------------------------------------------------------------------ |
| 521 |
------------------------------------------------------------------------------------ |
| 522 |
++++++++++++++++++++++++++++++++++++++++++ |
| 523 |
Keeping WP sites secure |
| 524 |
++++++++++++++++++++++++++++++++++++++++++ |
| 525 |
------------------------------------------------------------------------------------ |
| 526 |
- Use strong passwords |
| 527 |
a) a strong password should include capital letters, lowercase letters, a number and a symbol of some type |
| 528 |
b) don't use the same password for every instance that you need one |
| 529 |
c) it would also be wise to change your password frequently |
| 530 |
d) there are tools available to help your create strong passwords as well as tools to keep track of all your passwords |
| 531 |
e) also add 2FA authentication for the login as well, it will help to make your system more robust |
| 532 |
- Keep WP updates |
| 533 |
- Sign in and Sign out, especially in public places |
| 534 |
- Use Reputable Hosting |
| 535 |
- Use WP security plugins: |
| 536 |
a) WordFence |
| 537 |
b) BulletProof Security |
| 538 |
c) Sucuri Security |
| 539 |
d) iThemes Security |
| 540 |
e) Acunetix WP Security |
| 541 |
f) All in One WP Security&Firewall |
| 542 |
g) Source Code Protection (useful) |
| 543 |
- 2FA Authentication: available plugins |
| 544 |
a) Authy |
| 545 |
b) Duo |
| 546 |
c) Rublon |
| 547 |
d) Two-Factor |
| 548 |
------------------------------------------------------------------------------------ |
| 549 |
++++++++++++++++++++++++++++++++++++++++++ |
| 550 |
Improving site performance |
| 551 |
++++++++++++++++++++++++++++++++++++++++++ |
| 552 |
------------------------------------------------------------------------------------ |
| 553 |
- WP site performance is characterized by how fast pages on the side load |
| 554 |
- there are several reasons why performance matters: |
| 555 |
a) better performance brings better visitor|customer experience |
| 556 |
b) google and other search engines rank sites based on performance so that they rank sites with better performance higher |
| 557 |
c) adequate site helps to decrease bounce rate, the rate at which users 'bounce off' your site and go somewhere else |
| 558 |
- there are some pretty impressive statistics regarding website performance: |
| 559 |
a) 40% of people abandon a website that takes more than 3 seconds to load |
| 560 |
b) a one-second delay in page responce can result in 7% reduction in conversions |
| 561 |
c) 47% of consumers expect a web page to load in 2 seconds or less |
| 562 |
- so, it makes sense to invest some time to ensure your site is optimized and performs well |
| 563 |
------------------------------------------------------------------------------------ |
| 564 |
How to measure site performance? |
| 565 |
- not that you know why site performance is important, it's time to discuss how it's measured and how can you check your site speed - and get a benchmark measurement before you start working to speed it up |
| 566 |
- you could ask a friend to take a look on how fast your site loads |
| 567 |
- however, a more efficient way would be just to use one of the sites which provide speed measurement services |
| 568 |
- among most popular is google page speed which is an excellent way to measure your WP site's performance on different devices and obtain specific feedback on what should be improved |
| 569 |
------------------------------------------------------------------------------------ |
| 570 |
What can impede performance? |
| 571 |
- when your website visitor's device requests data from a website hosted on a server somewhere, there are two primary bottlenecks that may slow down data that's being transferred between your server and your visitors: |
| 572 |
a) host - the kind of hosting you choose has a great impact on your site's speed |
| 573 |
b) network - sometimes the network your visitor uses to access your site is not ideal |
| 574 |
------------------------------------------------------------------------------------ |
| 575 |
How to optimize your website? |
| 576 |
- cashing: |
| 577 |
a) cashing is a process of storing data from previous requests to be re-used for subsequent requests |
| 578 |
b) cashing prevents repeating database requests that transfer the same data over and over |
| 579 |
c) it stores some of the information that has already been requested for and so it can be instantly served to the client as a complete page |
| 580 |
d) this saves the processing time of recreating a page repeatedly |
| 581 |
e) cashing also minimizing server load |
| 582 |
f) normally, when a visitor comes to your site, WP executes one or more (and often many) MySQL queries and php scripts to locate a requested page |
| 583 |
g) then the requested resources are parsed and php generates a page to display to the visitor, using server resources |
| 584 |
h) with page cashing on, you can skip all that server load and display a cashed copy of the page as soon as it's requested, as long as it's available in the cashe |
| 585 |
i) there are plenty of cashing plugins available, such 'W3 Total Cashe', which allows browser, page, object and database cashing |
| 586 |
j) some of the most popular alternatives are 'W3 Super Cashe', which has fewer options to customize so may feel less overwhelming, and 'WP Rocket' which is an efficient but quite simple premium plugin |
| 587 |
- Offloadging: |
| 588 |
a) another way to approach the server load problem and increase the speed of content delivery is to offload part of the content to other servers |
| 589 |
b) one can use a CDN for this |
| 590 |
c) cdn stands for content delivery network |
| 591 |
d) a CDN is a network of servers, usually located at various sites around the world |
| 592 |
e) these powerful servers can cashe the static content of a site, such as image, CSS, and JavaScript files, so that when a visitor lands on your site, the content is provided by the server closest to their location |
| 593 |
f) popular CDN providers include CloudFlare, Amazon Cloudfront, MaxCDN, and KeyCDN. |
| 594 |
g) you can also outsource hosting of your static content and RSS feeds |
| 595 |
- Optimizing your site's configuration: |
| 596 |
a) the theme and plugins that you use on a site are very important for the site's performance |
| 597 |
b) a fast, lightweight theme will perform much better than a heavy graphic-laden theme |
| 598 |
c) if you have a lot of plugins activated, that may also take a toll on performance |
| 599 |
d) you need to make sure all the plugins you don't need are deactivated and deleted |
| 600 |
- Compressing |
| 601 |
a) you can also minify your content so that your pages are delivered more quickly to readers' browsers. |
| 602 |
b) for example, the W3 total cashe plugin mentioned earlier includes the minify module which controls whether html, css, and javascript files are minified and compressed |
| 603 |
c) minification removes all unnecessary or redundant data from the code without affecting performance, minimizing the size of the file that needs to download to the user's browser |
| 604 |
d) this causes website pages to load faster and generally speed up site operation |
| 605 |
e) plugins such as 'WP smushit' or 'EWWW Image optimizer' plugins are a good choice to compress your images and other media files |
| 606 |
------------------------------------------------------------------------------------- |
| 607 |
Summary |
| 608 |
- your site or blog's performance is very important for its visitor experience and for the ranking it gets from search engines |
| 609 |
- the pillars for improving the site speed are: |
| 610 |
a) choosing a reliable and powerful hosting |
| 611 |
b) enabling cashing and compression |
| 612 |
c) making sure your site uses lightweight theme and isn't overloaded with plugins |
| 613 |
d) possibly using external services to offload part of your bandwidth |
| 614 |
------------------------------------------------------------------------------------ |
| 615 |
++++++++++++++++++++++++++++++++++++++++++ |
| 616 |
Child Themes Twenty Sixteen |
| 617 |
++++++++++++++++++++++++++++++++++++++++++ |
| 618 |
------------------------------------------------------------------------------------ |
| 619 |
Description |
| 620 |
- in this lesson you'll learn what a child theme is and when should you use one |
| 621 |
- the step-by-step walkthrough will give you an understanding of what a child theme is and how to create your own child theme |
| 622 |
------------------------------------------------------------------------------------ |
| 623 |
What is a child theme |
| 624 |
- one of the first things people want to modify the design of an existing WP theme |
| 625 |
- after a little investigation, they discover where the theme files live, then directly edit the files |
| 626 |
- after the next theme update, they're horrified to discover that the update completely erased all of their modifications |
| 627 |
- many people have learned this lesson the hard way |
| 628 |
- how do you prevern this from happenning? by using a child theme without touching any of the parent theme's code |
| 629 |
- when the parent theme is updated, your changes in the child theme will be preserved |
| 630 |
------------------------------------------------------------------------------------ |
| 631 |
Why use a child theme? |
| 632 |
- The rule of WP development is to never directly modify WP files. don't edit: |
| 633 |
a) WP core files |
| 634 |
b) Plugin files |
| 635 |
c) Theme files |
| 636 |
d) exception: starter themes that have been intentionally created by theme builders for you to modify |
| 637 |
- Updates wipe out customization changes: |
| 638 |
a) if you update a modified theme, the update will overwrite all customizations |
| 639 |
b) similarly, when you update a plugin, the update will overwrite any edits you've made |
| 640 |
c) same for WP core files |
| 641 |
- Themes can get broken: |
| 642 |
a) if you edit theme files directly and make a mistake that can't be undone, you're stuck with a broken theme |
| 643 |
- WP and WP plugins may not work with theme hacks: |
| 644 |
a) you may inadvertently remove elements that WP and WP plugins look for in a theme, so they no longer work |
| 645 |
------------------------------------------------------------------------------------ |
| 646 |
How do you safely customize a WP theme? |
| 647 |
- create a child theme that is a 'child' of another theme (the 'parent theme'): |
| 648 |
a) the child theme overrides selected design elements and otherwise falls back to the parent |
| 649 |
b) the child theme can also override or add functionality to the parent theme |
| 650 |
------------------------------------------------------------------------------------ |
| 651 |
How child themes work? |
| 652 |
- a child theme loads first, before the parent, and only contains overrides and additions to the parent theme |
| 653 |
- all of your css, templates, images, and other files are kept in the child theme's folder while the original parent theme's files are left intact |
| 654 |
- if sth breaks, you can simply delete or fix the offending file in the child theme folder |
| 655 |
------------------------------------------------------------------------------------ |
| 656 |
Creating a child theme |
| 657 |
- you're going to create a child theme of the default WP theme 'twenty sixteen' |
| 658 |
- we'll name this child theme 'mychildtheme' |
| 659 |
- a child theme only needs a few things to get up and running: |
| 660 |
a) a theme folder |
| 661 |
b) a css file |
| 662 |
c) a screenshot file |
| 663 |
------------------------------------------------------------------------------------ |
| 664 |
Step 1: A Theme Folder |
| 665 |
- every theme for WP needs its own folder |
| 666 |
- take a look at the folder structure of WP |
| 667 |
- you can see each installed theme's folder in |wp-content|themes |
| 668 |
- create a folder for your child theme |
| 669 |
- the folder name should be all lowercase with no spaces |
| 670 |
- in our example the child theme's folder is called 'mychildtheme' |
| 671 |
------------------------------------------------------------------------------------ |
| 672 |
Step 2: A style.css File |
| 673 |
- at a minimum, your child theme needs style.css file |
| 674 |
- the style.css file tells WP tells to load the parent theme's files after the child |
| 675 |
- place this file inside the child theme's folder |
| 676 |
- make sure it's in the root level of the theme folder and not inside a subfolder |
| 677 |
- the style.css file needs the following code at the top: |
| 678 |
|* |
| 679 |
Theme Name: [Your Theme Name] |
| 680 |
Description: The custom theme [Your Theme Name] using the parent theme Twenty Sixteen. |
| 681 |
Author: [You] |
| 682 |
Author URI: [Your URL] |
| 683 |
Template: twentysixteen |
| 684 |
Version: 1 |
| 685 |
*| |
| 686 |
- there are other variables you can include, but these are the most important one you should include to identify your child theme |
| 687 |
- here's an explanation of the different variables in style.css: |
| 688 |
a) Theme Name -- the name of the theme. this is the name that shows up in the WP Dashboard under Appearance > Themes |
| 689 |
b) Description -- a short description for the theme. you can put anything you like here. this shows up in the WP Dashboard under Appearance > Themes once the theme is activated |
| 690 |
c) Author -- the author of the child theme, which can be a person's name or company name |
| 691 |
d) Author URL -- the URL for the author of the child theme |
| 692 |
e) Template -- (very important) this is a folder name of the parent theme. if this variable is not correct the child theme won't work |
| 693 |
f) Version -- the version of the child theme |
| 694 |
- all of these variables are optional, with the exception of 'template' |
| 695 |
- if this line isn't present or contains typos the child theme won't work |
| 696 |
------------------------------------------------------------------------------------ |
| 697 |
Step 3. Enqueue Parent and Child Theme Style Sheets |
| 698 |
- your child theme needs to call the style.css files using a method called 'enqueueing scripts' |
| 699 |
- that just means that the files need to be lined up in the correct order and WP will help you do that |
| 700 |
- to add the calls for the parent and child themes stylesheets to your child theme, first you need to create a functions.php file |
| 701 |
- place this file inside the child theme's folder |
| 702 |
- make sure it is in the root level of the theme folder and not inside a subfolder |
| 703 |
- note that functions.php in the child theme doesn't replace functions.php in the parent theme |
| 704 |
- this is where you can put hooks, actions, and filters that modify or add functionality to the parent theme, rather than replacing it |
| 705 |
- the first line of your child theme's function.php will be opening php tag '<?php', after which you can enqueue your parent and child theme stylesheets |
| 706 |
- the correct method of enqueueing the parent theme stylesheet is to add a 'wp_enqueue_scripts' action and use 'wp_enqueue_style()' in your child theme's functions.php |
| 707 |
- the following example function will only work if your parent theme uses only one main 'style.css' to hold all of the css |
| 708 |
- if your theme has more than one .css file (eg. ie.css, style.css, main.css) then you'll have to make sure to maintain all of the parent theme dependencies |
| 709 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 710 |
- add_action( 'wp_enqueue_scripts', 'mychildtheme_enqueue_styles' ); |
| 711 |
function mychildtheme_enqueue_styles() { |
| 712 |
wp_enqueue_style( 'parent-style' , get_template_directory_uri() . 'style/css' ); |
| 713 |
} |
| 714 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 715 |
- this line need to point to the parent theme's style.css file |
| 716 |
- your child theme's style.css file can be empty |
| 717 |
- but if it contains css code, as it usually will, you'll need to enqueue it as well |
| 718 |
- setting 'parent-style' as a dependency will ensure that the child theme stylesheet loads after it |
| 719 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 720 |
function awesome_enqueue_styles() { |
| 721 |
$parent_style = 'parent-style'; |
| 722 |
wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' ); |
| 723 |
wp_enqueue_style( 'child-style', get_template_directory_uri(). '/style.css' ); |
| 724 |
} |
| 725 |
- this is the recommended way to enqueue the styles for your child theme |
| 726 |
- the old way of enqueueing scripts and styles was to use: |
| 727 |
@import url("../parentfolder/style.css"); , and you'll steel see old articles online that show that technique. but this is very inefficent, so a better way is to use the wp_enqueue_style() method covered here |
| 728 |
------------------------------------------------------------------------------------ |
| 729 |
Step 4: A screenshot.png file |
| 730 |
- A theme's screenshot is the thumbnail image that shows up under Appearance > Themes in the WP Dashboard |
| 731 |
- A screenshot image isn't required for a child theme, but it will look sad without one |
| 732 |
- The recommended image size is 880x660 |
| 733 |
- The screenshot only be shown as 387x290, but the larger image allows for high-resolution viewing on HiDPI displays |
| 734 |
- Create a 880px by 660px image file, name it 'screenshot.png', and place it into the child theme's folder |
| 735 |
------------------------------------------------------------------------------------ |
| 736 |
Activate the Child Theme |
| 737 |
- you now have everything you need to use a child theme |
| 738 |
- make sure the child theme folder containing at least style.css is uploaded or pushed to /wp-content/themes on the web server, or your computer if you're working on a local WP install |
| 739 |
- after you add the theme folder to /wp-contant/themes, go to Appearance > Themes |
| 740 |
- you should see your theme listed |
| 741 |
- Once activated, the site won't look any different on the front-end, but the child theme will be the theme in charge |
| 742 |
- you can now see your theme labeled as 'active' |
| 743 |
------------------------------------------------------------------------------------ |
| 744 |
Child Theme Files |
| 745 |
- the files in the example child theme illustrate how a child theme's files affect the parent's files: |
| 746 |
a) they either override elements and add functionality to its identically named file, or completely replace it |
| 747 |
- my child theme: |
| 748 |
a) style.css overrides and adds to parent's style.css |
| 749 |
b) screenshot.png replaces screenshot.png |
| 750 |
------------------------------------------------------------------------------------ |
| 751 |
Overriding the Parent Theme's Css |
| 752 |
- The child theme's style.css file will override any styles in the parent theme's style.css file that have the same selectors |
| 753 |
- let's say you wanted to change the size of the site title in the header |
| 754 |
- inspecting that element reveals the css selector .site-title shows that the parent theme sets the font size at 1.75rem |
| 755 |
------------------------------------------------------------------------------------ |
| 756 |
Overriding the Parent Theme's Templates |
| 757 |
- templates are the files that control how you WP site will be displayed on the Web |
| 758 |
- inside the twentysixteen folder are all of "twenty thirteen's" template files |
| 759 |
- you can create your own versions of these files in your child theme |
| 760 |
- let's say you want to replace the text 'Proudly powered by WP' in the footer with a copyright: |
| 761 |
a) open footer.php in the twentysixteen folder |
| 762 |
b) you can see the code that needs to be edited |
| 763 |
c) save a copy of 'footer.php' into the child theme folder |
| 764 |
d) edits can safely be made to the child theme file, leaving the original copy of 'footer.php' in 'wp-content/themes/twentysixteen' intact |
| 765 |
- just like our other child themes files, 'wp-content/themes/mychildtheme/footer.php' will override the parent copy |
| 766 |
- to display a copyright line, replace the content above in 'footer.php' in 'wp-content/themes/mychildtheme' with the following code: |
| 767 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 768 |
<div class="site-info"> |
| 769 |
Copyright © <?php echo date('Y'); ?> |
| 770 |
</div><!-- .site-info --> |
| 771 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 772 |
- the result on the front-end of the site |
Комментарии