- This topic has 14 replies, 5 voices, and was last updated 2 years, 8 months ago by
Fernando.
-
AuthorPosts
-
December 28, 2022 at 8:36 am #2475913
Nicolas
Hello,
Please check the URL 1 shared in the PI field.
You will see that at the end of their posts, you can find 2 Related Posts. You also have an arrow to display 2 more. That equals to a total of 4 related posts.I assume they are offered automatically. I assume the system selects them out of the same Category.
Maybe there is a smart system to also select the closet ones semantically speaking but I’m not sure about that.How can I do so with GP?
Please note that my questions concerns as much the content selection AND the layout?
How can I reproduce the same layout as on the URL shared? Or do you have a better alternative in mind based on what you have seen through your experience and that would fit well with my blog style (see URL 2 shared)December 28, 2022 at 12:06 pm #2476072Leo
StaffCustomer SupportHi there,
GP doesn’t have related posts feature built-in.
You can consider using the GB pro with the Query loop block:
https://generateblocks.com/creating-related-posts-with-query-loop-block/Or a related posts-specific plugin like this:
https://wordpress.org/plugins/contextual-related-posts/Hope this helps 🙂
December 29, 2022 at 3:26 am #2476670Nicolas
Hi there,
I need some more help here.
I tried following the tutorial on https://generateblocks.com/creating-related-posts-with-query-loop-block/
Please see here: I selected Categories for TAXONOMIES and the Category Term CUISINE for the sushi post (see url in P.I. field)Nothing happens. I’m have a feeling I have missed setting something but I do not know what.
Also and anyway, the URL I shared in the PI field is from another them and the Related posts you can see displayed at the bottom of each of their posts is done BY DEFAULT, I mean, with the default theme. It means this is doable. So how can I get the exact same layout with GP please?
I shared a URL 3 where something similar has been done with GP. I was said this was generated automatically.
So my questions are:
1 – How can I get the layout of URL 2 with GP for my blog?
2 – Will I need to add a block manually to each of my posts everytime I need to add the Related Posts block, or is there a way to automate this like for the URL 3?Thank you
December 29, 2022 at 10:44 am #2477202Ying
StaffCustomer SupportYou can add the
query loop block
into ablock element - hook
, choose after_entry_content as the hook name, chooseposts > all posts
as the location.
https://docs.generatepress.com/article/block-element-hook/But without GenerateBlocks pro, you will NOT be able to exclude the current post from the query loop block.
That is why Leo suggested using a related posts plugin.
January 7, 2023 at 4:33 am #2486818Nicolas
Hello,
Sorry,
I’m very confused and stuck.
Yin, I started creating what you said.This is where I’m stuck.
As explained above, my idea is to offer the visitors a grid with 2 columns: In each column I want to display a Related post from the same categories in a nice way. I just need the feature image and title of the post to appear in a nice way that entices clicking.
Where do I go from where I am? WHat are the next steps?
Thank you.January 7, 2023 at 12:18 pm #2487296Ying
StaffCustomer SupportQuery loop block has a Grid block, so you don’t need to add it inside a Grid block.
So the structure would be:
- Container - Query loop - Grid - Container (post template)
You can add a GB image block to show the featured image, and a GB headline block to show the title into the Container (post template).
Set the Container (post template) width to 50%.
January 7, 2023 at 3:05 pm #2487394Nicolas
Thank you Ying.
1. I now have the structure, but I don’t know how to set the Dynamic Data in order to get the feature image. Same with the Large Headings.
2. Also, I cannot seem to duplicate the container so as to get 2 Related posts next to each other.
January 8, 2023 at 9:50 am #2488071David
StaffCustomer SupportI would suggest testing out one of the premade Patterns that you can copy from here ( or add from the GB Pro Patterns library ):
https://generateblocks.com/library/?pattern-category=query-loop
Then you can see they how they are built.
To change the number of columns in a query loop, select the Post Template block inside the Query Loop and set its % width. eg, 50% for 2 column, 33% for 3 columns
January 12, 2023 at 11:28 am #2493303Nicolas
Thanks to your advice I was able to use a premade patterns and customize it like this.
But:
1 – How do I get rid of the circled part on all my post then?
2 – How can I make sure the 2 posts selected are NOT the same as the post already displayed, and are part of the same Category?
January 12, 2023 at 12:53 pm #2493391Ying
StaffCustomer Support1. The category and post navigation can be disabled at customizer > layout > blog > content > single.
2. GB pro has the option to exclude the current post.
January 12, 2023 at 3:00 pm #2493521Nicolas
1. Thanks.
2. I know for I remember playing with it a few weeks ago, but I cannot remember where I should click.
On the Query Loop? What settings? Where?3. I would like to keep the Post categorie but display it like here for “Manga” on my GP theme. How to do so please?
January 29, 2023 at 9:19 am #2513169Nicolas
Hi,
Anyone for my questions above and especially n°3?
Plus can you confirm the option if those settings are correct to exclude the current post from being listed as a related post? In other words, how to avoind having a post being listed as a related post on its own page?
Regards
January 29, 2023 at 12:03 pm #2513309Ying
StaffCustomer SupportYour last reply slipped through our support system, sorry about that.
For question 2, try following the instructions here:
https://generateblocks.com/creating-related-posts-with-query-loop-block/For question 3, is the screenshot taken from a single post or an archive page?
January 29, 2023 at 7:05 pm #2513557Nicolas
For question 3, see URL in PI field (not my site and not using GP theme, but I want the same on my site)
My posts are using the “standard GP posts/settings”. How to add the category tags like on the screenshot? I don’t want to enter into the process of creating a post template. I want the easiest solution to add the Category term at the top of the post like on the screenshot shared while having the possibility to adjust its layout (i.e. changing the background and font colors).Question 2: Solved. Thank you for the tuto link.
January 29, 2023 at 7:41 pm #2513577Fernando Customer Support
Hi Nicolas,
3. The easiest way would be through a Block Element – Hook.
Add a GB Headline Element and set the Dynamic Text Type to List of Terms – Categories.
Then hook the ELement to
before_entry_title
. Example: https://share.getcloudapp.com/BluRmWOx -
AuthorPosts
- You must be logged in to reply to this topic.