AWPGuide

Beginner's Guide For WordPress

  • Blog
    • Monetization
    • Reviews
    • Showcase
    • WordPress Guides
    • ScanWP
  • Start Here
  • Deals
  • Blueprint

Last Updated On January 16, 2019 By Christina

AWPGuide » WordPress Guides » How To Create Custom CSS Buttons For WordPress Blog

How To Create Custom CSS Buttons For WordPress Blog

How To Create Custom CSS Buttons For WordPress Blog

We highly prefer using buttons on CTA (Call To Action) widgets and inside posts. It will be more catchy, and user-friendly. In short, far better than a text link. Well, if you know a bit about CSS and HTML, you could create your own CSS buttons and add it inside your blog.

Not all our users are pros and most of them are beginners. For those who don’t know how to code, this post would be helpful. In this post, we are going to show you how to create custom CSS Buttons for WordPress blog and add it inside posts!

Create Custom CSS Buttons For WordPress Blog

Without wasting time, let’s move to the tutorial.

First of all, go to CSS3 Button Generator.

Create Custom CSS Buttons For WordPress Blog

On the left side, you can customize your button. The right side will show the live preview of your button.

css button generator customization

Start customizing your button. From there, you can customize

  • Font/ Text.
  • Box.
  • Border.
  • Background.
  • Hover Effects.

So start customizing them.

css button created

Once you are done customizing your button, you can see some CSS codes on the page.

css code for the CSS3 button

You need to copy the code. In our case, the code is something like this

.butn {
  -webkit-border-radius: 8;
  -moz-border-radius: 8;
  border-radius: 8px;
  font-family: Georgia;
  color: #ff0000;
  font-size: 20px;
  background: #ffffff;
  padding: 10px 20px 10px 20px;
  border: dotted #ff6200 2px;
  text-decoration: none;
}

.butn:hover {
  background: #ffffff;
  text-decoration: none;
}

Adding CSS Button CSS In WordPress

After copying the CSS, go to your theme’s style.css file and paste it. Or, you can use the customizer and additional CSS feature. In our case, we are going to use the customizer. Once you got pasted the code, simply publish the updates.

adding css button css code

The CSS part is done.

You can see my button’s class is .butn. We need this when we want to show the button inside posts or wherever inside the blog.

Showing CSS Buttons In WordPress Posts

Now, you need to use this CSS class on your links for showing the button. This can be done through your WordPress theme editor. If you are using the WordPress 5.0, the Gutenberg editor, you can disable Gutenberg using the classic editor and bring up the old editor.

Go to a post which you have published. I will take the default WordPress post. You might see the visual editor. You need to shift to the text editor.

wordpress text editor

After doing that, copy the below code, paste it on the editor. You need to change the class according to your own.

<div><center><a class="butn" href="https://awpguide.com/blog/">Button</a></center></div>

Paste it using the text editor. This would be like

html code for showing button

We have added alignment of the button to the center. If you don’t want it, remove the <center> and </center> code from there.

Then you can shift to the visual editor. After completing the post, simply update it.

update post with CSS3 button

Now, check the post from the front end.

css3 button on front end

Pretty simple isn’t it? By this method, you can show the button inside your posts, pages or custom post types.

We are doing it the same way with some custom codes. if you need to specify some custom fonts for your button CSS, use the font-family CSS. The button already has the font-family mentioned. You need to clear it and add your own.

Something like this. Make sure that you have added the Google font to WordPress.

.butn {
font-family: 'Work Sans', sans-serif; }

CSS Button Not Showing

If you are not seeing your CSS button, it might be an issue with your cache. Try to open the URL in an incognito window or test from a different browser.

Also, make sure that you have added the proper class on the HTML code and pasted the CSS correctly. If you are using any caching plugins like WP Rocket, WP Super Cache or WP Fastest Cache, clear the cache and try again. This will work.

We hope you found this post helpful and enjoyed the read. If you did, please consider sharing this post with your friends and fellow bloggers. For more related posts, you need to see our blog section.

If you want to edit your blog’s CSS without writing a single line of code, we will recommend you a dedicated styling plugin called CSS Hero. Our CSS Hero coupon will help you to get 30% discount on the purchase.

Full Disclosure This post may contain affiliate links, meaning that if you click on one of the links and purchase an item, we may receive a commission (at no additional cost to you). All opinions are our own and we do not accept payments for positive reviews.

About Christina

Christina is the lead editor in AWPGuide.
She will mainly write about WordPress tutorials, product reviews, monetization tricks, and related stuff.
Christina is led by Sreehari.

Leave a Reply Cancel reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let us have a personal and meaningful conversation.

Learn WordPress Now!

Never miss our updates! We are adding fresh contents daily!
Join our newsletter and learn WordPress now!

The Best of AWPGuide

We have the best guides here! Some of them are below!

Beginner's Guides

  • 1
    Media.net Review (and RPM Optimization Guide)
  • 2
    Grammarly Review: Free Proofreading Tool
  • 3
    Why You Need To Build an Email List?
  • 4
    How To Start a Free Blog on CloudAccess.net
  • 5
    Aspire pro Documentation and Setup
  • 6
    WP Engine Affiliate Program Review
  • 7
    How To Add Coupon Section In WordPress

Theme Reviews

  • 1
    Jupiter X WordPress Theme Review
  • 2
    Newsmag WordPress Theme Review
60% DISCOUNT
AWPGuide60
Hostgator Coupon

HostGator Coupon

Do you want a charming 60% discount on HostGator hosting? Well, we got you covered. For AWPGuide users, HostGator is offering something huge!
Get This Deal

ABOUT AWPGUIDE

Finally we have launched AWPGuide blog! At this time of writing, we know, there are so many blogs are providing blogging and money making tips and tricks.

We are not like them! In AWPGuide, we will cover WordPress, blogging, SEO, make money online guides and will teach you how to start, maintain and monetize a WordPress blog.

All these guides will be 100% free and always it will be. We are not running a typical membership website for making money. Also, AWPGuide is free from display advertising, pop-up ads and URL shortner!

For more, feel free to check out our about page.

SITE LINKS

About Us

Advertise Here!

Contact Us

Free Blog Setup

Terms of Service

Write For Us!

Privacy Policy

Deals

OptinMonster Coupon

MyThemeShop Coupon

WPForms Coupon

Bluehost Coupon

CSS Hero Coupon

Social Warfare Coupon

REVIEWS

Genesis Framework

WP Coupons

WP Review Pro

Slider Revolution

Newsmag

Jupiter X

MonsterInsights

© 2023 · AWPGuide LLC