EDITS.WS

Author: Editorial Staff

  • How to Display Most Commented Posts in WordPress (2 Ways)

    Do you want to display your most commented posts in WordPress?

    Highlighting your most commented posts helps your visitors find your best content, increase pageviews, and boost website engagement.

    In this article, we’ll show you how to display the most commented posts in WordPress, step by step.

    How to display most commented posts in your WordPress

    Why Display the Most Commented Posts in WordPress?

    Your most commented posts have very high levels of user engagement. By displaying your popular posts, you encourage new readers to join the discussion and spend more time on your WordPress website.

    All of this together is a big boost of social proof for your site.

    When your visitors stay on your site longer, you can convince them to read another post, join your email list, or make a purchase.

    Plus, when new visitors leave a comment, they become part of the community. This can help you build trust with your readers over the long term.

    That being said, let’s take a look at how to simply display your most commented posts in WordPress using 2 methods. You can click the links below to move to any section:

    Method 1: Display Most Commented Posts With a Plugin in WordPress (Recommended)

    There are many different WordPress popular posts plugins that you can use to display your popular articles, but the simplest to use is MonsterInsights.

    It’s the best analytics solution for WordPress, used by over 3 million websites. With this plugin, you can easily display your most commented posts anywhere on your website.

    The first thing you need to do is install, activate, and set up MonsterInsights. For more details, see our beginner’s guide on how to install Google Analytics in WordPress.

    Note: there is a free version of MonsterInsights, but we’re using the pro version for this tutorial since it includes the popular posts feature.

    Upon activation, navigate to Insights » Popular Posts and then click the ‘Popular Posts Widget’ tab in the menu.

    Popular post widget

    On this screen, you will control the appearance of your most commented posts.

    Simply select the ‘Theme’ you want to use for your most commented posts. The theme operates similarly to your WordPress theme and will control the overall design of the most commented posts widget.

    There are a ton of other customization options on this screen as well.

    For example, in the ‘Theme Preview’ meta box, you can display your most commented posts in a ‘Wide’ format below your content or a ‘Narrow’ format to the right of your content.

    View theme preview

    After that, you have more options for customizing the design.

    For example, you can change the size and color of the title, icon, and background.

    Customize widget design

    MonsterInsights will automatically save any changes you make to your most commented posts display settings.

    Once you’re finished customizing the appearance of your commented posts, it’s time to display your popular posts by comments.

    In the ‘Sort By’ meta box, simply select the ‘Comments’ button.

    Sort by comments

    Next, you can scroll down and view more options to include and exclude posts.

    There is also an option to include posts from specific categories in the popular post widget.

    Include and exclude posts

    MonsterInsights will automatically display your most commented posts.

    You have a few different options for adding your popular posts to WordPress. You can choose manual or automatic placement.

    If you choose ‘Automatic’ placement, then the plugin will add your most commented WordPress posts directly after the last paragraph of your blog posts.

    Enable automatic placement

    The other option is to display your most commented posts manually. If you select the ‘Manual’ option, then you can add the popular posts widget with a Gutenberg block or a shortcode.

    To do this, open up a page or post where you want to display your most commented posts.

    Once inside the content editor, just click the ‘+’ icon and select the ‘Popular Posts’ block.

    Add popular post block

    This will automatically add your most commented posts to your page.

    Make sure you click ‘Update’ or ‘Publish’ to make your changes live.

    Update and publish your changes

    Now when your users visit the page, they will see your most commented posts displayed.

    You can visit the website to see the most popular posts with comments in action.

    View most popular posts preview

    Method 2: Display Most Commented Posts Using Code

    The second method involves adding code to your WordPress files.

    However, there are some downsides to using this method. First, it involves adding code to WordPress, so it’s not beginner-friendly. It can cause serious problems with even a small error, so we recommend editing WordPress core files for advanced users.

    Second, the code isn’t as optimized for performance as the MonterInsights plugin. That means it will increase the server load, and it can slow down your website.

    That being said, let’s take a look at how you can display the most commented posts in WordPress without a plugin.

    Adding Code Snippet to functions.php File

    You’ll want to add the code provided below to your functions.php file. We recommend doing this by using the WPCode plugin. It’s the safest and best way to add custom code to your WordPress website.

    First, you will need to install and activate the WPCode plugin. For more details, please see our guide on how to install a WordPress plugin.

    Note: You can also use the free WPCode plugin as it has all the features you need to add this code.

    Once activated, you can head to Code Snippets » Add Snippet from your WordPress dashboard and select the ‘Add Your Custom Code (New Snippet)’ option.

    How to show post excerpts using code

    Next, you can add a name for your code snippet at the top of the page. Now, just copy and paste this code into the ‘Code Preview’ box:

    function wpb_most_commented_posts() { 
    // start output buffering
    ob_start();
    ?>
    <ul class="most-commented">
    <?php 
    // Run WP_Query
    // change posts_per_page value to limit the number of posts
    $query = new WP_Query('orderby=comment_count&posts_per_page=10'); 
      
    //begin loop
    while ($query->have_posts()) : $query->the_post(); ?>
      
    <li><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a> <span class="wpb-comment-count"><?php comments_popup_link('No Comments;', '1 Comment', '% Comments'); ?></span></li>
    <?php endwhile; 
    // end loop
    ?>
    </ul>
    <?php
      
    // Turn off output buffering
     $output = ob_get_clean(); 
      
    //Return output 
    return $output; 
    }
    // Create shortcode
    add_shortcode('wpb_most_commented', 'wpb_most_commented_posts'); 
      
    //Enable shortcode execution in text widgets
    add_filter('widget_text', 'do_shortcode');
    

    After that, make sure to click the Code Type dropdown menu and select the ‘PHP Snippet’ option.

    Copy and paste code snippet

    Once that’s done, simply click the toggle to make the code ‘Active’ and then press the ‘Save Snippet’ button at the top.

    For more details, please check out our beginner’s guide to pasting snippets from the web into WordPress.

    The code will run a database query and fetch 10 posts ordered by the highest comment count. Then, it uses output buffering to create a shortcode you can use to display the posts.

    The last line of the code creates a shortcode that you can use in your posts, pages, and widget areas.

    To display your popular posts, all you need to do is add the following shortcode to your WordPress site.

    [wpb_most_commented]

    For more details, see our beginner’s guide on how to add a shortcode in WordPress.

    If you want to add thumbnails next to your post titles, then add the following line of code right after <li> tag in the code above.

    <?php the_post_thumbnail(array(40,40)); ?>
    

    This code will define the custom size for the post thumbnail images. You can adjust the size to meet your needs.

    Style Your Most Commented Posts using CSS

    Once you’ve done that, you can style how your most commented posts will display.

    To do this, you can modify the .most-commented and .wpb-comment-count CSS classes in your WordPress theme’s stylesheet.

    You can use the following CSS to get started:

    .most-commented li { 
    border-bottom:1px solid #eee; 
    padding-bottom:3px; 
    } 
    .most-commented li :after { 
    clear:both;
    } 
    .most-commented img { 
    padding:3px;
    margin:3px;
    float:left;
    }
    .wpb_comment_count a, .wpb_comment_count a:active, .wpb_comment_count a:visited, .wpb_comment_count a:hover { 
    color:#FFF;
    }
    

    To add CSS to your website theme’s stylesheet, you can use WPCode. Simply go to Code Snippets » Add Snippet from your WordPress dashboard and select the ‘Add Your Custom Code (New Snippet)’ option.

    How to show post excerpts using code

    Next, enter the CSS code under the Code Preview area and add a title for your snippet.

    Just ensure that you click the Code Type dropdown menu and select the ‘CSS Snippet’ option.

    Add CSS code snippet

    When you’re done, don’t forget to switch the toggle to ‘Active’ and then click the ‘Save Snippet’ button at the top.

    For more details, see our guide on how to easily add custom CSS to your WordPress site.

    We hope this article helped you display the most commented posts in WordPress. You may also want to see our ultimate WordPress SEO guide to get more traffic, and our expert pick of the best WordPress plugins for businesses.

    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 Display Most Commented Posts in WordPress (2 Ways) first appeared on WPBeginner.

  • How to Track Customer Journey Using MemberPress (Step by Step)

    Would you like to know what visitors do on your membership site before they sign up?

    When you track your customers’ journeys in MemberPress, you can discover the steps they take before deciding to purchase a membership. This information can help you optimize your site for better user engagement and increased conversions.

    In this article, we will show you how to track customer journeys using MemberPress.

    How to Track Customer Journey Using MemberPress

    Why Track Customer Journey Using MemberPress?

    When you are running a WordPress membership site, your customers will need to purchase a user account to access certain benefits, such as exclusive content, premium newsletters, online courses, or digital downloads.

    MemberPress is a popular membership plugin that comes with advanced features.

    For example, it allows you to accept payments, add membership levels, create gated content, restrict access based on different membership levels, make members-only forums, and more.

    Wouldn’t it be great if you could see the path your MemberPress customers take before making a purchase? You could see which pages they land on, follow their journey as they navigate to other parts of your site, and even see how long they spend on each page.

    This information can give you insights into your customer’s behavior that you can use to offer a better user experience on your WordPress website, as well as boost your sign-ups.

    That being said, let’s take a look at how to easily track MemberPress customer journeys. Here are quick links that you can use to jump ahead to any section:

    Tracking MemberPress Customer Journeys Using MonsterInsights

    The fastest and simplest way to set up MemberPress customer tracking is with the MonsterInsights plugin. It lets you view your Google Analytics traffic and visitor statistics right from the WordPress dashboard.

    The plugin offers an eCommerce addon. This feature automatically detects MemberPress and other eCommerce plugins. Then, it starts tracking customer behavior in Google Analytics.

    It also comes with a Customer Journey addon that allows you to see users’ behavior before they sign up.

    First, you will need to install and activate the MonsterInsights plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

    Note: You will need the Pro plan to access the eCommerce and User Journey addons that we will use for this tutorial. However, there is also a MonsterInsights Lite version you can use for free.

    Upon activation, you will see the welcome screen and the setup wizard. Simply click the ‘Launch the Wizard’ button and follow the on-screen instructions.

    Launch setup wizard

    For detailed instructions, see our article on how to install Google Analytics in WordPress.

    Bonus: Switch to Google Analytics 4 Using MonsterInsights

    MonsterInsights also helps you set up a Google Analytics 4 (GA4) property through its Dual Tracking feature. GA4 is the latest version of Google Analytics.

    MonsterInsights Dual Tracking GA v4

    If you haven’t created a Google Analytics 4 property yet, then we encourage you to do it right away.

    For more details, please see our guide on how to switch to Google Analytics 4 in WordPress.

    Installing the eCommerce Addon in MonsterInsights

    Once you have configured Google Analytics on your website, the next step is to install the eCommerce addon.

    To do that, you need to visit the Insights » Addons page and navigate to the ‘eCommerce’ addon. Simply click the ‘Install’ button, and the addon will automatically activate.

    Install the eCommerce addon

    As soon as it is activated, the addon will begin to gather data. You will find this data in the MonsterInsights eCommerce Report.

    You can access the report by navigating to Insights » Reports and then clicking on the ‘eCommerce’ tab. You may need to wait up to 24 hours to see any metrics.

    Viewing the MonsterInsights eCommerce Report

    Enabling Enhanced eCommerce Reporting in Google Analytics

    The next step is to enable eCommerce tracking in Google Analytics. eCommerce tracking is not enabled by default in Google Analytics, so you must manually turn it on.

    First, you will need to head over to your Google Analytics account dashboard and click the ‘Admin’ option.

    Click the admin settings button

    Next, you need to click on the ‘Ecommerce Settings’ option.

    It is located in the View column.

    Ecommerce settings

    On the settings page, just click the sliders under ‘Enable Ecommerce’ and ‘Enable Enhanced Ecommerce Reporting’ to turn them on.

    Don’t forget to click the ‘Save’ button when you are done.

    Enable eCommerce and enhanced eCommerce reporting

    Now that you have enabled the enhanced eCommerce settings in Google Analytics, you can head back to your WordPress website dashboard.

    Simply navigate to Insights » Settings and then click the ‘eCommerce’ tab.

    Next, you will need to make sure that the ‘Use Enhanced eCommerce’ option is enabled under the eCommerce Tracking section.

    Use enhanced ecommerce option

    MonsterInsights will now automatically detect that you are using MemberPress and start recording analytics.

    Installing the User Journey Addon in MonsterInsights

    Now that Google Analytics is tracking your MemberPress site, the next step is to enable the MonsterInsights Customer Journey addon.

    This addon will allow you to see the steps each customer takes before making a purchase in MemberPress, such as the pages they visit, the time spent on each page, and more.

    First, you will need to go to Insights » Addons from your WordPress admin panel. Next, navigate to the User Journey addon and click the ‘Install’ button.

    Install the user journey addon

    The addon will automatically activate and start tracking your customers’ journeys.

    Viewing MemberPress Customer Journeys

    The User Journey addon is now active. Once a visitor purchases a membership on your site, their customer journey will be automatically recorded and saved.

    You might be wondering where to find that information.

    Simply navigate to MemberPress » Transactions to see a list of your MemberPress orders.

    Viewing the MemberPress Transactions List

    You can see the details of a transaction by clicking its transaction number in the first column.

    Now, you can simply scroll to the bottom of the transaction details to find the ‘User Journey by MonsterInsights’ section.

    Viewing the Customer Journey of a Single Transaction

    You will be able to see each step the user took along the way to purchasing a membership.

    This includes the time they viewed each page, the titles of the pages they visited with a link, and the time they spent on each page. You will also see the total number of steps and time a user took before becoming a paying customer.

    That’s a lot of information about the journeys your visitors take to become paying members. How can you use all of that data?

    Using Customer Journey Tracking in MemberPress

    Now that you are tracking MemberPress customer journeys, here are a few suggestions for using that data to improve your website and increase conversions.

    Is there a post or page on your website that many visitors read before purchasing a membership? You can increase your sales and conversion rates by sending more traffic there.

    For example, you can add more internal links to that post or page from other posts on your website.

    You can also look for users who purchased a membership taking fewer steps or less time. Do they have anything in common so that you can start to target similar users?

    For instance, are they from a similar location or age group? Or did they come from the same referral source?

    You can also look at all of the pages your visitors are reading. What do most users want to know before they make a purchase? Can you simplify their journey by offering that information on a single landing page that tells them everything they need to know?

    As you take time to study customer journeys in MemberPress, you will learn more about your online sign-up process and sales funnel. You can use that knowledge to improve the user experience and increase sales.

    We hope this tutorial helped you learn how to track customer journeys using MemberPress. You may also want to see our guide on how to start your own podcast or our expert picks for the best AI chatbots for your website.

    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 Track Customer Journey Using MemberPress (Step by Step) first appeared on WPBeginner.

  • How to Add WordPress Navigation Menu in Posts / Pages

    Do you want to add a WordPress navigation menu to your posts or pages?

    By default, you can only display menus in the locations set by your WordPress theme. However, sometimes you may need to add a menu to a specific post or page or even show the menu inside a page’s content.

    In this article, we will show you how to add a WordPress navigation menu in posts and pages.

    How to add WordPress navigation menu in posts / pages

    Why Add a WordPress Navigation Menu in Posts / Pages?

    A navigation menu is a list of links pointing to important areas of a website. These links can help visitors find what they are looking for, improve the customer experience, and keep people on your WordPress website for longer.

    An example of a WordPress navigation menu

    The exact location of your menu depends on your WordPress theme. Most themes let you show menus in multiple areas, but sometimes you may need to add a navigation menu to a post or page.

    For example, you may want to add a unique menu linking to all the products mentioned on a specific sales page.

    You can also use menus to display related posts on your WordPress blog. By placing this navigation menu at the end of a blog post, you can encourage readers to check out more of your content.

    With that being said, let’s see how you can add a WordPress navigation menu to any post or page. Simply use the quick links below to jump straight to the method you want to use:

    Method 1: Using the WordPress Navigation Block (Best for Individual Pages and Posts)

    The easiest way to add a WordPress navigation menu to posts and pages is by using the built-in Navigation block. This allows you to show a navigation menu anywhere in a page or post, but you must manually add each menu.

    This is a great method if you need to control exactly where the menu appears on each page. However, it can be time-consuming and frustrating if you want to add the same navigation menu to lots of pages and posts.

    To get started with this method, simply open the page or post where you want to add a WordPress navigation menu. Then, click on the ‘+’ button to add a new block to the page.

    Adding a navigation block to a WordPress page or post

    In the popup, type in ‘Navigation.’

    When the right block appears, give it a click to add it to the page or post.

    Adding a new block to a WordPress page or post

    The Navigation block will show one of your menus by default.

    If you want to add a different menu instead, then open the ‘Block’ tab. Then, you need to select the ‘List View’ tab.

    The List View tab, in the WordPress block editor

    Here, you can click on the three dots next to ‘Menu.’

    Then, simply choose the menu that you want to use instead.

    Choosing a different WordPress navigation menu

    Sometimes, you may want to customize the menu by adding more links. For example, if you run an online store, then you might link to all the products mentioned on that page.

    To go ahead and add links to the navigation menu, click on the ‘+’ icon in the ‘List View’ tab.

    Adding page links to a WordPress menu

    This opens a popup with different options.

    To add a link to any page on your website, just click on ‘Page Link.’

    adding page links to a WordPress menu

    You can now either choose a page from the dropdown menu or start typing in the page title. When the right page shows up, click to add it to the menu.

    To add more pages to the navigation menu, simply repeat the same process described above.

    Adding links to WordPress

    You can also add social icons to a WordPress menu, which will encourage people to follow you on Twitter, Facebook, YouTube, LinkedIn, and more.

    To get started, click on the ‘+’ icon in the ‘List View’ tab. This time, select ‘Social Icons.’

    Adding social sharing icons to WordPress

    This adds a new area where you can add the social icons.

    To get started, click on the new ‘+ Click plus to add’ section.

    Adding social icons to WordPress

    Now, select the social media network you want to link to.

    For example, you can choose ‘Twitter’ to promote your Twitter page in WordPress.

    Adding a Twitter icon to WordPress

    After that, you will need to configure the social icon.

    The exact steps will vary depending on the social network. However, you will typically need to click to select the icon and then type in the URL for your social media profile.

    Adding a Twitter link in WordPress

    Simply repeat these steps to add more social icons to the navigation menu.

    Finally, you may want to add a search bar to your WordPress menu to help people find interesting pages, posts, products, and more.

    WordPress has a built-in search feature, but it is basic and doesn’t always provide accurate results. That’s why we recommend using a WordPress search plugin to improve your site search.

    Even better, if you choose an advanced plugin like SearchWP, then it will replace the default WordPress search. After configuring the plugin, all the search boxes across your site will use SearchWP automatically, including any search boxes in your navigation menus.

    No matter whether you are using the built-in WordPress feature or an advanced plugin like SearchWP, simply select ‘Search’ to add a search bar to the menu.

    Adding a search bar to a WordPress navigation menu

    When you are happy with the menu’s content, you may want to change how it looks.

    You can change the menu’s layout, including its alignment and orientation, by selecting the ‘Settings’ tab.

    How to style a WordPress navigation block

    After that, you can change the background color, text color, typography, and more by selecting the ‘Styles’ tab.

    As you make changes, the live preview will update automatically. This means you can try lots of different settings to see what works best for your WordPress blog.

    Customizing the WordPress menu in a page or post

    There are lots more settings you can configure, but this is all you need to add a helpful WordPress navigation menu to a post or page.

    Pro Tip: If you plan to use the same navigation menu across multiple pages and posts, then it’s smart to turn it into a reusable block in the WordPress block editor. This can save you a ton of time and effort.

    When you are ready to make the navigation menu live, just click on either the ‘Update’ or ‘Publish’ button.

    How to add a WordPress menu to a page or post

    Now, if you visit this page or post, you will see the navigation menu in action.

    Method 2: Using the Full Site Editor (Block Themes Only)

    If you only want to add a navigation menu to a few posts and pages, then method 1 is a great choice. However, you will need to add each menu manually, so this isn’t the best option if you want to show the same menu across your entire website.

    If you are using a block-based theme such as Hestia Pro, then you can add a WordPress navigation menu to the page or post template. This menu will then appear across all your pages or posts without you needing to add it manually. This is perfect if you always want to show the same navigation menu in exactly the same place.

    To get started, go to Themes » Editor in the WordPress dashboard.

    Opening the WordPress full site editor

    By default, the editor will show your theme’s home template.

    To add a navigation menu to your WordPress pages or posts, click on ‘Templates’ in the left-hand menu.

    Choosing a block-based template in WordPress

    The editor will now show all the templates that make up your WordPress theme.

    To add a navigation menu to your WordPress blog posts, select the ‘Single’ template. If you want to add a menu to your pages instead, then select the ‘Page’ template.

    Choosing a WordPress block-based template

    WordPress will now show a preview of your chosen template.

    To edit this template, go ahead and click on the small pencil icon.

    Editing a single WordPress template

    With that done, click on the blue ‘+’ icon in the top left corner.

    In the search bar that appears, type in ‘Navigation.’

    Adding a Navigation block to a block-based template

    When the right block shows up, drag and drop it onto your template.

    By default, the block will show one of your menus. If you want to add a different menu instead, then click on the ‘Block’ tab. After that, select ‘List View.’

    The List View tab in the WordPress full site editor

    You can now click on the three dots next to ‘Menu’ to see all the menus you have created on your WordPress website.

    Simply select any menu from the list.

    Adding a navigation menu to a page or post template in a block-enabled theme

    With that done, you can add more pages to the menu, add a search bar, and more, by following the steps in method 1.

    When you are happy with how the navigation menu looks, click on the ‘Save’ button to make it live. Now, if you visit your site, then you will see the same navigation menu across all your WordPress pages or posts.

    Method 3: Creating a Custom WordPress Theme (More Customizable)

    Another option is to create a custom WordPress theme. This is a more advanced method, but it gives you complete control over where the menu appears in your posts or pages.

    In the past, you would need to follow complicated tutorials and write code to build a custom WordPress theme. However, it’s now possible to easily create your own themes using SeedProd.

    SeedProd is the best drag and drop WordPress page builder, and Pro and Elite users also get an advanced theme builder. This allows you to design your own WordPress themes without writing any code.

    The SeedProd theme customizer

    For step-by-step instructions, please see our guide on how to create a custom WordPress theme (without any code).

    After creating a theme, you can add a navigation menu to any part of your WordPress website.

    Simply go to SeedProd » Theme Builder and find the template that controls the layout of your posts or pages. This will typically be ‘Single Post’ or ‘Single Page.’

    Creating a custom theme using SeedProd

    This will open the template in SeedProd’s drag and drop page builder.

    In the left-hand menu, scroll to the ‘Widgets’ section. Here, find the Navigation Menu block and drag it onto your layout.

    Adding a navigation widget using the SeedProd page builder plugin

    After that, click to select the Navigation Menu block in the live preview.

    Now, open the ‘Select Menu’ dropdown and choose the menu you want to show.

    Adding a navigation menu to a page or post template using SeedProd

    You can now type an optional title into the ‘Title’ field. This will appear above the WordPress navigation menu.

    To preview how the menu will look on your website, click on the ‘Apply’ button.

    Previewing a navigation menu in a WordPress page or post

    Next, you may want to style the menu by clicking on the ‘Advanced’ tab.

    If you added a title, then you can change the text color, adjust the typography, and add more space between the heading and the menu items.

    Customizing a navigation menu using SeedProd

    You can also change the color and font used for the menu items.

    Simply use the ‘Text Typography’ and ‘Text color’ settings to make these changes.

    Customizing a navigation menu using SeedProd

    After that, you can change the spacing, add custom CSS, and even add CSS animations using the settings in the ‘Advanced’ tab.

    When you are happy with how the menu looks, go ahead and click on the ‘Save’ button in the SeedProd toolbar. Then, select ‘Publish.’

    Choosing a different WordPress navigation menu

    Now, if you visit your website, then you will see the new page or post layout in action.

    We hope this article helped you learn how to add a WordPress navigation menu in posts and pages. You may also want to check out our guide on how to create a landing page with WordPress or see our expert picks for the must have WordPress plugins.

    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 WordPress Navigation Menu in Posts / Pages first appeared on WPBeginner.

  • How to Write Powerful Headlines Using AI (Explained)

    Do you want to write powerful headlines using AI (artificial intelligence)?

    Many bloggers have already started using AI tools like ChatGPT to improve their content creation process. However, some people still wonder how to use it safely in their workflows.

    In this article, we will explain how to write powerful headlines using AI on your WordPress blog.

    Writing effective headlines using AI

    Why Is Writing Powerful Headlines Important?

    Did you know that 4 out of 5 people will not click on your website even when it appears on the first page of search results?

    Users don’t typically read pages as much as they scan them. It takes them just a couple of seconds to decide which search result they will click on.

    As a publisher, your job is to make sure that your search listing is displayed more prominently to get user attention.

    To do that, you can optimize your blog post for SEO, use schema markup, and write better headlines.

    The headline or the SEO title is one of the most prominently-displayed parts of a listing in the search results.

    Headlines in search results

    Writing irresistible headlines encourages more users to click on your website, which brings you more visitors, conversions, and sales.

    Plus, the benefits of powerful headlines are not just limited to search results. They also encourage users to view more pages when they are on your blog and help them discover more of your content.

    This leads to a superior user experience and more revenue for your business.

    What Kind of Headlines Work Best?

    Now the big question is: how do you know which headlines are more effective?

    Luckily, marketers have been perfecting headline-writing techniques for decades. Even before the internet, headlines played a significant role in newspapers, magazines, television, advertising, and more.

    The most popular headline writing technique is Emotional Marketing Value (EMV). It recommends using headlines that generate an emotional response among your readers.

    Other things you may need to consider are the headline’s length and making it more helpful, relevant, and discoverable by search engines for your target keyphrases.

    Now, you may wonder how to handle all these things when writing headlines.

    The good news is that there are already plenty of tools available which can help you optimize your headlines. For instance, you can use WPBeginner’s free Headline Analyzer tool to improve your headlines.

    However, you will still need to write different headlines to optimize and test them. This is where AI can help.

    Artificial intelligence is excellent at recognizing patterns and reproducing them. You can use AI to come up with headline ideas and then manually edit them to make them more powerful.

    How to Write Better Headlines Using AI

    There are several ways to generate headlines using artificial intelligence.

    We will talk about the two easiest ways, and you can choose the one that works best for you.

    Both methods will be using OpenAI’s ChatGPT. In our tests, it came up with the most useful headline ideas.

    Note: ChatGPT and other AI apps do not create content that can be copied and pasted without any human edits. When you use an AI tool, you must thoroughly review the results to make sure that all information is correct and that the messages are appropriate for your audience.

    Method 1: Use All in One SEO to Generate AI-Powered Headlines

    This method is recommended for most users because it works inside your WordPress admin dashboard.

    One of the easiest ways to write better headlines using AI is by using OpenAI’s ChatGPT.

    ChatGPT is a machine learning-based artificial intelligence software. It answers users’ queries using plain language in a chatbox-like interface.

    To instruct ChatGPT, you must phrase your question as a ChatGPT prompt. You will need to write a prompt that can generate headlines using your content and other criteria we mentioned above.

    However, this process means you will need to open a separate browser tab, copy and paste your content, and optimize your prompt based on the results.

    This is where All in One SEO for WordPress comes in. It is the best WordPress SEO plugin on the market that allows you to easily use AI to generate powerful headlines for your posts and pages.

    First, you need to install and activate the All in One SEO for WordPress plugin. For more details, see our tutorial on how to install a WordPress plugin.

    Upon activation, you will be prompted to follow the setup wizard to configure plugin settings. Just follow the on-screen instructions to finish the setup.

    AIOSEO setup wizard

    After that, you need to edit a post or page where you want to create a new headline.

    On the post edit screen, scroll down to the AIOSEO Settings section and click on the robot icon next to the ‘Post Title’ field.

    Generate headlines using AI

    This will show a popup where you will need to provide API keys for your OpenAI account.

    Note: You will need the premium version of ChatGPT to use this feature.

    Connect OpenAI

    You can generate API keys on the OpenAI website by visiting the API Keys page in your account.

    Simply generate a new Secret key and copy and paste it into the AIOSEO settings.

    OpenAI API keys

    Once AIOSEO is connected to OpenAI, you will see the option to generate SEO titles.

    Simply click on the ‘Generate Titles’ button to continue.

    Generate titles

    All in One SEO will now generate SEO-friendly titles for your post using artificial intelligence.

    You will see five post titles on the screen. They all automatically use the most up-to-date best practices for writing effective headlines.

    AI generated headlines

    Just click on the ‘+’ button next to the headline you want to use. It will then appear in the SEO Title field in the All in One SEO settings.

    You can also use AI to generate SEO-friendly meta descriptions by clicking on the robot icon next to the ‘Meta Description’ option.

    Generate article descriptions using AI

    Once you have chosen a headline, you can then use AIOSEO’s built-in Headline Analyzer to test and further improve your headline.

    Simply click on the ‘Headline Analyzer’ button in the top right corner of the screen.

    All in One SEO headline Analyzer

    It will show you a score for your headline based on the recommended best practices with practical tips to improve your score.

    Basically, any score above 70 is considered good for an effective and SEO-friendly headline. For more details, you can see our guide on how to use the Headline Analyzer in WordPress.

    Method 2: Using ChatGPT AI to Write Powerful Headlines for WordPress Posts and Pages

    This method is recommended for users who don’t have the premium version of ChatGPT or don’t use All in One SEO.

    The downside of this method is that you will need to design your own prompt. You will also need to copy and paste your post content into ChatGPT so that it can analyze it.

    First, you will need to visit OpenAI’s ChatGPT website. You can sign up for a free account to try out ChatGPT or log in to continue.

    Try ChatGPT

    Once you have signed up, you will see a chat window with a text field at the bottom where you can type your instructions.

    The AI will then respond to your instructions by replying to your prompts.

    Asking questions to ChatGPT

    You can ask ChatGPT to help you come up with headline ideas for your content by typing a prompt into the box.

    For example, you can use the following prompt to generate a powerful WordPress post or page headline:

    “I want you to act as an SEO expert and copywriter. Suggest at least 5 SEO-friendly titles and meta descriptions for the following blog post [Enter your blog post text here].
    You must use the following focus keyword at least once in each title and description: [Enter your Focus Keyword Here]
    Use a persuasive and intriguing tone. Make sure that each title is no more than 60 characters long. Make sure that each description is no longer than 160 characters.”

    You will need to replace [Enter your blog post text here] with the contents of your blog post or page. You must also replace [Enter your Focus Keyword Here] with the focus keyword you want to use for your blog post.

    After that, just hit ‘Enter’ and wait for ChatGPT to respond.

    ChatGPT generated headlines and descriptions

    You can then select any of these headlines and descriptions to use as your blog post title and description.

    If you are not using All in One SEO for WordPress, then you may want to run your headlines through WPBeginner’s free Headline Analyzer tool.

    Headline Analyzer score

    The free Headline Analyzer tool tests your headlines based on a variety of parameters, including sentiment, character count, and word balance. You can then use its suggestions to make your headlines more powerful and effective.

    We hope this article helped you learn how to use AI to write powerful headlines. You may also want to see our tutorial on how to use AI to write content in WordPress or see our expert picks for the best AI 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 Write Powerful Headlines Using AI (Explained) first appeared on WPBeginner.

  • How to Manage Ads in WordPress with Adsanity Plugin

    Are you looking for a way to manage ads in WordPress with AdSanity?

    Selling advertising space is one of the best ways to make money online. However, creating, adding, and tracking your ads can become time-consuming and complicated.

    In this article, we will show you how you can easily manage ads in WordPress using the AdSanity plugin.

    How to manage ads in WordPress with AdSanity Plugin

    Why Manage Ads in WordPress Using the AdSanity Plugin?

    Like billboard owners, many website and blog owners make money online by selling advertising space. However, WordPress doesn’t come with an easy way to manage your ads.

    Most WordPress themes don’t even have space where you can show advertisements. By default, you will need to edit your theme files to insert ad code into WordPress.

    That’s where AdSanity comes in.

    This advanced WordPress ad management plugin allows you to show ads anywhere on your website using ready-made blocks, widgets, and shortcodes. You can even tell AdSanity to show a random ad to visitors without writing a single line of code.

    AdSanity comes with built-in reporting and scheduling. It also supports self-hosted ads, HTML5 ads, and external ad networks like Google Adsense.

    With that being said, let’s see how you can make money online by managing ads with the AdSanity WordPress plugin.

    Step 1: Set Up the AdSanity Plugin

    First, you will need to install and activate AdSanity. If you need help, then please see our guide on how to install a WordPress plugin.

    Upon activation, you need to go to AdSanity » Settings in your WordPress admin dashboard. Here, select the ‘Licenses’ tab.

    The AdSanity WordPress plugin settings

    You can now go ahead and add your key to the ‘License’ field. You can find this information under your account on the AdSanity website.

    With that done, click on ‘Save Changes’.

    Adding a license to the AdSanity ad management plugin

    Now, you are ready to create ads for your WordPress website. To get started, go to AdSanity » Create Ad.

    To start, you will need to add a title by typing it into the field that shows ‘Give this ad a title’. Visitors won’t see this information, so it’s for your reference only.

    Creating an ad for a WordPress website

    Next, it’s time to choose an ad type. Your options are Ad Hosted On-Site, External Ad Network, and HTML5.

    If you are just getting started, then it’s a good idea to try different types of ads. You can then look at the results and prioritize the types that make the most money.

    With that in mind, let’s look at each option in detail.

    Ad Hosted On-Site

    To start, you may want to build and host your own ad on your website. By selling ads on your WordPress blog, you get to keep all the profits.

    You can also use self-hosted ads to promote your own content. This includes products you sell in your online store or your upcoming webinars, conferences, and other events.

    To create a self-hosted ad, select the ‘Ad Hosted On-Site’ tab. After that, you can open the ‘Ad Size’ dropdown and choose a size from the list.

    Adding a self-hosted advertisement to WordPress

    Larger advertisements are more likely to catch the visitor’s attention but can also distract from your site’s content.

    After making a decision, you will need to type a URL into the ‘Tracking URL’ field. This is where visitors will go when they click the ad.

    By default, the URL will open in the same browser tab. However, you may want to open it in a new tab, particularly if the advertisement is linking to someone else’s website.

    For example, if you are linking to an affiliate marketing partner, then you will typically want to check the ‘Open in a new window’ box.

    Adding a tracking URL to an online ad

    Once you have done that, it’s time to upload the image that AdSanity will show to visitors.

    Simply select ‘Set an image’ and then upload a banner or other ad graphic.

    Adding an image to a WordPress ad

    Finally, you may want to type some information into the ‘Notes’ field.

    These notes will only be visible to people who have access to the WordPress dashboard, so it’s perfect for writing quick reminders.

    If you run a multi-author WordPress blog, then you can even use the ‘Notes’ field to communicate with other users.

    Adding notes to an AdSanity advert

    External Ad Network

    While you can sell advertising space directly to other businesses, many website owners use an advertising network instead. These networks are often hassle-free because you don’t have to deal with advertisers or worry about collecting money.

    Instead, the network decides which ads to place on your site, collects the payment, takes their management fee, and then sends you the rest.

    If you are using an advertising network, then click on the ‘External Ad Network’ tab.

    Adding external network ads to a WordPress blog or website

    You can now type a title into the ‘Title’ field.

    After that, you can choose a size for your ads. If you are using Google AdSense, then you may want to see our guide on the highest-performing Google AdSense banner sizes and formats.

    Resizing an external network advert in WordPress

    You can also see our guide on how to optimize your AdSense revenue in WordPress.

    Once you have done that, it’s time to copy the advertisement code provided by your network. The steps will vary depending on the network you are using, but you will often find the ad code by logging into the account you have created with that network.

    If you are using Google AdSense, then see our guide on how to properly add Google AdSense to your WordPress site.

    When you have the code, simply paste it into the ‘Ad Code’ box.

    Adding external network code from a service such as Google AdSense

    Finally, you can type any extra information into the ‘Notes’ field.

    HTML5 Advertisements

    If you want to create multimedia ads featuring a mix of animations, audio, video, and other content, then AdSanity has full support for HTML5. This means you can create engaging, interactive ads using HTML5 and then upload those files to AdSanity.

    To add an HTML5 ad to your WordPress blog or website, simply select the ‘HTML5’ tab.

    Adding an HTML5 ad to WordPress

    You can now type in a title for the ad.

    After that, click on ‘Choose File’ and then select the HTML5 file you want to use.

    Uploading HTML5 ad files to a website, blog, or online store

    With that done, you need to open the ‘Ad Size’ dropdown and choose how big or small the HTML5 ad should be.

    When creating an HTML5 advertisement, we recommend using one of the ‘Responsive’ size options, as these tend to look the best.

    How to create responsive HTML5 adverts in WordPress

    Finally, you may want to add some notes by typing them into the ‘Notes’ box.

    Step 2: Organize Your Advertisements Into Ad Groups

    As you create self-hosted, external network, or HTML5 ads, it’s a good idea to organize those advertisements into groups.

    For example, you might create a ‘holiday advertisements’ group for all the campaigns you run during the holiday season. This can make it easier to find a specific ad, even if you have created lots of advertisements for WordPress.

    To create an ad group, click on the ‘Add New Group’ link. You can now type in the title for it.

    Creating ad groups in WordPress

    Just like WordPress categories and subcategories, you can arrange your advertisement groups into parent-child relationships.

    By default, all of AdSanity’s groups are parent groups. If you want to create a child group instead, then simply open the dropdown that shows ‘Parent Group’ by default.

    Creating parent and child ad groups

    You can then select the group you want to use as the parent.

    When you are happy with how your advertisement group is set up, click on the ‘Add new Group’ button to save your changes.

    To add a self-hosted, external, or HTML5 ad to a group, simply check that group’s box.

    Organizing the ads on your website or blog

    Step 3: Publish or Schedule a WordPress Ad With AdSanity

    When you are happy with your ad, it’s time to make it live. If you want to show the ad right away, then simply click ‘Publish’.

    Publishing an AdSanity ad to WordPress

    Another option is to schedule the ad so that it will appear on your site automatically later. This allows you to schedule all your campaigns in advance, which is a great option if you run lots of campaigns or you are a busy business owner with limited time.

    To schedule an ad, click on the ‘Edit’ link next to ‘Publish forever.’

    Scheduling an ad to go live automatically

    You can now set the date and time when the ad will go live.

    You can also choose when the ad gets removed from your website.

    Scheduling advertising campaigns for your website

    If you want to keep the ad on your site indefinitely, then click on the ‘Publish Forever’ button.

    When you are happy with your schedule, simply click ‘Publish.’

    Step 4: Placing the Ad on Your WordPress Website

    The next step is placing the ad on your online marketplace, store, or website. You can use shortcode, but using the ready-made AdSanity blocks is typically easier.

    To add an advertisement to a page or post, simply open that post or page for editing. Then, click on the ‘+’ button.

    Placing an advert on your site using a block

    To start, type in ‘AdSanity.’

    You will now see all the different AdSanity blocks that you can use.

    Adding AdSanity blocks to a page or post

    To add a specific ad, select AdSanity Single Ad.

    You can now open the ‘Select an ad’ dropdown and choose the advertisement that you want to show. You can also change the ad’s alignment using the ‘Align’ settings.

    Showing a single ad on your website or blog

    Another option is to show advertisements from the same ad group. This allows you to display multiple related ads on the same page or post.

    To do this, click on ‘AdSanity Ad Group’, which adds the block to your layout.

    Adding an AdSanity Ad Group block to your WordPress website

    You can then open the ‘Select an ad group’ dropdown and choose the group you want to use.

    You can also pick how many ads to show in the block and how many columns to use in the advertising area.

    Showing advertisements groups on a WordPress page or post

    Finally, you can show a random advertisement from a particular group using the AdSanity Random Ad block. This is useful if you have created many different ads but have limited advertising space on your website.

    In the popup, simply click the ‘AdSanity Random Ad’ block.

    Showing random ads on your website or blog

    You can now open the ‘Select an ad group’ dropdown menu and choose the group that you want to use.

    Once again, you can change the advertisement’s alignment using the small icons in the ‘Alignment’ section.

    Managing ads in WordPress using AdSanity

    When you are happy with how the page or post looks, either click on ‘Publish’ or ‘Update’ to make the advertisement live.

    You can also add the AdSanity blocks to any widget-ready area in your WordPress theme. For step-by-step instructions, please see our guide on how to add and use widgets in WordPress.

    Are you using a block-based theme? You can also use the full-site editor to add an AdSanity block anywhere on your website.

    Finally, you can embed a single ad on any page, post, or widget-ready area using a shortcode. Simply head over to AdSanity » Manage Ads and find the ad that you want to show.

    You can then go ahead and click on ‘[shortcode]’. This will copy the ad’s shortcode to your computer’s clipboard.

    Adding adverts to your WordPress website using shortcode

    Now, you just need to add the shortcode to your website. For step-by-step instructions, please see our guide on how to add a shortcode in WordPress.

    Step 5: Monitor Your WordPress Ads Using AdSanity and MonsterInsights

    After publishing one or more ads, it’s important to do conversion tracking. This allows you to see what’s working and what isn’t. By continuously monitoring and fine-tuning your ads, you should get more clicks and conversions.

    If you are showing HTML5 ads or ads from an external advertising network, then you will need to set up AdSanity’s Google Analytics Tracking Addon. This allows you to track views and clicks on these advertisements.

    Simply install and activate the plugin, and then follow the onscreen instructions to set up the add-on. If you are using MonsterInsights, then the AdSanity Addon will recognize the connection as soon as you authenticate your Google account, which makes the setup process much easier.

    For more information, please see our guide on how to install Google Analytics in WordPress.

    For self-hosted ads, you can simply go to AdSanity » Reports in your WordPress dashboard.

    Viewing advertisement reports in the WordPress dashboard

    Here, you will find the following information:

    • All-Time Summary: The total views and clicks across all your ads, plus the total click-through rate.
    • All-Time Top 10 Clicks: The 10 ads that have got the most clicks.
    • All-Time Top 10 Click Through Rate: The 10 ads that have the highest interaction rate based on their display rate. Here you will also find the total views, clicks, and the click-through rate.
    • All-Time By Ad Group: The 10 best-performing ads in each ad group, based on views, clicks, and click-through rate.

    We hope this article helped you learn how to manage ads in WordPress with the AdSanity plugin. You may also want to check out our guide on how to increase your blog traffic and our expert picks for the best WordPress popup plugins.

    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 Manage Ads in WordPress with Adsanity Plugin first appeared on WPBeginner.

  • How to Fix WooCommerce Product Search Not Working

    Is the WooCommerce product search not working in your online store?

    If your WooCommerce search isn’t working correctly, users won’t be able to find the products they are looking for. This can result in a poor user experience, abandoned carts, and fewer sales.

    In this article, we will show you what to do when the WooCommerce product search is not working. We will also explain how to improve the search feature.

    Fixing the WooCommerce product search not working issue

    The Importance of WooCommerce Product Search

    Without a functional search tool, users won’t be able to browse through your product catalog and make purchases in your WooCommerce store.

    WooCommerce search not working

    This can result in frustrated customers leaving your site, which will skyrocket bounce rates and decrease profits.

    In turn, it can also damage your store’s reputation. If many people struggle to use your online store, then they may go to your competitors instead.

    The error may also cause your website SEO to suffer because search engines use the search functionality to rank websites.

    If your site has lower rankings in the search results, then fewer customers will be able to find and purchase your products online.

    By fixing the WooCommerce search feature, you can improve the customer experience, making it easier for shoppers to find what they are looking for and make more sales.

    That being said, you can follow the steps in our troubleshooting guide and learn what to do when the WooCommerce product search is not working.

    Step 1: Check With Your Hosting Provider

    The most common reason the search feature isn’t working is because of your WordPress hosting.

    The server hosting your site may not have enough resources to handle a large number of WooCommerce products at once.

    This server may also have some software restrictions that limit the amount of available memory and prevent the search feature from working correctly.

    If this is the case, then you can try contacting your hosting provider’s customer support, as this problem cannot be solved from your end. They can help you figure out if the WooCommerce search isn’t working due to the server and help you fix the issue.

    However, if the issue is not with your hosting, then you will need to move on to the next step.

    Step 2: Deactivate Plugins

    The WooCommerce product search may not be working because of an outdated or new plugin on your WordPress website that is causing some errors.

    This can happen if a plugin has bugs in its software or isn’t compatible with other plugins on your website.

    You can easily fix this issue by deactivating every plugin apart from WooCoomerce on your site.

    First, you will need to go to the Plugins » Installed Plugins page from the WordPress admin sidebar. Once you are there, just select all the activated plugins except WooCommerce from the list.

    Next, simply choose the ‘Deactivate’ option from the ‘Bulk actions’ dropdown menu and click on the ‘Apply’ button to deactivate all the plugins on your site.

    Deactivate all the plugin except WooCommerce

    Now, you can visit your website to check if this has fixed the issue.

    If it has, then simply activate the plugins one by one until you can find the one causing the error. You will then need to look for an alternative plugin or contact the developers for support.

    If deactivating plugins didn’t fix the issue, then keep reading to solve the problem.

    Step 3: Update the WooCommerce Database

    A corrupted database can be another reason that the WooCommerce search is not working.

    For instance, you may have imported a large number of products as a CSV file, which is causing a problem with the database.

    To fix this issue, you will need to update the WooCommerce database. Make sure to create a complete backup of your website before updating its database.

    First, head over to the WooCommerce » Status page from the WordPress sidebar.

    Once you are there, simply switch to the ‘Tools’ tab and click the ‘Regenerate’ button next to the ‘Product lookup tables’ option.

    Click Regenerate next to the Product Lookup Table option

    After that, scroll down to the ‘Update database’ option and just click the button next to it.

    This will update the WooCommerce plugin’s database to the latest version.

    Update the WooCommerce database

    Next, simply visit your online store to check if the issue has been resolved.

    Step 4: Check Catalog Visibility Settings

    Another reason for this problem can be that you have set the catalog visibility of your products to ‘Shop only’ or ‘Hidden’.

    With these settings, the products won’t show up in the search results in your online store.

    To check this, you need to visit the Products » All Products page from the WordPress admin sidebar and click on the ‘Edit’ link under a product name.

    Click the Edit link under the product name

    Once you are on the product page, simply click the ‘Edit’ link under the ‘Catalog visibility’ option in the ‘Publish’ section on the right.

    This will open up a list of visibility choices.

    From here, you need to make sure that the catalog visibility is set to ‘Shop and search results’.

    Choose the Shop and Search Results option from the Catalog Visibility section

    After that, click the ‘OK’ button to save your changes. Then, simply click the ‘Update’ button.

    Now visit your website to check if the WooCommerce search is working. If it isn’t, then you will need to keep reading our tutorial.

    Step 5: Reindex WooCommerce Products

    You may not have indexed your Woocomerce products properly, making the search feature inaccessible.

    To reindex the products, head to the Products » All Products page from the WordPress admin sidebar. From here, check the box at the top of the list to select all the products.

    After that, select the ‘Edit’ option from the ‘Bulk actions’ dropdown menu and click the ‘Apply’ button.

    Edit all the WooCommerce products

    This will open up the ‘Bulk Edit’ tab on the page.

    From here, simply click the ‘Update’ button to reindex all the WooCommerce products.

    Click the Update button to reindex products

    Once you have done that, you need to visit your website to test the search results.

    Improve WooCommerce Product Search With SearchWP

    If you have tried all the steps above and they haven’t fixed the product search problem, then it’s time for you to switch to a search plugin.

    This is where SearchWP comes in.

    It is the best WordPress search plugin on the market that can help you improve WooCommerce product search by automatically replacing the default WordPress search with a more powerful search feature.

    It puts you in complete control of the WordPress search algorithm and builds an index that matches search keywords in content, titles, categories, tags, shortcodes, documents, products, and more.

    SearchWP

    First, you will need to install and activate the SearchWP plugin. For more detailed instructions, see our guide on how to install a WordPress plugin.

    Upon activation, head over to the SearchWP » Settings page from the admin sidebar and switch to the ‘General’ menu option.

    Here, you have to copy and paste the license key into the ‘License Key’ field. You can get your key from the ‘SearchWP Accounts’ page on the SearchWP website.

    After that, simply click the ‘Activate’ button.

    Enter your SearchWP license key

    Next, you have to visit the SearchWP » Extensions page from the admin sidebar.

    From here, click the ‘Install’ button under the ‘WooCommerce Integration’ extension. Upon installation, the extension will be activated automatically.

    Install WooCommerce integration extension

    Next, head over to the SearchWP » Algorithm page from the WordPress admin sidebar and click the ‘Source and Settings’ button.

    This will open a popup where you need to check the ‘Products’ option to add WooCommerce products as a search source.

    After that, click the ‘Done’ button to continue.

    Add Products as search source

    Now, if you scroll down, you will see a new ‘Products’ section added to the list of search sources.

    By default, SearchWP will look at the product title, content (description), slug, and excerpt (short description) for search matches. You can add relevance (importance) to these search attributes by moving the sliders next to them.

    For more detailed instructions, you may want to see our tutorial on how to make a smart WooCommerce product search.

    Depending on how your site is set up, you may also be able to search for other content by clicking on the ‘Add/Remove Attributes’ button.

    Add weight to search attributes

    This will open up a popup from where you can add custom fields and taxonomies to the attributes as well.

    Improve WooCommerce Product Search With Categories, Tags, SKUs, and Other Attributes

    To make your WooCommerce product search more accurate, we recommend adding categories, tags, and SKUs as search sources using SearchWP.

    Once the ‘Add/Remove Attributes’ popup appears, simply start by typing ‘SKU’ into the ‘Custom Fields’ box. For more information, we recommend reading our guide on how to enable search by product SKU in WooCommerce.

    After that, select the ‘Product categories’, ‘Product tags’, and other product attributes from the ‘Taxonomies’ dropdown menu.

    Add SKU, tag, categories, and attributes as custom fields and taxonomies

    Once you have done that, click the ‘Done’ button to save the changes.

    Now that tags, SKUs, and categories have been added as search sources, move the slider next to these options to assign weight to these attributes.

    Assign weight to the added fields

    Note: If you don’t know how to create tags, categories, and attributes for your products, please see our tutorial on how to add product tags, attributes, and categories to WooCommerce.

    After you have finished configuring settings for SearchWP, simply click the ‘Save’ button at the top.

    Now the default search box on your WooCommerce store will be automatically replaced by SearchWP.

    Click Save to store your changes

    Finally, you can visit your website to check out the new and improved WooCommerce product search box.

    Improved WooCommerce product search

    We hope this article helped you learn what to do when the WooCommerce product search is not working. You may also want to see our article on how to fix WordPress search not working and check out our expert picks for the best WooCommerce plugins to grow your online store.

    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 Fix WooCommerce Product Search Not Working first appeared on WPBeginner.

  • How to Display Twitter Followers Count as Text in WordPress

    Do you want to display your Twitter followers count as text in WordPress?

    By showing that many people follow you on social media, you can encourage visitors to trust your website. Even better, by displaying this information as text, you have the freedom to use it anywhere on your website, including inside your posts and pages.

    In this article, we will show how to display your Twitter followers count as text in WordPress.

    How to display Twitter followers count as text in WordPress

    Why Display Twitter Followers Count as Text in WordPress?

    You may have noticed that many popular blogs, influencers, and brands proudly show how many people follow them on social media.

    If visitors see lots of people following you on social media, then they are more likely to trust your business and see you as an expert in your blogging niche.

    Many of the best social media plugins allow you to show the total follower count in embedded feeds, buttons, banners, and more.

    However, sometimes you may want to show the number as plain text. This gives you the freedom to add the follower count to your blog posts, footer, or anywhere else on your WordPress blog or website.

    With that in mind, let’s see how you can display your Twitter follower count as text in WordPress.

    Step 1: Get a Twitter API Key and Secret

    To get your follower count, you will need to access the Twitter API by creating an API Key and Secret.

    To get this information, head over to the Twitter Developers Portal and then click on ‘Sign up for Free Account.’

    Signing up for a Twitter Developers account

    You can now type in some information about how you plan to use the Twitter API. It’s a good idea to provide as much detail as possible, as Twitter will review this information and may delete your account if they don’t understand how you are using their API.

    After that, read the terms and conditions. If you are happy to continue, go ahead and click on the ‘Submit’ button.

    Agreeing to the Twitter Developers terms

    You will now see the Developer Portal. In the left-hand menu, click to expand the ‘Projects & Apps’ section. Then, select ‘Overview.’

    You can now go ahead and click on ‘Add App.’

    How to create a Twitter app

    After that, just type in the name you want to use for your Twitter app. This is just for your reference, so you can use anything you want.

    With that done, click on the ‘Next’ button.

    Naming a Twitter application

    Twitter will now show an API key and API Secret. This is the only time you will see this information, so make a note of it somewhere safe.

    We recommend adding the key and secret to a password manager for extra security.

    Getting a Twitter API key and secret

    Step 2: Add Custom Code to Your WordPress Website

    The easiest way to add the Twitter follower count to your site is by using PHP code.

    For security reasons, WordPress doesn’t allow you to add PHP code directly to your pages and posts, but it does allow shortcodes. This means you can create a custom shortcode and then link it to your PHP code.

    The easiest way to add custom shortcodes in WordPress is by using WPCode. This plugin allows you to create as many shortcodes as you want and then link them to different sections of PHP code.

    The first thing you need to do is install and activate the free WPCode plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

    Upon activation, head over to Code Snippets » Add Snippet.

    Adding custom shortcode to your WordPress website

    Here, you will see all the ready-made snippets you can add to your website. These include snippets that allow you to completely disable WordPress comments, upload files that WordPress doesn’t support by default, and more.

    Since you are creating a new snippet, hover your mouse over ‘Add Your Custom Code.’ Then, just click on ‘Use snippet.’

    Adding a custom code snippet to WordPress using WPCode

    To start, type in a title for the custom code snippet. This can be anything that helps you identify the snippet in the WordPress dashboard.

    After that, you need to open the ‘Code Type’ dropdown and select ‘PHP Snippet.’

    Adding a PHP snippet to WordPress using custom code

    In the code editor, simply paste the following PHP code:

    function getTwitterFollowers($screenName = 'wpbeginner')
    {
        // some variables
        $consumerKey = 'YOUR_CONSUMER_KEY';
        $consumerSecret = 'YOUR_CONSUMER_SECRET';
        $token = get_option('cfTwitterToken');
      
        // get follower count from cache
        $numberOfFollowers = get_transient('cfTwitterFollowers');
      
        // cache version does not exist or expired
        if (false === $numberOfFollowers) {
            // getting new auth bearer only if we don't have one
            if(!$token) {
                // preparing credentials
                $credentials = $consumerKey . ':' . $consumerSecret;
                $toSend = base64_encode($credentials);
      
                // http post arguments
                $args = array(
                    'method' => 'POST',
                    'httpversion' => '1.1',
                    'blocking' => true,
                    'headers' => array(
                        'Authorization' => 'Basic ' . $toSend,
                        'Content-Type' => 'application/x-www-form-urlencoded;charset=UTF-8'
                    ),
                    'body' => array( 'grant_type' => 'client_credentials' )
                );
      
                add_filter('https_ssl_verify', '__return_false');
                $response = wp_remote_post('https://api.twitter.com/oauth2/token', $args);
      
                $keys = json_decode(wp_remote_retrieve_body($response));
      
                if($keys) {
                    // saving token to wp_options table
                    update_option('cfTwitterToken', $keys->access_token);
                    $token = $keys->access_token;
                }
            }
            // we have bearer token wether we obtained it from API or from options
            $args = array(
                'httpversion' => '1.1',
                'blocking' => true,
                'headers' => array(
                    'Authorization' => "Bearer $token"
                )
            );
      
            add_filter('https_ssl_verify', '__return_false');
            $api_url = "https://api.twitter.com/1.1/users/show.json?screen_name=$screenName";
            $response = wp_remote_get($api_url, $args);
      
            if (!is_wp_error($response)) {
                $followers = json_decode(wp_remote_retrieve_body($response));
                $numberOfFollowers = $followers->followers_count;
            } else {
                // get old value and break
                $numberOfFollowers = get_option('cfNumberOfFollowers');
                // uncomment below to debug
                //die($response->get_error_message());
            }
      
            // cache for an hour
            set_transient('cfTwitterFollowers', $numberOfFollowers, 1*60*60);
            update_option('cfNumberOfFollowers', $numberOfFollowers);
        }
      
        return $numberOfFollowers;
    }
    
    echo getTwitterFollowers(); ?>
    

    In the code above, make sure you replace the following placeholders with your own API key and API secret:

        $consumerKey = 'YOUR_CONSUMER_KEY';
        $consumerSecret = 'YOUR_CONSUMER_SECRET';
    

    You will also need to replace ‘wpbeginner’ with the Twitter account that you want to use. This can be any Twitter account, including accounts that you don’t own:

    function getTwitterFollowers($screenName = 'wpbeginner')
    

    To get the Twitter username, simply open the Twitter profile in a new tab. You will find the username in the URL and in the profile header:

    Getting a Twitter username

    With that done, switch back to the WordPress dashboard. Here, simply click on the ‘Inactive’ toggle so that it changes to ‘Active.’

    You can then go ahead and click on the ‘Save snippet’ button.

    Displaying the Twitter follower count using WPCode

    With that done, scroll to the ‘Insertion’ section.

    WPCode can automatically add your code to different locations, such as after every post, front end only, or admin only. To get the shortcode, simply click on the ‘Shortcode’ button.

    Adding a Twitter follower count to WordPress using a custom shortcode

    You can now use the shortcode to add social proof to any page or post.

    In the block editor, simply click on the ‘+’ button and type in ‘Shortcode.’ When it appears, select the Shortcode block to add it to the page or post.

    How to add a shortcode block to WordPress

    You can now add the shortcode to the block.

    Just be aware that the shortcode simply shows the total follower count, so you will typically want to add some text explaining what the number means.

    Adding a Twitter follower count to WordPress using a custom shortcode

    For more information on how to place the shortcode, please see our guide on how to add a shortcode in WordPress.

    When you are happy with how the page is set up, you can make the follower count live by clicking on either the ‘Update’ or ‘Publish’ button.

    Now if you visit your WordPress website, you will see the follower count live.

    An example of a Twitter follower count, created using WPCode

    We hope this tutorial helped you learn how to display your Twitter followers count as text in WordPress. You may also want to learn how to create a custom Instagram photo feed in WordPress or check out our expert picks for the best Twitter 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 Display Twitter Followers Count as Text in WordPress first appeared on WPBeginner.

  • 14 Best SeedProd Site Kits and Templates (Our Favorites)

    Are you looking for the best SeedProd website kits and templates?

    SeedProd is a website and theme builder that comes with dozens of ready-made templates for almost every business niche.

    These templates are designed to save you time. This means you don’t need to manually build a site. Instead, you can import a ready-made SeedProd site kit to set up your WordPress website quickly.

    In this article, we will share some of the best SeedProd site kits and templates to set up your website in one click.

    Best SeedProd Templates and Site Kits

    How to Make a WordPress Website With a SeedProd Template Kit

    SeedProd is the best WordPress website and theme builder. Over 1 million WordPress users trust SeedProd to build and customize their sites.

    If you want to make a website, eCommerce store, or personal blog, then SeedProd is a one-stop solution with over 50 theme template kits, and they add new templates every week.

    SeedProd Theme Template Kit Chooser

    Whether you own a dry cleaning business or run a travel blog, you will find a built-in template kit for your niche. You can import one of these site kits in one click, and your website is ready.

    Each SeedProd website template includes a homepage, landing pages, and a contact page. It also comes with dummy content and images, so you can see the final look of your website even before it’s ready.

    Then, all you need to do is replace the dummy content with your text and images. You can use the SeedProd drag-and-drop builder to customize the template.

    Note: The links in this article go to theme previews. To add a site kit to your website, you will need to navigate to SeedProd » Theme Builder and click the ‘Theme Template Kits’ button. You can find detailed instructions in our guide on how to install template kits.

    Without any delay, let’s look at our hand-picked and best SeedProd site kits and templates.

    1. Real Estate

    Real Estate Theme Kit for SeedProd

    The Real Estate theme template kit for SeedProd will let you create a customizable real estate website in seconds. Just click on the template to import it, and you are ready to customize the content, styling, and branding in SeedProd’s visual editor.

    Each property page contains photos as well as dimensions and other selling points. All of your listings are showcased together on the Projects landing page for easy browsing. There are also separate listings for houses and apartments.

    The About page describes who you are, along with statistics for projects completed, underway, and more. You can easily add photos of your team to a grid.

    The Contact page lists all of your locations, email addresses, and phone numbers and displays them on a convenient zoomable map.

    2. Music House

    Music House Theme Kit for SeedProd

    The Music House theme is the best SeedProd site kit for music teachers and educational institutions. With some tweaking, it’s also suitable for bands, musicians, and other people in the music industry.

    Besides offering an About Us and Campus (contact) page, you will find a page where you can list your classes, including fees and available days. There is also a page where you can add photos and details about all of your music teachers.

    3. Conduct Construction

    Conduct Construction Theme Kit for SeedProd

    The Conduct Construction theme kit is suitable for anyone in the building industry who wants to list their services and show off their past projects.

    The Services page offers a photo grid where you can display photos and descriptions of the types of building jobs you are able to handle. Underneath, this is a full-width section where you can add a wide photo and provide a written list of your projects.

    The Projects page displays a photo gallery of your previous work. There are tabs along the top so your website visitors can filter by project type, such as ‘Manufacturing Industry’, ‘High-rise’, and ‘Public Infrastructure’.

    The About Us page lets you describe your corporate philosophy, display a chart of your accomplishments, and show statistics about your engineering workforce. All of these sections are easy to customize using SeedProd’s drag-and-drop interface.

    4. Venture Marketing Firm

    Venture Marketing Firm Theme Kit for SeedProd

    The Venture Marketing Firm theme template has a home page where agencies can show off what makes them unique, along with the types of marketing they provide. Full details of the services offered can be provided on the Services page.

    A beautiful Portfolio page provides a photo gallery that can be filtered by project type. At the bottom of the page, your visitors can add their email addresses to request a proposal.

    The Contact Us page features a map of your location, social links, and a newsletter sign-up form.

    5. Wedding Invitation

    Wedding Invitation Theme Kit for SeedProd

    The Wedding Invitation website kit lets couples share the details of their wedding with friends and family. This makes online invitations easy and is a helpful reminder for the date, time, and address of the ceremony and reception.

    On the custom home page, there is room for you to tell the story of how you met, fell in love, and proposed. You can even create a photo timeline of your relationship on the Our Story page and add an album of your special memories on the Photos page.

    The Join Us page serves two purposes. First, it provides a form where your guests can RSVP. Second, it displays a map of the venue where guests can easily find directions.

    6. Travel Blog

    Travel Blog Theme Kit for SeedProd

    The Travel Blog theme template kit allows bloggers to share stories, photos, and videos of their latest travel adventures and gear.

    The front page offers a ‘Start Today’ button that takes readers to the Work With Me page, where they can subscribe to blog updates and your social channels. It also includes sections that display your latest videos and highlights places to visit.

    The Destinations page displays your travel articles by geographic region in an attractive grid, and the Videos page allows you to embed your YouTube videos.

    7. Dry Cleaning

    Dry Cleaning Theme Kit for SeedProd

    The Dry Cleaning website theme is the best SeedProd template kit for local businesses like laundromats. The front page provides a handy summary of your services and the benefits your business offers. These can also be found on the Services page.

    The SeedProd visual editor offers a Pricing Table block, and one has been added to the Prices page. You can easily customize this price list with your own prices and categories using SeedProd’s visual editor.

    At the bottom of the About page, SeedProd’s Testimonials and Star Rating blocks have been added. These let you easily add customer reviews and ratings for your business to increase social proof.

    The Contact page lists the addresses, emails, and phone numbers of each location of your business, along with a map that will help customers navigate to your stores.

    8. e-Course Website

    e-Course Website Theme Kit for SeedProd

    The e-Course Website theme will help you quickly create a website where you can create and sell online courses with WordPress.

    The custom home page lets you introduce the courses you offer, display testimonials from your students, and more.

    You can describe your courses in greater detail on the Lessons page. A ‘Start Learning’ button allows students to subscribe to the courses they are interested in.

    The About page gives more details about your online business, and the Contact page allows potential students to reach out and ask for more information.

    9. NM Advertising Agency

    NM Advertising Agency Theme Kit for SeedProd

    The NM Advertising Agency theme allows you to quickly create a website for advertising agencies and public relations specialists. You simply need to customize the site with information about your own business.

    The front page displays helpful statistics and pie charts that demonstrate how you can help and the return on investment your clients can expect.

    The Services page lets you spell out the variety of marketing and public relations services you offer, and you can share a portfolio of your prior projects on the Work page.

    You can highlight the expertise of your staff on the Team page, and the Contact page allows potential clients to schedule an in-person visit or speak to a team member about their needs.

    10. eBook Author

    eBook Author Theme Kit for SeedProd

    The eBook Author theme template kit is a great way to promote and sell your eBooks in WordPress. An attractive Bio page is included, which you can customize with your own story and Instagram photos.

    Your books are listed in a grid on the Books page. This page also lets you highlight upcoming books and provides a form where your readers can subscribe for regular updates.

    You will just need to choose your own shopping cart solution. We recommend Easy Digital Downloads, and you can learn how to set it up in our beginner’s guide on how to sell digital downloads in WordPress.

    11. Personal Trainer

    Personal Trainer Theme Kit for SeedProd

    The Personal Trainer theme kit features a clean and attractive home page that will introduce your in-person or online training services to potential clients.

    You can add an explainer video to the Training page where you introduce yourself and demonstrate your training methods. You can also customize the Packages and Rates section and add your own frequently asked questions using SeedProd’s Accordion block.

    You can add your best client reviews on the Testimonials page and tell the story of your own personal fitness transformation on the Result page.

    There is a button on the home page where clients can schedule an appointment. This can take your clients to the WordPress appointment or booking plugin of your choice.

    12. Child-Day Care

    Child-Day Care Theme Kit for SeedProd

    The Child-Day Care Website theme kit makes it easy to create an attractive website for a childcare or daycare center.

    The theme will automatically create an attractive Curriculum page that you can customize with your own approach to early childhood education.

    The About Us page can describe the values and benefits of your center. It also includes a ‘Meet Our Leadership’ section where you can add photos of your team.

    The Blog entry in the navigation menu lets you keep your audience up to date with the current events in your daycare center and share educational tips on raising young children.

    Finally, you can customize the ‘Book a Tour’ button to allow parents to send you an email or take them to your online booking form in WordPress.

    13. Juice Bar

    Juice Bar Theme Kit for SeedProd

    The Juice Bar website theme kit for WooCommerce lets you quickly set up a beautifully-designed online store. By default, this store template features bottled juice and other beverages, but it can be easily customized for other products.

    The home page is set up to highlight product collections, items on sale, and other featured products. SeedProd offers helpful blocks to automatically display Recent Products, Sale Products, Best Selling Products, Featured Products, and Top Rated Products.

    The Shop item in the navigation menu takes customers to all of your products, and clicking on a product displays the product page. The ‘Add to Cart’ buttons are live and add products to the WooCommerce shopping cart.

    14. Computer Technician

    Computer Technician Theme Kit for SeedProd

    The Computer Technician theme is the best SeedProd template kit for anyone who offers IT-related services. The front page contains sections that can be customized to describe your business, display testimonials, and demonstrate how you save your clients time and money.

    The Services page can display any number of services that you may offer, like data recovery, Apple product service and repair, and laptop repair. These can be easily edited to suit your own business.

    Like most themes, there are also About and Contact pages. The Contact page has a contact form where your clients can get in touch with you.

    Frequently Asked Questions About Site Kits and Templates

    Here are some questions we are often asked about SeedProd site kits and template kits.

    What is a template kit?

    WordPress template kits are collections of pre-designed templates, layouts, and other elements that allow you to create a professional-looking website without writing code.

    They are a powerful feature of some drag-and-drop page builder plugins and may be called website kits, website templates, or WordPress starter templates. In SeedProd, they are called theme template kits.

    What is the difference between a WordPress theme and a template kit?

    WordPress allows you to customize the appearance of your website by installing themes. Themes determine the overall look of all the pages on your site. There are thousands of WordPress themes available (both free and paid).

    A template kit is a feature of a drag-and-drop page builder plugin, such as SeedProd. It comes with designs for common pages such as an About page, a Contact page, and a custom home page. It may also provide templates for areas that appear across multiple pages, such as a header and footer template.

    The benefit of template kits is that they are easier to customize using the drag-and-drop page builder. They also have more customization options than standard WordPress themes.

    What is the best SeedProd site template kit?

    There isn’t one SeedProd site template kit that is best for every website. Instead, you should choose a site kit designed for your industry or niche. Luckily, SeedProd has many different site kits for all kinds of websites and businesses.

    You should take into consideration the appearance of the kit as well as the extra custom pages it creates for you.

    Before making the kit live, you will need to replace the demo content. You may also want to change the kit’s branding to better match your own business. It’s easy to customize every part of the design using the drag-and-drop editor.

    We hope this tutorial helped you find the best SeedProd site kits and templates. You may also want to see our guide on how to speed up WordPress performance or our expert picks for the best email marketing services to grow your business.

    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 14 Best SeedProd Site Kits and Templates (Our Favorites) first appeared on WPBeginner.

  • How to Add a Dynamic Copyright Date in WordPress Footer

    Do you want to add a dynamic copyright date in your WordPress website’s footer?

    A website with an outdated copyright date can look unprofessional. Adding a dynamic copyright date to your site’s footer shows visitors that your website is up-to-date and regularly maintained.

    In this article, we will show you how to easily add a dynamic copyright date in the WordPress footer.

    Adding dynamic copyright date in WordPress footer

    Why Add a Dynamic Copyright Date in WordPress Footer?

    A copyright date typically covers the current year or range of years in which the content, design, and code of your WordPress website are protected by copyright laws.

    The copyright date on your website should be current, but manually updating it takes time, and you might forget to do it.

    That’s where a dynamic copyright date can help. It will automatically update to ensure that the date is accurate and meets the copyright laws of different countries.

    It also helps protect your content from copyright infringement and plagiarism.

    Plus, an updated copyright date also signals to search engines that your website is well-maintained and active. This can help improve your website’s search engine rankings and attract more traffic to your site.

    In this article, we will show you how to easily add a dynamic copyright date in the WordPress footer. You can use the quick links below to jump to the method you want to use:

    If you want to generate a dynamic copyright date that covers all the years from the start of your WordPress blog until the current year, then this method is for you. It works by using the published date of your oldest post and your newest post.

    To add a dynamic copyright date to your WordPress footer, many tutorials will tell you to add custom code to your theme’s functions.php file. However, the smallest error while typing the code can break your website.

    That’s why we recommend using WPCode, which is the best WordPress code snippets plugin on the market. It is the easiest and safest way to add code to your website.

    First, you will need to install and activate the WPCode plugin. For more instructions, you may want to see our tutorial on how to install a WordPress plugin.

    Note: You can also use the free WPCode plugin for this tutorial. However, upgrading to the Pro version will give you access to a cloud library of code snippets, smart conditional logic, and more.

    Upon activation, just visit the Code Snippets » + Add Snippet page from the WordPress admin sidebar.

    From here, go to the â€˜Add Your Custom Code (New Snippet)’ option and click on the ‘Use Snippet’ button under it.

    Add new snippet

    This will direct you to the ‘Create Custom Snippet’ page, where you can start by typing a name for your code snippet.

    Keep in mind that this name won’t be displayed on the front end and is only used for identification purposes.

    After that, you need to choose ‘PHP Snippet’ as the Code Type from the dropdown menu in the right corner.

    Choose PHP as code type for the dynamic copyright date code

    Once you have done that, simply copy and paste the following code into the ‘Code Preview’ box:

    if ( ! function_exists( 'wpb_copyright' ) ) {
    	function wpb_copyright() {
    		// Cache the output so we don't have to run the query on every page load.
    		$output = get_transient( 'wpb_copyright_text' );
    		if ( false !== $output ) {
    			// Return the cached output.
    			return $output;
    		}
    		global $wpdb;
    		$copyright_dates = $wpdb->get_results(
    			"SELECT YEAR(min(post_date_gmt)) AS firstdate, YEAR(max(post_date_gmt)) AS lastdate FROM $wpdb->posts WHERE post_status = 'publish'"
    		);
    		$output          = '';
    		if ( $copyright_dates ) {
    			$output = '© ' . $copyright_dates[0]->firstdate;
    			if ( $copyright_dates[0]->firstdate !== $copyright_dates[0]->lastdate ) {
    				$output .= '-' . $copyright_dates[0]->lastdate;
    			}
    			// Set the value as a transient so we only run the query 1x per day.
    			set_transient( 'wpb_copyright_text', $output, DAY_IN_SECONDS );
    		}
    
    		return $output;
    	}
    }
    
    echo wpb_copyright();
    

    Upon activation, this code will automatically fetch data and display your copyright date according to the oldest and newest post on your website.

    Next, scroll down to the ‘Insertion’ section and choose the ‘Shortcode’ method.

    We are using this method because we want to specifically add code to the WordPress footer.

    Use the shortcode method

    Finally, scroll back to the top and toggle the ‘Inactive’ switch to ‘Active’.

    Once you have done that, just click the ‘Save Snippet’ button to store your settings.

    Save the code snippet for adding dynamic copyright date

    Now, you have to scroll back to the ‘Insertion’ section and copy the shortcode by clicking on the ‘Copy’ button next to it.

    Keep in mind that you won’t be able to copy the shortcode until you have activated and saved the code snippet.

    Copy the shortcode for the dynamic copyright date

    Add Dynamic Copyright Date to the WordPress Footer Using a Widget

    You now need to add the shortcode to your WordPress footer. This method is for you if you are using a classic theme without the full site editor.

    Once you have copied the shortcode, head over to the Appearance » Widgets page from the WordPress admin sidebar.

    From here, scroll down to the ‘Footer’ tab and expand it.

    For this tutorial, we are using the Hestia Pro theme. Depending on the theme that you are using, your widgets page may look a bit different.

    Next, you need to click on the ‘+’ button in the top left corner of the screen and look for the Shortcode block.

    Upon finding it, just add the block to the ‘Footer’ tab and then paste the WPCode shortcode into it.

    Add shortcode into the footer tab

    Finally, click the ‘Update’ button at the top to save your changes.

    Now, you can visit your website to check out the dynamic copyright date in action.

    Preview for dynamic copyright date in WordPress footer

    Add a Dynamic Copyright Date in a Block-Based Theme

    If you are using a block-based theme on your WordPress website, then you can use this method to add the copyright shortcode to the footer.

    First, you need to visit the Appearance » Editor page from the WordPress admin sidebar. This will launch the full site editor on your screen.

    From here, choose the Footer section and then click on the ‘+’ button in the top left corner of the screen.

    Next, simply find and add the Shortcode block to your preferred area in the footer.

    Once you have done that, paste the dynamic copyright date shortcode into the block.

    Add copyright date shortcode into the FSE

    Finally, don’t forget to click the ‘Save’ button at the top to store your settings.

    You can now visit your website to check out the dynamic copyright date in action.

    Copyright date in fse

    If you don’t want to use code on your website, then this method is for you.

    First, you will need to install and activate the Auto Copyright Year Updater plugin. For details, you may want to see our guide on how to install a WordPress plugin.

    Upon activation, the plugin will automatically fetch data for your copyright date. Keep in mind that the plugin only displays the current year and does not show the range of years that the site has been used.

    To display the copyright date, you will now have to add a shortcode to the website footer.

    Add Dynamic Copyright Date in a Classic Theme

    If you are using a classic theme that doesn’t use the full site editor, then this method is for you.

    First, you need to visit the Appearance » Widgets page from the WordPress admin sidebar. Once you are there, scroll down to the ‘Footer’ tab and expand it.

    For this tutorial, we are using the Hestia Pro theme, so your widgets may look a bit different depending on the theme that you are using.

    Next, click on the ‘+’ button in the top left corner of the screen and find the Shortcode block.

    Simply add the block to the ‘Footer’ tab and then copy and paste the following shortcode into it to display the copyright date:

    [cr_year]

    Add plugin shortcode in the footer widget

    If you also want to add a copyright symbol along with the date, then you should add the following shortcode as well.

    [cr_symbol]

    Finally, click the ‘Update’ button at the top to save your changes.

    Now, you can visit your website to check out the dynamic copyright date in action.

    Plugin shortcode preview

    Add Dynamic Copyright Date in a Block-Based Theme

    If you are using a block-based theme with the full site editor, then you can insert the dynamic copyright shortcode with this method.

    You need to head to the Appearance » Editor page from the WordPress admin sidebar.

    Once you are there, choose the ‘Footer’ section and then click on the ‘+’ button in the top left corner of the screen. Then, look for and add the Shortcode block.

    After that, add the following shortcode into the block to display the copyright date on your website:

    [cr_year]

    Add plugin shortcode

    If you want to add a copyright symbol along with the dates, then simply copy and paste the following shortcode into the block as well:

    [cr_symbol]

    Finally, click the ‘Save’ button at the top to store your settings.

    Now, you can visit your website to see the dynamic copyright date in action.

    Copyright date preview with plugin

    We hope this article helped you learn how to add dynamic copyright dates in the WordPress footer. You may also want to see our tutorial on how to use a headline analyzer in WordPress to improve SEO titles and our top picks for the best WordPress 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 a Dynamic Copyright Date in WordPress Footer first appeared on WPBeginner.

  • How to Use Shortcodes in Your WordPress Themes

    Do you want to use shortcodes in your WordPress theme?

    Normally, you will use shortcodes inside content areas like posts, pages, or sidebar widgets. However, sometimes you may want to add a shortcode inside your WordPress theme.

    In this article, we will show you how to easily add any shortcode to your WordPress theme.

    How to use shortcodes in your WordPress themes

    Why Use Shortcodes in Your WordPress Themes?

    Shortcodes allow you to add all kinds of features to your website, including image galleries, forms, social media feeds, and much more.

    WordPress comes with a few built-in shortcodes, but there are also many popular WordPress plugins that add shortcodes to your site.

    For example, WPForms has easy-to-use blocks, but it also provides shortcodes so that you can add forms to other areas of your website.

    An example of a WordPress shortcode, provided by WPForms

    Most of the time, you will add shortcodes inside content areas like posts and pages.

    To learn more, please see our complete guide on how to add a shortcode in WordPress.

    Adding a shortcode block to a WordPress page or post

    However, sometimes you may want to use a shortcode inside your WordPress theme files.

    This allows you to add dynamic elements to areas you can’t edit using the standard WordPress post editor, such as your 404 page. It’s also an easy way to use the same shortcode on multiple pages.

    For example, you might add a shortcode to your theme’s Page or Post template.

    With that in mind, let’s see how you can use shortcodes in your WordPress theme. Simply use the quick links below to jump straight to the method you want to use.

    Method 1: Using the Full-Site Editor (Block Themes Only)

    The easiest way to use shortcodes in your WordPress theme is by using the full site editor. This allows you to add a Shortcode block to any part of your website.

    However, this method only works with block-based themes like Hestia Pro. If you are not using a block-enabled theme, then you will need to use a different method instead.

    To get started, head over to Themes » Editor in the WordPress dashboard.

    Opening the WordPress full-site editor

    By default, the full site editor shows your theme’s home template, but you can add shortcodes to any template or template part, such as the header or footer.

    To see all the available options, just select either ‘Templates’ or ‘Template Parts’.

    Adding a shortcode to a WordPress template

    You can now click on the template or template part you want to edit.

    As an example, we will add a shortcode to the 404 page template, but the steps will be exactly the same no matter which template you select.

    Adding a shortcode to a WordPress theme using a full-site editor (FSE)

    WordPress will now show a preview of the template or template part.

    To add a shortcode, go ahead and click on the small pencil icon.

    Editing a WordPress theme's 404 template using the full-site editor (FSE)

    With that done, click on the blue ‘+’ icon in the top left corner.

    In the search bar, you need to type in ‘Shortcode’.

    Adding a shortcode block to a WordPress theme

    When the right block appears, drag and drop it onto the theme template.

    You can now either paste or type the shortcode that you want to use.

    Adding Shortcode blocks to a WordPress theme

    After that, go ahead and click on the ‘Save’ button.

    Now, simply visit your WordPress blog to see the shortcode in action.

    An example of a shortcode, on a 404 page template

    Method 2: Editing Your WordPress Theme Files (Works With Any WordPress Theme)

    You can also add shortcodes to your WordPress theme by editing the theme files. This method is more advanced, but it works with every WordPress theme.

    If you haven’t added code to your site before, then check out our step-by-step guide on how to copy and paste code in WordPress.

    You can modify the individual theme files directly, but this makes it difficult to update your WordPress theme without losing customization. For this reason, we recommend overriding the theme files by creating a child theme.

    If you are creating a custom theme, then you can add or modify the code in your existing theme files.

    When editing your theme files, you can’t add the shortcode in the same format you use with standard content areas. Instead of seeing the shortcode’s output, you will see the shortcode itself on the screen.

    This happens because WordPress doesn’t execute shortcodes inside theme template files. Instead, you will need to explicitly tell WordPress to run the shortcode using the do_shortcode function.

    For more information, please see our guide on how to easily add custom code.

    Here’s an example of the code you will add to your WordPress theme files:

    echo do_shortcode('[gallery]');
    

    Simply replace ‘gallery’ with the shortcode you want to use.

    If you are not sure where to add the shortcode, then please see our beginner’s guide to the WordPress template hierarchy.

    If you are adding a shortcode with extra parameters, then the code snippet will also change a little bit.

    Imagine you have created a contact form using WPForms. In this case, you will need to use the standard WPForms shortcode plus the form’s ID:

    echo do_shortcode("[wpforms id='92']");
    

    Troubleshooting: What to Do When do_shortcode Isn’t Working

    Sometimes, you may add a shortcode to a theme file, but the code’s output doesn’t appear on your WordPress website. This usually means the shortcode depends on a WordPress plugin or some other code on your website.

    If the do_shortcode function is not working, then make sure the plugin providing the shortcode is installed and activated by going to Plugins » Installed Plugins.

    In the following image, WPForms is installed but deactivated, so the echo do_shortcode code won’t work.

    How to instal and activate a WordPress plugin

    You can also check whether a shortcode is available for you to use by adding the shortcode_exists() function to your index.php file.

    In the following snippet, we are checking whether the WPForms snippet is available to use on our website:

    if ( shortcode_exists( 'wpforms' ))  {
      echo do_shortcode("[[wpforms id='147']]");
    }
    

    If you still don’t see the shortcode output on your website, then try clearing the WordPress cache, as you may be seeing an outdated version of your site.

    Method 3: Creating Your Own WordPress Theme (Fully Customizable)

    Another option is to create a custom WordPress theme. This is a more advanced method, but it allows you to add as many shortcodes as you want to any area of your WordPress theme. You can also make other changes to create a theme that has exactly the features and design you want.

    In the past, you would need to follow complicated WordPress tutorials and write code to build a custom WordPress theme. However, it’s now possible to create a custom theme without writing a single line of code using SeedProd.

    SeedProd is the best WordPress page builder and also comes with a theme builder. This allows you to design your own themes using drag and drop.

    SeedProd's advanced theme builder feature

    For step-by-step instructions, please see our guide on how to create a custom WordPress theme (without any code).

    After creating a theme, you can add shortcodes to any part of your WordPress website by going to SeedProd » Theme Builder.

    Custom WordPress theme templates

    Here, find the template where you want to use a shortcode.

    Then, just hover your mouse over that template and click on ‘Edit Design’ when it appears.

    Creating a custom theme using SeedProd

    This will open the template in SeedProd’s drag and drop page builder.

    In the left-hand menu, scroll to the ‘Advanced’ section. Here, find the Shortcode block and drag it onto your layout.

    Adding a Shortcode block to a theme using SeedProd

    In the live preview, simply click to select the Shortcode block.

    You can now add your shortcode into the ‘Shortcode’ box.

    Adding a contact form to a WordPress theme using shortcode

    By default, SeedProd doesn’t show the shortcode output in the live preview.

    To see your shortcode in action, click on the ‘Show Shortcode Option’ toggle.

    Previewing the shortcode output in SeedProd

    After that, you may want to add some styling to the shortcode output by selecting the ‘Advanced’ tab.

    Here, you can change the spacing, add custom CSS, and even add CSS animation effects.

    Styling shortcode output using the SeedProd theme builder

    When you are happy with how the page looks, just click the ‘Save’ button.

    After that, select ‘Publish’ to make the shortcode live.

    Publishing a custom WordPress theme using SeedProd

    You can now visit your website to see the custom shortcode in action.

    We hope this tutorial helped you learn how to use shortcodes in your WordPress themes. You may also want to check out our guide on how to create a landing page in WordPress and our expert picks for the best social media 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 Use Shortcodes in Your WordPress Themes first appeared on WPBeginner.