In this tutorial, you will learn some processes to migrate WP Show Posts Plugin to GenerateBlocks.
If you are a regular GeneratePres user then you might have already guessed what we are doing to do here.
If not then, then here we are going to merge all of the WP Show Posts (WPSP) functionality to GenerateBlocks.
The reason is simple i.e. Tom Usborne and the team decided to merge WP Show Posts with GenerateBlocks as WP Show Posts needed an upgrade to block editing. Here, Generateblocks provides almost all the functionality as WPSP could provide.
Migrating from WP Show Posts Plugin to GenerateBlocks
The new GenerateBlocks 1.5 has added Dynamic Data, Query Loops, & Image Blocks and here we are going to utilize those functionalities while doing a migration.
1. Migrating Featured Posts in GeneratePress Sidebar
Here, we are going to migrate showing featured posts in the GeneratePress sidebar from WP Show Posts to GenerateBlocks.
Here we are going to use Generateblocks Query Loops. Here I have set featured as a tag for some posts that I want to feature in the sidebar widget.
so, let’s get started. Before that please make sure you are using the latest version of GenerateBlocks.
First, I am going to visit my widget section. Appearance > Widgets.
First, add a Container block, and inside the Container block, add a Query Loop Block.
Now add Title & Date Layout to start with, here we only need the title, so delete the post date meta.
Now, you select Query Loop block and you can see Query Parameters settings on the right side.
Click on Add Parameters > Under Select query parameter > Choose Taxonomies > Select Tags > Choose featured tags under Select terms.
Now, you will be able to see the list of featured posts, you can control the settings using Generateblocks. so play with those settings.
Like, to adjust the spacing between two post links, you have to first select Post Template Block and change Vertical Gap.
2. Migrating Latest Posts from WP Show Posts on Homepage
Showing the latest post or featured post to your homepage is much easier now with Generateblocks. Before we were using the WPSP plugin but now with Dynamic Data, Query Loop, and Image block it’s easier to add the latest posts or featured posts.
As always, first, add the Container block.
Inside the Container block, add the Query Loop block from GeneratePress, not the default one.
Now choose Two columns & a featured image Layout.
Let’s say you want to show 3 posts in a row then make a container width of 33 or if you want to show 4 posts in a row then make a container width of 25.
For this tutorial, I am going to delete the Post Excerpt block. Now, manage container spacing, adjust Post Title Font Size, etc. to make it beautiful. Also, adjust Post Template Horizontal and Vertical Gap.
Here is the tip for you, if you have images with distinct widths and heights for each post then you can adjust it by following ways.
First click on an Image block, Under settings, assign the height of the image, let’s say 130 px, under Object-fit choose Cover. That’s it.
3. Migrating Related Posts from WP Show Posts on Generateblocks
Here we are going to create related posts using GenerateBlocks and here we are going to migrate our existing related posts created using WP Show Posts earlier.
First, you need the GenerateBlocks Pro version to enable certain features to enable related posts in your current posts.
Go to Appearance > Elements to Add New Elements. Choose Block as Choose Element Type to create a new Block.
Name your Block Element as Related Posts.
Now, Add a Container Block and add some padding around 10px from all sides. Inside container block, add Heading as Recommended Reading…
Now, within Container Block, add Query Loop by GenerateBlocks.
Add Title & date as a Query Loop Layout to start with. You can delete Post Date from Post Templates if you want to remove the date.
Now select Query Loop and add Parameters like in the screenshot.
- Select Post Type – Posts
- Post Per Page – 10 by default (Change as required)
- Taxonomies – Categories or Tags
- Select Terms – Current Post Terms
- Exclude Posts – Exclude Current Post
- Order by – Date
- Now Choose Location as Post – All Posts.
Now the final step is to select the Element type as Hook and Hook Name as after_content.
Finally, Hit Publish button.
Here is the result of the related post in GeneratePress using the Generateblocks Pro version.
At the End
Likewise, you can use the Generateblocks plugin to design or edit various parts of your website and it is more powerful than ever.
Moreover, you can completely switch from WP Show Posts plugin to Generateblocks as the GP Team is merging all the functionality of the WPSP free and Pro version to the GB Free and PRO version.