Get inside access to design tips from a pro! Subscribe to Design to Dollars

GenerateBlocks, GeneratePress

How to Add a Call to Action Box to Your Blog Posts using GeneratePress & GenerateBlocks

Adam Wright

by Adam Wright

If you’re looking to add a call-to-action (CTA) box to your blog posts using GeneratePress and GenerateBlocks, this guide will walk you through two approaches depending on whether you already have a blog post template in place or not.

Approach 1: Adding a CTA Box to an Existing Blog Post Template

If you already have a blog post template set up, here’s how to add a CTA box directly into it.

  1. Access Your Blog Post Template:
    • Go to Appearance > Elements in your WordPress dashboard.
    • Locate and edit your existing blog post template element.
  2. Insert a CTA Box:
    • Scroll down to the area just after the blog content module.
    • Insert a new container to serve as your CTA box.
    • Add a background color to make it stand out and apply some border radius (e.g., 10 pixels).
    • Add padding to the container (e.g., 40 pixels) for spacing.
  3. Add Content to the CTA Box:
    • Insert a headline block, such as “Thanks for reading the blog,” and center it.
    • Style the text as needed, like making it white for contrast.
    • Add a button below the headline. Label it “Back to Main Blog” or something similar.
    • Center the button by selecting the button container, going to Layout, and setting Justify Content to Center.
  4. Link the Button:
    • Add the appropriate link to the button, such as linking back to your main blog page.
  5. Save and View:
    • Update the element and refresh your blog posts to see the CTA box appear at the end of the content. This will now display on every blog post that uses this template.

Approach 2: Adding a CTA Box Without a Blog Post Template

If you don’t have a blog post template set up, you can create a new element and hook it into your blog posts.

  1. Create a New Element:
    • Go to Appearance > Elements and select Add New.
    • Choose Block as the element type and name it something like “CTA Box.”
  2. Design Your CTA Box:
    • Insert a container with an inner container to contain the content.
    • Add background color, border radius (e.g., 10 pixels), and padding (e.g., 40 pixels).
    • Insert a headline, like “Check out our services.”
    • Add a button, label it “View Services,” and style it as needed.
  3. Align Content:
    • If using a grid layout, align the elements vertically to ensure everything looks neat and centered.
  4. Set the Display Rules:
    • In the Location section, choose Posts and set it to display on all posts.
  5. Hook the CTA Box:
    • Under the Element settings, find the Hook Name option.
    • Select after_main_content as the hook name. This ensures the CTA box appears after the main content of your blog posts.
  6. Save and View:
    • Publish the element and view your blog posts to see the CTA box appear after the content. If you need to adjust the width to match your content, you can set a max width (e.g., 800 pixels) for the container.

Conclusion

By following these steps, you can easily add a call-to-action box to your blog posts using GeneratePress and GenerateBlocks. Whether you’re using a pre-existing blog post template or adding a new element, these methods give you the flexibility to guide your readers with a clear CTA. This is a great way to encourage further engagement, whether it’s directing readers back to your main blog page, promoting services, or any other action you want them to take.

Subscribe

Follow My YouTube Channel for More Tutorials

Subscribe to Channel
Adam Wright

About the Author

Adam Wright

Adam is a California native, now living in Middle Tennessee. A long-time creative at heart, his passion for design and growing his small business, AWD, is always evident. When he's not writing code or sketching logos, he enjoys spending time with family, playing basketball, or watching just about any motorsports. Find him on LinkedIn.