-
I have created a new element because I dabbled in Custom Post Types for the first time today. It’s all setup and everything but the element, which is a related posts element, is not displaying where I want it too. I usually use Jetpack related posts but I couldn’t get it to display on CPT so that’s why I decided to create an element.
It is currently below my author box, but I want it above it, it seems no matter what I select, it doesn’t go there. Selecting after_content or after_entry_content makes it not even appear entirely.
-
You can edit your content template, and add the related posts into the content template above your author box.
-
Hi Ying,
No I am happy with Jetpack it’s ten times better than GP related posts or using coding on php. Here’s the reasons why.
I don’t know how Jetpack does it, but the 3 related posts it suggests each time is spot on. With [hp editing or GeneratePress’s way, you set a category or tag. The problem is, where 80% of posts would be accurate, the other 20% would not.
Examples:
So using the Fortnite tag will then give back 3 very relatable posts all under Fortnite, so all good. The same for say, Resident Evil 4 tag, it would be spot on ect. ect..
What about tags like Xbox Series though? So as a fantasy example situation, I’m writing about an Xbox Series X console update article, I have set the tag to Xbox Series, but the 3 related posts with php editing method, and GP elements way, would come back with 3 Xbox Series posts, for e.g Inidana Jones and the Great circle Xbox Series Release Date, Cities Skylines 2 finally gets an Xbox Series Release Date, New Minecraft Xbox DLC out now. I’ve just made those 3 up, it’s just an example. It would just be taking posts from under Xbox Series but the related posts would need to be about Xbox Series updates.
Now for what Jetpack would provide: Xbox Backward Compatibility faces issues After August Update, New Xbox Feature Simplifies Controller Pairing In Update, Far Cry 4 Update 1.08 Brings 60FPS to PS5 and Xbox Series X|S
Okay so it’d get one wrong (The Far Cry related post) but you see how effective and to the T it is.
It’s as if Jetpack goes by the words in the article and finds the 3 most relative posts. It’s highly effective but like I said, I’m unable to use in custom post types so for those, I will create a GP element (and I have) just having trouble with where it displays (I want it above my author box).
Thanks in advance
-
Alvind
Hi there,
If you’re referring to the Hook Visual Guide, the
after_contenthook is the correct one — it places the element exactly in the position you’re targeting.If the content doesn’t appear at all when using that hook, something else on the site is likely interfering (a condition, priority conflict, or markup issue). If you’d like us to check what’s causing it, feel free to provide a temporary admin login and we can take a direct look.
-
Yes please, info below 🙂
-
No I am happy with Jetpack it’s ten times better than GP related posts or using coding on php.
I know, but we are talking about CPTs, aren’t we?
I suggest you add the GP related posts to your CPT’s content template, it will NOT affect your regular posts.
Let me know if it’s clear.
-
Oh I haven’t created a Content Template for CPT’s. I suppose that’s an idea actually. I’ll do that. One other thing, You see my 3 related posts, the first one is uneven in size due to the overlapping text on the other two, how can I make all three even?
Thanks
-
Just created it for CPT, what do I set Templates – Apply to
It’s currently set to all posts but I imagine that is wrong.
-
Set the location to your CPT, so reviews > all reviews.
-
Yeah I did, just wondered if that setting (Templates) needed to be changed.
What about this:
One other thing, You see my 3 related posts, the first one is uneven in size due to the overlapping text on the other two, how can I make all three even?
Thanks in advance 🙂
-
Remove the
aspect-ratioyou set for the loop item block. -
That didn’t fix it, it adds loads of white space underneath, that’s why I added that Aspect ratio to try and combat all that white space somehow :/
-
What do you mean by it adds loads of white space underneath? I do not see the issue.
This is what I see:
https://app.screencast.com/rBzpzIemTFJSe -
LOL yeah tons of white space underneath, Look at PlayStation 5, the first box, loads of white space underneath the text.
-
Don’t you want them to have the same height? Did I understand your question incorrectly?
-
I do, but even the other two could be trimmed at the bottom abit too. I want the text to touch the ground so to speak.
- You must be logged in to reply to this topic.