- This topic has 28 replies, 4 voices, and was last updated 3 years, 4 months ago by
David.
-
AuthorPosts
-
November 23, 2022 at 11:07 pm #2430393
Charbel
Hello @Ying,
I add it automatically to every post as text and then I set it to h2. So it’s not an element.
Yes, I manually adding it to every post.
I have the following filter in place under my functions.php to add it.add_filter( 'default_content', 'my_editor_content' ); function my_editor_content( $content ) { $content = ' __ Thank you for reading my blog. Related Posts'; return $content; }Please advise.
Thank You!
November 23, 2022 at 11:25 pm #2430401Fernando Customer Support
How are you planning to Show Related Posts with this code? The code is incomplete. Or, you didn’t just include it here?
Or is this just a placeholder for text? If so, why not add it through a Block Element – Hook and hook it to
after_entry_contentas well? You’ll just need to change the priority to6if you want it after the Author Box which has a priority of5as you’ve mentioned.If you have the complete code, you can likely add it as an action hook as well through a Hook Element hooked to
after_entry_content.Sidenote: You can add Related Posts with GenerateBlocks Pro: https://generateblocks.com/creating-related-posts-with-query-loop-block/
November 23, 2022 at 11:45 pm #2430419Charbel
Thank you @Fernando,
Please note that in the code I shared above, I only added the text Related Posts, and I don’t show any related posts.
Then, I am injecting Adsense code after the text Related Posts to show Ads as shown in the screenshot below. I need to keep that.

Now the Author Box is in between.
I thought about adding another Block Element – Hook and hooking it to
after_entry_contentas well with the priority to6.
But the issue is, how can I remove and delete all the manual text Related Posts that I added to all my posts?Thanks!
November 24, 2022 at 12:22 am #2430457Fernando Customer Support
Oh I thought “Related Posts” was added dynamically through a Filter. It’s a bit hard to analyze the situation since “Inspect Element” seems disabled for your site.
To clarify, is it dynamically added through the filter you have above, or is it manually added at the end of each post?
November 24, 2022 at 1:50 am #2430546Charbel
Hello @Fernando,
Yes, the Related Posts is dynamically/automatically added through the filter that I shared above when I create a new Post.
Hope it’s clear now.
November 24, 2022 at 4:04 am #2430787David
StaffCustomer SupportBut the issue is, how can I remove and delete all the manual text Related Posts that I added to all my posts?
You would need to either manually edit each post, or search your database to remove them.
November 24, 2022 at 5:53 am #2430959Charbel
Thank You @David,
What is the safest way to search the database and remove them, please?
I think the best way is to create a new Block Element and add the text “Related Posts” with priority 6.
November 24, 2022 at 6:09 am #2430981David
StaffCustomer SupportYour host may have some integrated solutions.
If not here is a good article on the matter:Advisable to work on a backup of your site.
Yes, using a Block Element to output the related posts is best. Same hook with a higher priority is correct.
November 24, 2022 at 6:24 am #2431007Charbel
Thank you, @David!
I was able to search and replace the 2 words using a plugin.
The second block element with Priority 6 is working as expected.
I have cleared the cache so you can have a look and let me know your feedback!I am still investigating the Avatar Photo issue.
Many Thanks!
November 24, 2022 at 6:49 am #2431055David
StaffCustomer SupportLooks good to me 🙂
The Avatar will only display if one exists. Unless you’re using a plugin that saves them locally you will need a Gravatar Account:
November 24, 2022 at 7:24 am #2431094Charbel
Thank you @David,
I found the issue, I am disabling the Avatar Display under
options-discussion.php
Dashboard > Settings > Discussion

I remember that I disabled this option to improve performance because I don’t show avatar photos for all users who are commenting/leaving a comment.
After I enabled Show Avatars, I can see my Avatar photo that I set here: https://en.gravatar.comI don’t want to show photos under the comment section.
Check here now: https://charbelnemnom.com/schedule-azure-vm-using-azure-function/comment-page-3/#comment-10979Thanks!
November 24, 2022 at 7:53 am #2431425David
StaffCustomer SupportTry the PHP Snippet provided here:
November 24, 2022 at 8:51 am #2431540Charbel
Perfect, thank you @David, much appreciated!
You are always solving my issues 🙂
I kept the option to Show Avatars for my Author Box and remove all Avatars from the comment list.
Many Thanks!
November 25, 2022 at 3:34 am #2432658David
StaffCustomer SupportGlad to be of help!!
-
AuthorPosts
- You must be logged in to reply to this topic.