WordPress Development
-
How to set a custom breadcrumb delimiter in WooCommerce?
Are you looking to customize the breadcrumb navigation on your WooCommerce store? One aspect you might want to change is the delimiter, which is the character or string that separates the different sections of the breadcrumb trail. By default, WooCommerce uses the / character as the delimiter, but it is possible to change it to…
-
How to disable WordPress blocks (in the editor and by code)
Do you want to disable some blocks in the Gutenberg editor? There are two ways to do it. The first one will only disable it for you. The second one will disable it for everyone on your website. You might want to do it to restrict what your web development clients can do to their…
-
How to add a snippet to functions.php in WordPress
WordPress allows you to extend its functionality by using its simple API. You can either create a custom plugin with your custom code or you can add your code to your theme’s functions.php file. In this guide, I’ll show you how to do the latter… Where Is The functions.php File Located? Every WordPress theme contains…
-
How to create a WordPress feature plugin
Do you want to create a custom plugin for WordPress? A WordPress plugin allows you to add new, custom functionality to WordPress. They give you the power to change and customize anything and everything about WordPress. In this guide, I’ll help you get started with building custom plugins. It’s really easy! How To Create Your…
-
How to create a WordPress settings page
Do you want to create a custom settings page for your theme or plugin? A settings page allows your users to customize the behavior of your theme or plugin. Creating a custom settings page in WordPress is much easier than most developers think. It only takes these 3 steps: Step 1: Register The Settings Page…
-
How to create a custom WordPress dashboard widget
Do you want to create a custom dashboard widget in WordPress? There’s a really simple WordPress API you can use to create your dashboard widget. It will take you less than a minute to learn how to use it. In this guide, you’ll learn how to register and render a custom WordPress widget… How To…
-
How to register and enqueue styles in WordPress
WordPress offers a very simple API for loading your stylesheets. Although you can just output the HTML yourself, there’s a really easy way to conditionally inject stylesheets into certain pages. In this guide, I’ll teach you all you need to know about registering and enqueuing stylesheets in WordPress: How To Register Styles When you register…
-
How to register and enqueue scripts in WordPress
There are many ways to load a script in WordPress. The recommended and the easiest of all is to use the script registration and enqueue functions that WordPress offers. In this guide, I’ll teach you everything you need to know about loading scripts in WordPress: How To Register a Script WordPress gives you an easy…
-
How to create a shortcode in WordPress
WordPress makes it really easy to create shortcodes. You just need to learn how the add_shortcode function works. Shortcodes allow you to render dynamic content in the content of your pages and posts. You can use a shortcode to render a contact form or an advertisement or whatever else you want. A shortcode’s content will…
-
How To Create a Sidebar (Widget Area) In WordPress
In WordPress, a Sidebar is any area of your theme where the user of the theme can display widgets. Sidebars used to be on either the left or right side of the blog. Hence the name sidebar. If you want to allow your theme’s users to display widgets on their website, you must create at…
-
How to add new navigation menus in WordPress
WordPress gives you an easy API to create navigation menus for your theme. Your users can then add and remove menu items on their own. This makes your theme much more customizable. In this guide, I’ll show you all the things you need to know about building navigation menus in WordPress. How To Register a…
-
How to create a custom post type in WordPress
By default, WordPress only ships with Posts, Pages, and Attachments as supported post formats or types. But you aren’t limited to the default post types. WordPress lets you create your own and it couldn’t be easier. In this article, I will guide you through creating your first custom post type… What Is Custom Post Type?…
-
Add Custom CSS Class To Body Tag On All Posts and Pages
If you want to add a custom CSS class to the body tag of your website on all the posts and pages, use the following code. It adds a filter function to the body_class filter and adds a custom CSS class to the body tag of all the pages on your website. To add a…
-
How To Add A Custom Body Class To Specific Pages
Do you want to add a custom body class to some specific pages on your website? You can do so by adding a filter function to the body_class filter that checks if the page is your desired page and adds a custom class. Add this code to your theme’s functions.php file or to a custom…
-
Add Class To Next Post and Previous Post Links
If you want to add a custom CSS class to the next post and previous post links, here’s an easy way to do so. You can simply add a filter function to the next_post_link and previous_post_link filters. This will let you add a custom class to these links. Here’s the code to do so: Add…
-
Add Class To The First Post in The Loop
Your theme displays blog post lists using a template that is called The Loop. If you want to add a custom CSS class to the first post in this loop, you can do so easily by adding a filter function for the post_class filter. To do this, add the following code to your functions.php file…
-
How To Add a Custom Class To The Body Tag In WordPress
Do you want to add a custom CSS class to the body tag? You can easily do so by adding a filter function to the body_class filter. This will let you modify the list of classes added to the body tag. Add this code to your theme’s functions.php file, or add it to a custom…
-
Add Ancestor Class to Navigation Menus For Single Posts (Blog Posts and Custom Post Type Posts)
If you have a link to a category in your navigation menu, you can add a class to that category link whenever a post (single post) of that category is being displayed. This lets your user know which section of the site they are in and what category this post belongs to.To do this, all…
-
How To Add a Custom CSS Class To Navigation Menus in WordPress
If you want to add a custom class to your navigation menus, you can either edit your theme’s code in every place where a menu is displayed or you can add a filter function to the nav_menu_css_class filter. The nav_menu_css_class filter is called before the CSS classes are added to a navigation menu. This filter…
-
How To Add a Custom CSS Class To Attachment Links in WordPress
Do you want to add a custom class to the links of all your attachments? Attachments displayed on your blog will be inside this <a> tag link. There is an easy way to add a custom class to all your attachment links without having to make changes to every place in your theme’s code where…
-
How To Add a Custom Class To The Post Thumbnail (Featured Image) in WordPress
If you want to customize the look and feel of your post thumbnails, you might want to add a custom CSS class to them. All you need to do to accomplish this is add the following code in your theme wherever a post listing Loop is used: This code simply displays the thumbnail if there…
-
How To Add a Custom Class To the_tags in WordPress
Do you want to add a custom class to all the links output by the_tags function? It’s really easy. The the_tags function is a template function that lets a theme display all the tags related to a post. It works on single posts and also inside the Loop that displays the list of blog posts.…
-
How to remove WordPress logo on the login page and on the admin bar
If you create WordPress websites for your clients, then you might want to remove the WordPress logo from the admin bar and the login page. This lets you white-label, and sell WordPress sites as your own. How To Remove WordPress Logo From Admin Bar If you want to remove the small WordPress logo icon you…
-
How To Remove Generator Meta Tag In WordPress — And Other Identifiers
WordPress adds a meta tag to all the pages of your website. This meta tag looks something like this: <meta name=”generator” content=”WordPress 6.0.1″ /> If you want to secure your WordPress website, you need to remove this. It tells hackers what software your website is running. Fortunately, there’s an easy way to remove the generator…
-
How To Hide The Admin Bar in WordPress
If you want to disable the Admin Bar in WordPress, there are a couple of very easy ways to do so. Whether you want to disable it for everyone including the admins or for specific user roles, you’ll find the right snippets in this article. Method 1: Disable Admin Bar For Everyone If you want…
-
How To Enable Auto Update for Major and/or Minor Versions In WordPress
If you want to keep your WordPress website up to date in order to get the latest improvements and security fixes, enabling auto updates is the best way to go. In this article, I’ll share with you an easy way to enable auto updates in your WordPress website. How To Enable Auto Updates In WordPress…
-
How To Enable Webp Uploads In WordPress
Webp is a modern image format that can help you speed up your WordPress website. It can be compressed to save space, and make your website’s size smaller. Other formats such as PNG and JPEG can also be compressed but they can’t be compressed as much as Webp without them losing quality. Even Google recommends…
-
How to Disable XML-RPC in WordPress (Secure Method)
XML-RPC is a WordPress service/api that allows you to connect your website to third-party applications such as the WordPress mobile app. This service allows third-party apps to publish posts to your WordPress website. If you want to write and publish posts to your website from a third-party app, you need this service. This service is…
-
How To Disable Plugin or Theme Installation In WordPress
Do you want to disallow the installation of themes and plugins on your WordPress website? In this article, I will show you a quick and easy way to do so… I’ll also share with you a way to disallow the deactivation of specific plugins. How To Disable Plugin and Theme Installation For Clients If you…
-
How To Disable Login Error Messages In WordPress
WordPress gives you hints on the login page to let you know whether you entered a wrong password or a wrong username. Although this can be helpful to your users, it can also allow attackers to guess usernames that are in use. Method 1: Disable Login Error Message If you want to disable the login…
-
How to Enable SVG Uploads In WordPress
SVGs are disabled by default in WordPress. SVGs (or Scalable Vector Graphics) have one huge advantage over other image formats: They can be scaled up or down without losing their quality. If you scale a PNG or a JPEG beyond their original size, they’ll look stretched out and blurry. This is why a lot of…