Add Icons & Animations to the WordPress Button Block

  Рет қаралды 7,822

Build That Website

Build That Website

Күн бұрын

Learn how to turn a plain Gutenberg button block into an fully animated button with Fontawesome Icons.
You'll learn how to:
• Register a custom button style
• Add Fontawesome to your site
• Create an :after pseudo-element
• Insert an icon in the pseudo-element
• Animate the icon on hover
• Add a color-change effect on hover
• Style the default Gutenberg button without over-riding inline styles
******************************
Video Chapters
******************************
0:00 - Intro
0:25 - How to register a custom Gutenberg button style
4:35 - Where to put custom CSS code
5:04 - HTML structure of the button block
6:20 - Customizing the button (basic styles)
7:52 - Add a pseudo-element to the Button
8:46 - Install Fontawesome icons (plugin)
9:25 - Add icon to the button
11:00 - Hover effect for button & icon
14:30 - More hover animations
19:27 - Styling the Default button block
21:21 - Thanks! (Don't forget to subscribe)
PHP Code Snippet to register a Button Styles
_______________________________________________________________________
It turns out KZfaq blocks one of the characters required to add the php snippet here, so instead you can find it at this link:
pastebin.com/9wM0CFVF
________________________________________________________________________
Snippet instructions: change the button slug and label to whatever you want. You can leave 'textdomain' as is, or rename it to whatever you want. It's for adding multi-language support inside a plugin so isn't needed. Add the code inside your theme's functions.php or the Code Snippets plugin.

Пікірлер: 4
@WorldEnglishBlog
@WorldEnglishBlog 3 жыл бұрын
Hey Matt, thanks for sharing your knowledge again. Just a heads up the PHP code is not in the video description yet.
@BuildThatWebsite
@BuildThatWebsite 3 жыл бұрын
Thanks for the reminder, I was in a rush this morning and forgot to add the description. KZfaq doesn't allow the > character in video descriptions unfortunately, so I had to add it via a pastebin link.
@grigoriymalyshev4782
@grigoriymalyshev4782 2 жыл бұрын
Great tutorial, thanx. But I've got a question: how can I edit btn preview-image in sidebar?
@BuildThatWebsite
@BuildThatWebsite 2 жыл бұрын
When registering a block variation you can specify a custom icon (dashicons) or SVG image. Here's the relevant page from the codex: developer.wordpress.org/block-editor/reference-guides/block-api/block-variations/
How to Easily Add Buttons to the Nav Menu in WordPress (no plugins)
15:51
Build That Website
Рет қаралды 9 М.
تجربة أغرب توصيلة شحن ضد القطع تماما
00:56
صدام العزي
Рет қаралды 51 МЛН
Using CSS custom properties like this is a waste
16:12
Kevin Powell
Рет қаралды 162 М.
WordPress Gutenberg - The Ultimate Guide
27:59
Jamie Marsland
Рет қаралды 47 М.
How to Create Buttons in Gutenberg Using Otter's Button Group Block [2022]
6:02
ThemeIsle: WordPress Tutorials & Reviews
Рет қаралды 1,5 М.
How To Make a Website With WordPress Only - No Slow/Complicated Page Builder
37:38
WPCrafter.com WordPress For Non-Techies
Рет қаралды 65 М.
100+ Linux Things you Need to Know
12:23
Fireship
Рет қаралды 760 М.
Glowing/Pulsing Button Effect In Elementor | Neon Button
14:36
Make a WordPress Pricing Table with TablePress
20:20
Build That Website
Рет қаралды 13 М.
How to Add Button to WordPress Header Menu (No plugin needed!)
7:50
TwP - Helping Creators with Tech
Рет қаралды 52 М.
Косички из морковки 🥕
0:40
Сан Тан
Рет қаралды 9 МЛН
4 millions !! Ye Video Na Dekha To Kiya Dekha tum Logo ne....Viral Video
0:13
Sangam संगम
Рет қаралды 7 МЛН
Тот кто не коснется воды - получит приз
0:37
Maa Bahar Kuch To Hai 😱🙄 | mistihappylifestyle #shorts #viral #halloween #trending #shortviral
0:41
Misti Happy Lifestyle Games & Shorts
Рет қаралды 10 МЛН
Tisue ajaib
0:17
Nicholas Noah
Рет қаралды 10 МЛН