How to Show Random Quotes in Your WordPress Sidebar
Do you want to show random quotes in the WordPress sidebar?
Displaying quotes from happy customers can convince more visitors to buy your products. Or you might simply want to brighten your audience’s day by showing them a random inspirational quote.
In this article, we will show you how to easily show random quotes in the WordPress sidebar by using a free plugin.
How to Show Random Quotes in Your WordPress Sidebar
You can show random quotes in the WordPress sidebar using the Quotes and Tips plugin. It lets you add an unlimited number of quotes to your site.
It also lets you display quotes on any page, post, or widget area, including your WordPress sidebar.
First, you’ll need to install and activate the plugin. If you need help, then please see our guide on how to install a WordPress plugin.
After activating the plugin, you can start adding quotes. To add your first quote, go to Quotes » Add New.
First you’ll need to type a title for your quote into the ‘Add Title’ field. In a later step, we’ll show you how to choose whether or not to display the quote’s title to your visitors, or use it for internal reference only.
Next, type your quote into the text editor. In our example, we’re using a quote from a case study.
You may want to organize your quotes into categories. This becomes important when it’s time to display your quotes.
Basically, you have two options.
The Quotes and Tips plugin can select a random quote from all of the quotes you’ve added. Or, it can select a random quote from a specific quote category.
For example, if you have an online store, you might want to display quotes about a specific product on that product page only.
If you already have some categories in mind, then it makes sense to organize your quotes into these categories now. But you can always add, remove, and edit your categories later. We’ll be covering that at the end of the post.
If you do want to create a quote category now, then you can find the Quotes Categories box on the right side of the page.
To add your category, first click on the ‘Add New Quotes Category’ link.
A field will display where you can type your category name. The category won’t appear to your visitors, so it’s just for your reference.
After you type it in, click on the ‘Add New Quotes Category’ button.
This category will now appear in the Quotes Category tab. To add the current quote to this category, simply select the category’s checkbox.
You can keep repeating these steps to create more quote categories.
Next, you’ll typically want to show where a quote comes from. This might be a valued customer, a famous brand, or even a celebrity.
To assign your quote to a person or company, scroll down to the ‘Name and Official Position’ section.
You can now type the person or company’s name into the Name field.
You might also want to add this person’s job title, or some information that explains why they’re qualified to make this statement. You can type this information into the Official Position field.
When you’re happy with your quote, click on the Publish button.
You can now repeat these steps to create all of the quotes that you want to show in your WordPress sidebar.
Configuring Your Quotes and Tips Settings
After creating your quotes, it’s time to take a look at the Quotes and Tips settings. This contains some important settings that control how and when your site displays a random quote.
To take a look at these settings, go to Tips » Settings.
By default, Quotes and Tips will display a new quote every time the page reloads. This means visitors will see a new quote every time they visit a new page or press the Refresh button in their web browser.
If you prefer, you can display a new quote automatically every few seconds or minutes. The visitor doesn’t even have to refresh their web browser.
To do this, select ‘AJAX (no page reload).’ You can then find the Change Frequency field. Here, simply type how frequently WordPress should display a new quote in seconds.
Next, it’s time to choose the title that will appear above your quote.
The default setting is ‘Set Title From Post’. This will display the title you entered when adding the quote to WordPress.
Another option is creating a title that WordPress will use for all of your quotes. This might be something such as ‘Words of Wisdom’ or ‘Don’t take our word for it! Here’s what our customers think’ for testimonials.
To use the same title for all your quotes, click on ‘Set Custom Titles.’ You can now type your title into the Quote Title field.
When you’re finished, don’t forget to click on the Save Changes button.
How to Display a Random Quote
Now it’s time to display your quotes.
Let’s start by showing a random quote from your entire quote collection. If you’ve created multiple categories, then this method will ignore all of these categories.
You can add your quote to any page, post, or widget using the Quotes and Tips shortcode. To get this shortcode, go to Quotes » Settings.
Now, copy the shortcode in the ‘Quotes and Tips’ section.
Another option is to simply copy the following: [quotes_and_tips]
Since we want to show random quotes in the WordPress sidebar, you’ll need to go to Appearance » Widgets. This shows all the areas of your site that support widgets.
This screen may look slightly different depending on your WordPress theme. However, most modern WordPress themes have a sidebar.
Find the Main Sidebar or similar section, and give it a click. This section will now expand.
You need to add a Shortcode block to this widget, so click on the + button. In the search field, type Shortcode.
You can now select the Shortcode block when it appears. Next, either paste or type the shortcode into this block.
Finally, click on the blue Update button at the top of the screen. Now, if you visit your website you should see a random quote in your WordPress sidebar.
How to Display Random Quotes From a Specific Category
Another option is to display a quote from a specific quote category.
To display a random quote from a particular category, you’ll need to use a different shortcode.
To get this code, head over to Quotes » Quote Category.
Here, you’ll find a list of all the categories you’ve created. Each category has its own shortcode.
Simply find the category that you want to use, and copy its shortcode. You can then paste this shortcode into any page, post, or widget, following the same process above.
How to Style and Brand Your Random Quotes
By default, Quotes and Tips adds a blue background to the quote area. It also uses a background image of silhouettes.
You can change this default styling to better match the rest of your website’s design. You can even remove the styling completely.
To change the background color, text color, or background image, go to Quotes » Settings.
In the left menu, click on the Appearance tab.
You can now change the background color and text color, by clicking on the Select Color button.
This adds an area where you can choose your perfect color.
If you change your mind, you can restore the plugin’s default colors at any point. Simply click on the Default button.
You can also change the background image. To remove the default background image, scroll to Background Image, and then click on the None button.
You can also add your own background image.
Using your company or product logo as a background image can be a great way to brand your quotes.
To upload a new background image, click on the Custom button. This adds a Choose File button.
Give this button a click. This will open a window where you can select the file that you want to use as your background image.
After making your choice, you can customize how this image looks on your site.
This includes changing the background image alignment and the opacity, which is how transparent the background image is.
Why not experiment, to see what different effects you can create?
How to Add, Edit and Delete Quote Categories
Sometimes, you may want Quotes and Tips to display a completely random quote.
Other times, you may need more control over the kind of quotes that it displays.
You can do this using quote categories. We’ve already seen how to create a category when adding a new quote. However, Quotes and Tips has an entire menu where you can make changes to these categories, and create new ones.
To see these settings, go to Quotes » Quotes Categories.
Here, you can quickly and easily create quote categories. To add a new category, type a name for your category into the Name field.
By default this plugin creates each quote category as a parent category.
Another option is to create a subcategory. For example, you might have an OptinMonster parent category, and then create subcategories for your different promotions, such as ‘OptinMonster summer sale’ and ‘OptinMonster holiday promotion.’
To create a quote subcategory, you’ll need to select a Parent Category.
When you’re happy with your quote category, click on the blue Add New Quotes Category button.
You can also edit any of the categories you created earlier.
To edit a category, hover over it. Then, click on the Edit link when it appears.
This launches a new page where you can make changes to this category. This includes editing the category’s name, and choosing a new parent.
We hope this article helped you learn how to show random quotes in the WordPress sidebar. Next, you can see our guide on how to increase your blog traffic, or see our expert pick of the best social proof plugins for WordPress
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.
The post How to Show Random Quotes in Your WordPress Sidebar first appeared on WPBeginner.
How to Add Custom Code to WordPress
There are many books and tutorials that share useful code snippets for WordPress. For example, you can find hundreds of custom functions right here at DigWP.com. You can also find them in my WordPress books, tutorials, and code snippets. For many code snippets and custom functions, the usage instructions will say something like:
Add this code to your theme (or child theme’s) functions.php file, or add the code via simple custom plugin.
So what does that actually mean? Let’s take a closer look. First we’ll go through how to add custom code via the functions.php
file. Then we’ll explain how to add code by making a simple custom plugin. Finally we’ll wrap things up by explaining the difference between the two methods and how to go further.
Contents
- Add custom code via theme functions.php
- Add custom code via simple custom plugin
- What’s the difference?
- Going further..
Add custom code via theme functions.php
Every WordPress theme can have a file named functions.php
. If present in a theme, the functions file must be located in the root directory of the theme:
/wordpress/
/wp-content/
/themes/
/my-theme/
functions.php
If the functions file does not exist, create it. Then open the file in a code or text editor and add your custom code. Save the file, upload to the server, and done. It is very straightforward. Just make sure to test any new code on a private/test site before adding to a live production site.
Add custom code via simple custom plugin
With WordPress, plugins add functionality, and themes display content. There is some overlap (and grey area), but in general the best way to add functionality to WordPress is with a plugin. That’s one reason why there are over 50,000 plugins in the WordPress Plugin Directory.
Plugins range in complexity. They can be very advanced, comprising many files and lots of code. Or they can be very simple, made with one file and a few lines of code. To add a custom code snippet, a simple plugin will suffice.
How to make a simple custom plugin
To make a simple custom plugin, follow these steps:
- Create a new PHP file
- Name the file whatever makes sense, can be any alphanumeric string (plus dashes and underscores if needed)
- Open the file and add the header code provided below
- Save the file and done
After creating this file, it is ready for your custom code snippet(s). To save you some time, I’ve created an example plugin that you can download below. It’s ready to go for any custom code that you want to add.
Download a simple custom plugin
Download a copy of our simple custom plugin, ready for your custom code.
↓ Download Simple Custom Plugin (ZIP file < 1 KB)
Usage: Download and unzip the file. Open simple-custom-plugin.php
and customize the file header as explained below. Then add your custom code snippet, save changes and done.
Plugin file header
At the beginning of your plugin file, add the following lines:
<?php
/*
Plugin Name: Simple Custom Plugin
Plugin URI: https://digwp.com/2022/02/simple-custom-plugin/
Description: This is a simple plugin template for adding custom code to WordPress.
Author: Jeff Starr
Author URI: https://plugin-planet.com/
Requires at least: 5.9
Tested up to: 5.9
Version: 1.0
*/
if (!defined('ABSPATH')) die();
// add custom code snippets below this line..
You can customize the header lines with your actual information. As our simple plugin is meant only for your site and will not be distributed publicly, the file header can be much simpler than what’s required for plugins destined for the WP Plugin Directory. Learn more about plugin file headers at WordPress.org.
Also: notice this line:
if (!defined('ABSPATH')) die();
That line is included to prevent direct access to the file. It basically checks if WordPress is loaded; if not, the script simply exits. This is a basic security measure to help prevent anyone from meddling with your custom code.
What’s the difference?
What’s the difference between adding code via theme functions vs. simple plugin? The main difference is scope. When code is added via your theme template, it will run only when the theme is active. So for example, say we add a custom code snippet that displays social media buttons on posts. If we change themes, the custom code will not run, and the buttons will not be displayed.
Contrast that with adding custom code via simple plugin. As long as the plugin is active, the custom code will run always, regardless of which theme you’re using. Going the plugin route also benefits in terms of things like extensibility and maintainability. Managing custom code via plugins generally is easier than burying it within the theme’s functions file.
So which is best? Neither. The two methods are just different. Which one is best for any given code snippet depends on various factors. Most importantly whether or not the custom code is theme specific or global in scope.
Going further..
The above simple plugin example is the most basic possible. To go further with plugin development, visit the Plugin Developer Handbook at WordPress.org.
Questions and comments welcome! :)
How to Better Manage Automatic WordPress Updates
Are you looking for a way to automatically manage WordPress updates?
Updates are important for the security and stability of your WordPress site.
In this article, we will show you how to better manage automatic WordPress updates.
Why Do You Need Better Automatic Updates in WordPress?
Keeping your WordPress website updated is extremely important. The same goes for all plugins and themes installed on your website. You need to install updates for WordPress core, themes, and plugins to get new features and fixes.
Learn more in our guide on why you should always use the latest version of WordPress.
WordPress will automatically update itself when a security or minor release is available. You can also enable automatic updates for major releases, as well as plugins and themes.
However, you may have noticed that some of them are updated more frequently than others. A lot of popular plugins are updated almost weekly.
Some users find it a bit annoying that whenever they log in there are new updates available for WordPress core, one or more plugins, or their theme. It becomes even more time-consuming when you manage multiple WordPress sites.
That’s why many users want to have WordPress automatically install updates for WordPress core, trusted plugins, and themes. But while WordPress now lets you do this without a plugin, you still don’t have full control over your auto-updates.
Let’s take a look at how you can take total control of WordPress and minimize the time spent on installing updates.
Setting Up Easy Updates Manager
The first thing you need to do is install and activate the Easy Updates Manager plugin. This plugin gives you complete control over customizing your updates and also keeps logs of what is updated and when.
For more details, see our step-by-step guide on how to install a WordPress plugin.
Upon activation, you need to visit Dashboard » Updates Options page to set up the plugin.
This page provides you quick access to turn on or off updates for WordPress core, plugins, themes, and translations. The default settings here will work well for most websites.
We strongly recommend that you never turn off updates for WordPress core, plugins, or themes. It will seriously compromise your site’s security and health.
Setting Up Automatic Updates for WordPress, Plugins, and Themes
Easy Updates Manager allows you to quickly enable automatic updates for WordPress core, plugins, and themes from the Dashboard » Updates options page. Simply click on the blue ‘Auto update everything’ button in the ‘Quick configuration actions’ section.
This plugin also allows you to selectively turn on automatic updates for certain plugins or themes. If you would like to selectively turn on automatic updates, then click the ‘Choose per plugin’ and ‘Choose per theme’ buttons.
Next, we’ll show you how to select which plugins and themes are updated automatically.
Setting Up Automatic Updates for Select Plugins and Themes
If you selected to individually enable automatic updates for a few plugins, then you need to switch to the ‘Plugins’ tab on the Dashboard » Updates options page.
Here you will see a list of all plugins installed on your WordPress site. To automatically update a certain plugin, simply click the ‘On’ button under ‘Automatic updates’.
When you switch to the ‘Themes’ tab, you will see a list of themes installed on your site.
You need to click the ‘On’ button under ‘Automatic updates’ for those themes that you want to be updated automatically.
Rolling Back to a Previous Version of a Plugin or Theme
Plugin and theme incompatibilities are the major reason why some users are hesitant when it comes to updating. Even though most good developers thoroughly test their plugins, there can still be bugs that can cause your site to break.
The first step you should take to protect your website is to install a WordPress backup solution. This will let you restore your entire website if something goes wrong.
However, restoring your WordPress site from a backup can be a lot of work. If you know which plugin or theme update caused the problem, then it’s easier just to roll back that one update.
The first thing you need to do is install and activate the WP Rollback plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.
Upon activation, go back to the plugins page on your WordPress site. You will notice a new Rollback option below each plugin installed on your site.
Clicking on the ‘Rollback’ link will allow you to roll back your plugin to any previous version you want. It can also roll back theme updates.
For detailed, step-by-step instructions, see our guide on how to rollback WordPress plugins.
We hope this article helped you find a better way to manage automatic WordPress updates on your site. You may also want to learn how to increase your blog traffic, or see our list of 40 useful tools to manage and grow your WordPress blog.
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.
The post How to Better Manage Automatic WordPress Updates first appeared on WPBeginner.
How to Show a Popup When a User Clicks a Link
A link or hyperlink is a clickable object that leads from one page to another. They can appear as buttons, text, or images. Links (both internal and external) are crucial for good SEO. Links benefit...
The post How to Show a Popup When a User Clicks a Link appeared first on 85ideas.com.
Shortcodes Ultimate Plugin Patches CSRF Vulnerability in Version 5.12.1
The Shortcodes Ultimate plugin, used on more than 700,000 WordPress sites for creating things like tabs, buttons, and accordions, has patched a vulnerability in version 5.12.1. The plugin’s changelog simply says, “This update fixes a security vulnerability in the shortcode generator. To the author’s credit, the changelog clearly denotes it as a security update, although it doesn’t offer specific details.
The vulnerability was reported by researcher Dave Jong at Patchstack and is logged at the National Vulnerability Database (NVD) as a Cross-Site Request Forgery (CSRF) vulnerability leading to plugin preset settings change. It was patched two weeks ago and the NVD published the advisory this week.
At this time, the vulnerability is not known to have been exploited, but users are advised to update to the latest version. Based on WordPress.org stats, 46% of the plugin’s user base is running on versions older than 5.12.x. The Shortcodes Ultimate plugin author has since released version 5.12.2, which fixes an issue with the Shortcode Generator Presets that was introduced in the previous update.
Growmatik Review – Marketing Automation in detail
Beaver Builder Review: Does This WordPress Page Builder Veteran Still Pack a Punch?
How to Add Title and NoFollow to Insert Link Popup in WordPress
Do you want to add a title or nofollow tag to your WordPress links?
By default, WordPress doesn’t provide a way of adding title and nofollow attributes when creating links with the WordPress block editor.
In this article, we’ll show you how to add options for title and nofollow attributes to the Insert Link popup in WordPress.
Why Add Title and NoFollow Attributes to Links in WordPress?
When writing content, you can add links to interconnect your posts and pages and refer to articles on other sites. These links will tell visitors to your WordPress website where they can find more information on a topic.
It’s helpful to give your links a title. This will appear when someone points their mouse cursor over a link.
This can be reassuring to your readers because it makes it clear where the link leads. It also improves your site’s SEO.
SEO experts also recommend that you use a nofollow attribute when linking to external websites. This attribute tells search engines that they can crawl these links, but not pass on any link authority to these websites.
However, when you click the Insert Link icon in WordPress, there are no options to add a link title or to make the link nofollow. The popup only lets you add the Link URL and gives an option to open the link in a new window.
With that being said, let’s take a look at how to easily add title and nofollow options to the Insert Link popup on your WordPress blog.
How to Add Title and NoFollow to Insert Link Popup in WordPress
The first thing you need to do is install the free All in One SEO Lite plugin. For more details, see our step by step guide on how to install a WordPress plugin.
All in One SEO (AIOSEO) is the best WordPress SEO plugin and helps you improve your website SEO. You just need the free version to add extra attributes to the Add Link popup, but AIOSEO Pro offers even more features to help you rank better in search engine results pages.
Upon activation, you need to configure the plugin using the AIOSEO setup wizard. For detailed instructions, see our ultimate guide on how to set up All in One SEO for WordPress.
Once you’ve done that, the plugin will automatically add extra attributes to the Insert Link popup.
These include a title field and options to add nofollow, sponsored, and UGC (user-generated content) tags.
To add the link title, just type it into the ‘Add title attribute to link’ field. When when you save the link, AIOSEO will apply the title and any attributes you toggle on.
We hope this tutorial helped you learn how to add title and nofollow options to the Insert Link popup in WordPress. You may also want to learn how to speed up your WordPress performance or check out our list of must-have plugins to grow your site.
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.
The post How to Add Title and NoFollow to Insert Link Popup in WordPress first appeared on WPBeginner.
iThemes Patches Vulnerability in BackupBuddy, Wordfence Tracks 5 Million Exploit Attempts
BackupBuddy, a commercial plugin from iThemes that performs scheduled backups with remote storage options, has patched a vulnerability that allowed for arbitrary file download by unauthenticated users. iThemes published an advisory for its users, indicating that the vulnerability affects versions 8.5.8.0 through 8.7.4.1 and is being actively exploited.
Wordfence reviewed its data and found that attackers began targeting this vulnerability on August 26, 2022. The company has blocked nearly 5 million attacks targeting the vulnerability since that time.
Wordfence found that the method BackupBuddy used to download locally stored files was insecurely implemented, making it possible for unauthenticated users to download any file stored on the server.
“Due to this vulnerability being actively exploited, and its ease of exploitation, we are sharing minimal details about this vulnerability,” Wordfence threat analyst Chloe Chamberland said.
Wordfence found the majority of the attacks are attempting to read sensitive files, including the following:
- /etc/passwd
- /wp-config.php
- .my.cnf
- .accesshash
iThemes published specific indicators of compromise and detailed steps to detect if a site was attacked. The company outlined additional steps for sites that have been compromised.
All BackupBuddy users are advised to update to the patched version 8.7.5. iThemes made it available to all users, regardless of their current BackupBuddy licensing status, due to the severity of the vulnerability.
10+ Image Optimization WordPress Plugins
A website without images is well, drab. You know, boring. A website with non-optimized images is a complete drag, and it will eat up your precious bandwidth, slow down just about everything and ruin the user experience (UX). Every website owner should strive to provide the best user experience to their visitors at all times. Using […]
The post 10+ Image Optimization WordPress Plugins appeared first on WPExplorer.
12+ WordPress Plugins for Your LearnDash Website
How to Add Conditional Logic to Menus in WordPress
Do you want to show different navigation menu items for different pages in WordPress? Or display a different menu for logged in users?
WordPress allows you to show a navigation menu in a specific location in your theme, but by default, it will always show the same menu.
In this article, we will show you how to add conditional logic to menus in WordPress.
Why Add Conditional Logic to Menus in WordPress?
Navigation menus give your WordPress website structure and help visitors find what they’re looking for. By default, your WordPress website will display the same navigation menu to all users and on all posts and pages.
However, there may be times when you wish to display different menus to different users, or on different pages on your website.
Websites like an online store, a WordPress membership site community, or an online learning platform can all benefit from personalized navigation menus.
Using conditional logic, you could add extra menu items for logged in users so they can manage their accounts, renew their subscriptions, or view the online courses they purchased. You can think of it as WordPress menu access control.
With that being said, let’s take a look at how to add conditional logic to menus in WordPress. Here are the topics we’ll cover in this tutorial:
- Creating New Navigation Menus in WordPress
- Showing a Different Menu to Logged In Users in WordPress
- Showing a Different WordPress Menu Depending on User Role
- Showing a Different Menu for Different Pages in WordPress
- Hiding the Navigation Menu on Landing Pages in WordPress
- Doing More With WordPress Navigation Menus
Creating New Navigation Menus in WordPress
The first step is to create the additional navigation menus you wish to display in WordPress. After that, you can use conditional logic to decide when each menu will be displayed.
Simply head over to the Appearance » Menus page in the WordPress dashboard. If you already have a navigation menu that you use on your website for all users, then this can be your default menu.
Next, you need to click the ‘create a new menu’ link to create a new menu. For example, you could create one menu to show to logged in users, and another to display on a certain WordPress page or category.
On the left-hand side of the screen, you can see a list of your website pages. Simply check the box next to any page you want to add to your menu and click the ‘Add to Menu’ button.
You can also drag and drop the menu items on the right side of the screen to rearrange them.
Further down the page, you can choose a location to display your menu. But, you don’t need to assign a location to this menu now. We’ll do that in the next step.
Don’t forget to click on the ‘Save Menu’ button to store your changes.
For more details on creating menus, you can take a look at our beginner’s guide on how to add a navigation menu in WordPress.
Showing a Different Menu to Logged In Users in WordPress
It’s often useful to display different navigation menus to users depending on whether they have logged in to your site or not.
For example, you can include login and registration links for logged out users and add a logout link to your menu for your logged in menu.
Or if you are running a WooCommerce store, then you could include items for your customers that are hidden from the general public.
First, you need to install and activate the Conditional Menus plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.
Upon activation, you need to visit the Appearance » Menus page and switch to the ‘Manage Locations’ tab.
From here, you will see the list of available menu locations and the menus that are currently displayed. These will vary depending on the WordPress theme you are using.
For example, on our demo website, it is showing that our Primary Menu location is showing a navigation menu titled ‘Main Menu’.
We can tell the plugin to show a different menu when a certain condition is matched by clicking on the ‘+ Conditional Menu’ link and selecting another menu from the drop down menu. For this tutorial, we’ll select ‘Logged in Menu’.
Next, you need to click on the ‘+ Conditions’ link.
This will bring up a popup where you’ll see a bunch of conditions to choose from.
Simply check the box next to the ‘User logged in’ option, and then click on the ‘Save’ button.
You can now visit your website to see the logged in user menu in action. You can log out of your website to see the navigation menu that is shown to all other users.
For more detailed instructions and to learn how to do this using code, take a look at our guide on how to show different menus to logged in users in WordPress.
Showing a Different WordPress Menu Depending on User Role
Once a user has logged in, you can also display a different navigation menu depending on the user role you have assigned to them.
For example, you could include extra menu items for an administrator and more limited items for a contributor. Or on a membership site, you could grant different levels of access to different membership levels.
As in the previous section, you need to install and activate the Conditional Menus plugin, then visit the Appearance » Menus page and switch to the ‘Manage Locations’ tab.
You should add the appropriate conditional menu for the user role you will select. For this tutorial, we’ve selected the ‘Nav Menu Administrator’ menu.
After that, you need to click the ‘+ Conditions’ link so you can choose the user role.
You will need to click on the ‘User Roles’ tab to see checkboxes for each user role on your website. Simply click the user roles that will see this menu, and then click the ‘Save’ button.
Showing a Different Menu for Different Pages in WordPress
You can display a different menu for different pages in WordPress. For example, you could display extra menu items on your privacy policy page, such as a link to your cookie notice.
To do this, you need to install and activate the Conditional Menus plugin, as shown above, then choose the appropriate navigation menu and click the ‘+ Conditions’ link.
This time you should click the ‘Pages’ tab. You will see a list of every page on your website.
You need to place a checkmark next to each page where you wish to display the navigation menu, then click the ‘Save’ button.
Hiding the Navigation Menu on Landing Pages in WordPress
There may be pages on your website where you don’t want to display a navigation menu at all, such as your landing pages.
A landing page is designed to increase sales or generate leads for a business. On these pages, you will want to minimize distractions and provide users with all the information they need to take a specific action.
In our guide on how to increase your landing page conversions by 300%, we suggest that you can minimize distractions by removing navigation menus and other links from the page.
You can do that using the Conditional Menus plugin. When selecting the conditional menu, this time you need to choose ‘Disable Menu’ from the drop down menu.
Next, you need to click the ‘+ Conditions’ link to choose when to display the menu.
You should click on the ‘Pages’ tab and place checkmarks next to your landing pages.
Don’t forget to click the ‘Save’ button to store your settings.
Doing More With WordPress Navigation Menus
Navigation menus are a powerful web design tool. They allow you to point users to the most important sections of your website.
Now that you are showing different navigation menus on different pages and for different users, you may be wondering how you can customize them further.
Try these useful tutorials to extend the functionality of the navigation menus on your WordPress website.
- How to add custom items to specific WordPress menus
- How to add custom navigation menus in WordPress themes
- How to add a fullscreen responsive menu in WordPress
- How to create a vertical navigation menu in WordPress
- How to add a mega menu to your WordPress site
- How to style WordPress navigation menus
We hope this tutorial helped you learn how to add conditional logic to menus in WordPress. You may also want to learn how to create automated workflows, or check out our list of the best social proof plugins for WordPress and WooCommerce.
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.
The post How to Add Conditional Logic to Menus in WordPress first appeared on WPBeginner.
Akismet 5.0 Adds New Spam Detection Feature That Analyzes How Comments Are Posted
For years, the vast majority of Akismet releases have been centered around bug fixes and improving compatibility with various plugins. Version 5.0 was released today, following 4.2.5 earlier this month, with a new feature that should improve Askismet’s ability to detect spam comments.
Akismet engineer Christopher Finke explained how the plugin will now analyze how a comment is posted, in addition to analyzing what is posted:
A typical human commenter on the Web takes about 40 seconds to read a blog post and another 40 seconds to write and submit a comment. Their typing speed varies significantly throughout the creation of their comment, and they regularly use their mouse to click around the page. An automated spambot (even one programmed to act like a person) doesn’t act so human-like: its typing speed and mouseclick speed are superhumanly consistent. It doesn’t spend time “reading” blog posts. Its mouse usage is sparse.
This new feature can detect spam that is posted in a machine-like fashion, even if the spambot is attempting to post a comment with content identical to one that has already been approved.
“The Akismet plugin will begin observing these behaviors so that they can be used as part of the spam-checking process,” Finke said. “None of this data is personally identifiable, and it won’t be used for any purpose other than identifying spam.”
Akismet is bundled with WordPress and is active on more than 5 million sites. More than 62% of users are running on 4.2.x and ~38% are on version 4.1 or older. WordPress users who are having a lot of spam breaking through Akismet’s protection will want to upgrade to take advantage of the new spambot detection features in version 5.0.
How to Add Taxonomy Images (Category Icons) in WordPress
Do you want to display taxonomy images or category icons in WordPress?
By default, WordPress does not come with an option to upload a taxonomy image or category icon. It simply just displays a category or taxonomy name on the archive pages.
In this article, we’ll show you how to easily add taxonomy images or category icons in WordPress. We’ll also show you how to display taxonomy images on your archive pages.
Why Add Taxonomy Images in WordPress?
By default, your WordPress website does not come with an option to add images for your taxonomies like categories and tags (or any other custom taxonomy).
It simply uses taxonomy names everywhere including the category archives or taxonomy archive pages.
This looks kind of plain and boring.
If you get a lot of search traffic to your taxonomy pages, then you may want to make them look more engaging.
The easiest way to make a page more interesting is by adding images. You can add taxonomy images or category icons to make these pages more user-friendly and engaging.
A good example of it is a site like NerdWallet that uses category icons in their header:
You can also use it create beautiful navigational sections on your homepage like Bankrate:
That being said, let’s take a look at how to easily add taxonomy images in WordPress.
Easily Add Taxonomy Images in WordPress
First thing you need to do is install and activate the Categories Images plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.
Upon activation, you can simply go to the Posts » Categories page. You’ll notice the plugin will be showing a placeholder image for your existing categories.
To choose your own category icon, you need to click on the Edit link below a category.
On the Edit category page, scroll down to the bottom and you’ll find a form to upload your own taxonomy image.
Simply click on the ‘Upload/Add New Image’ button to upload the image you want to use for that particular category.
Don’t forget to click on the Add Category or Update button to save your changes.
Next, you can repeat the process to upload images for other category images. You can also upload images for your tags and any other taxonomies as well.
Now the problem is that after adding the images, if you visit a category page, then you won’t see your category image there.
To display it, you will need to edit your WordPress theme or child theme. If this is your first time editing WordPress files, then you may want to see our guide on how to copy and paste code in WordPress.
First, you will need to connect to your WordPress site using an FTP client or your WordPress hosting file manager.
Once connected, you will need to find the template responsible for displaying your taxonomy archives. This could be archives.php, category.php, tag.php, or taxonomy.php files.
For more details, see our guide on how to find which files to edit in a WordPress theme.
Once you have found the file, you’ll need to download it to your computer and open in a text editor like Notepad or TextEdit.
Now paste the following code where you want to display your taxonomy image. Usually, you would want to add it before the taxonomy title or the_archive_title()
tag.
<?php if( is_category() ) { ?>
<div class="taxonomy-image">
<img class="taxonomy-img" src="<?php if (function_exists('z_taxonomy_image_url')) echo z_taxonomy_image_url(); ?>" alt="" / >
</div>
<?php
} else {
//do nothing
}
?>
After adding the code, you need to save this file and upload it back to your website using FTP.
You can now visit the taxonomy archive page to see it display your taxonomy image. Here is how it looked on our demo archive page.
Now, it may still look a bit awkward, but don’t worry. You can style that using a little bit of custom CSS.
Here is the custom CSS we used for the taxonomy image.
img.taxonomy-img {
float: left;
max-height: 100px;
max-width: 100px;
display: inline-block;
}
Depending on your theme, you may also need to style surrounding elements like taxonomy title and description.
We simply wrapped our taxonomy archive title and description in a <div>
element and added a custom CSS class. We then used the following CSS code to adjust title and description.
.taxonomy-title-description {
display: inline-block;
padding: 18px;
}
Here is how it looked afterward on our test website.
Exclude Taxonomies from Displaying Taxonomy Images
Now some users may only want to use taxonomy images for specific taxonomies.
For instance, if you run an online store using WooCommerce, then you may want to exclude product categories.
Simply go back to the Categories Images page in WordPress admin area and check the taxonomies you want to exclude.
Don’t forget to click on the Save Changes button to store your settings.
We hope this article helped you learn how to easily add taxonomy images in WordPress. You may also want to see these useful category hacks and plugins for WordPress or see our tips on getting more traffic from search engines.
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.
The post How to Add Taxonomy Images (Category Icons) in WordPress first appeared on WPBeginner.
New Free Plugin Offers Beautiful Block Patterns for Food Bloggers
Last month WPZOOM released a free plugin called Block Patterns for Food Bloggers that I finally got the chance to test. Food blogs commonly have a strong focus on category and tag-driven grid layouts with big featured images and multiple sections showcasing different types of recipes. Prior to the block editor, customizing these types of layouts would be beyond reach for most WordPress users. They would have to rely on the theme to provide the right layout or enough user-friendly options to change it.
This plugin offers 19 beautifully designed patterns that are fully customizable, making it easy for food bloggers to create complex layouts. Once installed, users will find a little icon at the top of the editor, which launches the patterns in a modal.
The modal displays a grid view of the patterns, a list view with larger images, and allows users to preview the patterns with a mobile, tablet, and desktop view.
Patterns look exactly like the preview when you select and insert them. They include all the images and text so users don’t have to guess how it all fits together. Most patterns simply require replacing the content with your own but can also be used as a starting point for additional customizations. For example, users can drop in this set of featured categories and edit the links to their own categories.
Some of the patterns, such as the different post grids, will require users to make some edits to the block settings for the Query Loop to get it to display the specific categories, author, post type, etc.
The plugin also includes two different “About Me” style Hero sections for introducing the food blogger, as well as an Instagram profile pattern with a small grid of images, and a book feature. There are patterns for a newsletter signup design, and a search form design with a browse section and quick search categories.
Check out the demo on WPZOOM to see all the food blogger patterns in action and an example homepage created with only the patterns in the plugin.
Block Patterns for Food Bloggers is a fun plugin to play with because all the patterns are harmonious to each other, so it doesn’t look like they were all mixed and matched from different plugins. They should drop seamlessly into any WordPress theme or can be used on a blank canvas style theme without an issue.
If you are food blogger who is eager to build your own website but have not found a theme that works for you, this plugin could be all you need to make your own layouts. It covers everything from recipe index pages to featured sections that you would find on any food blogger’s homepage.
WPZOOM published a few helpful tips on the plugin page for customizing the patterns:
- Use the Group block to control spacing and color for more than one block at a time.
- Use the Cover block to control your pattern’s height, including min-height and full-viewport designs.
- If your pattern contains numerous root-level blocks it can be helpful to Group them all together. This makes it easier to move your pattern around once inserted.
Although these patterns are presented with food pictures and placeholder text, they could easily be used for any other type of website. If you have a custom post type for movies, books, portfolios, team members, or any other kind of content, these patterns may be just as relevant.
Although some might contend all these patterns should be uploaded to WordPress’ official pattern directory, I can see the value of offering them as a unified collection in a plugin. Patterns mashed together from the Patterns Directory do not always have a unified design. There are already a few plugins that offer general pattern collections but it would be great to see more niche pattern collections like this one with a unified focus and design. It makes page building much easier than simply relying on core blocks and block collections.
Block Patterns for Food Bloggers is available for free from the WordPress Plugin Directory. It works just as advertised and does not include annoying upgrade advertising in the admin.
How to Import External Images in WordPress
Do you want to import external images in WordPress?
If you have recently moved your website from one platform or host to another, then there is a good chance that you may have external images embedded on your pages.
In this article, we will explain how to properly import those external images in WordPress.
Why Import External Images in WordPress?
External images are images embedded in your content that load from another website or URL different from your main WordPress website.
Most commonly, WordPress users come across external images issue after migrating their website from other platforms like Blogger, Weebly, Joomla, or WordPress.com.
By default, if you use one of the WordPress importers, then it will try to import images. You can see the imported images by visiting Media » Library page in your WordPress admin area.
If you see that all your images are already in the Media Library, but the image URLs in your posts still point to your old website, then you don’t need this article. Instead, you should follow our guide on how to easily update URLs when moving your WordPress site.
However, if you don’t see images imported to your WordPress media library, then continue reading and we will show you how to import those external images.
How to Import External Images in WordPress
The first thing you need to do is to install and activate the Auto Upload Images plugin. For more details, see our step by step guide on how to install a WordPress plugin.
Upon activation, you need to visit the Settings » Auto Upload Images page to review the plugin settings.
The default settings would work for most users, but you can change them as needed.
For example, the plugin will import images to your default WordPress media uploads folder. You can change that by providing a different base URL. Other than that, it also allows you to set filename, image alt tag, image size, and exclude post types.
If you do make some changes, then don’t forget to click on the ‘Save Changes’ button at the bottom of the page to store the new settings.
Next, you will need to update the posts or pages containing the external images. Since this is a manual process, it can be tedious if you have a lot of content.
Luckily, there’s a quick way to update all posts with external images. Simply go to Posts » All Posts page and then click on the Screen Options button at the top.
You need to increase the number in the ‘Number of items per page field’ field to ‘999’ and click the ‘Apply’ button.
WordPress will reload the page, and this time it will show up to 999 posts at a time.
Note: If you have slow web hosting, your server may not be able to handle updating so many posts at once. In that case, you would want to do smaller batches of posts at a time, or consider switching to better WordPress hosting.
Next, you can select all of your posts on this page by clicking the checkbox next to ‘Title’. After that, you should select ‘Edit’ under the bulk actions menu and click the ‘Apply’ button.
WordPress will now show you a ‘Bulk Edit’ box with all selected posts.
You just need to click on the ‘Update’ button, and WordPress will update all your posts.
Remember, don’t change any of the settings in the bulk edit settings that you see. You just need to click the ‘Update’ button.
This will trigger the plugin to check all selected posts and import external images as it finds them.
If you have more than 999 posts, then you will need to visit the next page to select the remaining posts.
We hope this tutorial helped you learn how to import external images in WordPress. You may also want to learn how to create a custom Instagram photo feed, or check out our list of must have plugins to grow your site.
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.
The post How to Import External Images in WordPress first appeared on WPBeginner.