Archived topic
Helpful Advice to Fix Custom Posts Not Showing
26 replies · Started by Ken on July 11, 2021
Okay I uploaded the two templates for “One Product Post”. Not sure how to share the link to my GIST, here goes…
content-one_product.php
The link isn't working.
You can share the GIST by sharing it's URL. :D
Got it. They sure don't make it easy to understand what link to use and where it is.
Luckily I copied the link when I set it up. Hopefully this will work;
https://gist.github.com/iFillip/7aaa17a590e7e4bf32957de69cf00a2a
Yes! Solved the theme editor problem. I'm using Patch a security plugin, the disable editor was selected. I re-enabled it. Theme editor is back.
Hopefully the custom post problem will be easy too. I hope. I understand this may take some time. No problem, I'm going to make a pot of tea.
Elvin,
If for some reason you need to get access to my wordpress dashboard here's the Temporary Login.
Thanks.
On your single-one_product.php.
Can you change this line - generate_do_template_part( 'single','one_product' );
To this line - get_template_part( 'content','one_product' ); ?
Let us know how it goes.
Wow! Looks like you fixed part of the problem.
All the 'text' typed it the fields shows up. However, the excerpt is at the bottom. Not sure if that is how it's suppose to be.
Links to screenshots;
1) Yes, the content is there! But the excerpt is at the bottom.
2) Here's what it looks like on the backend in the post editor
The order is something you change on the content-one_product.php template.
Your op_content field is placed on the bottom-most part so it appears on the bottom.
You'll have to sort the echoed get_field() values to your preference - https://gist.github.com/iFillip/7aaa17a590e7e4bf32957de69cf00a2a#file-content-one_product-php-L71-L107
Hi Elvin,
Sorry, looks like I may have made a wrong assumption. I found this:
"Excerpt is an optional text associated to a Post. Most of the time, it is used as the Post summary."
So I believe I'm GOOD TO GO! \(*<>*)/
Wow! You folks constantly amaze me.
My final question: Should i go ahead and do the same for the rest of the Custom Post Types? That is, change to "get_template_part( 'content','the_templates_name');
Looks like my message crossed.
I will check the 'echoed get_field with my coach on where the 'excerpt' should be.
But for now, I just need to confirm doing the same template changes to the other templates.
Again thank you so much for this. She'll be very happy. Maybe she'll leave Kadence and come join GeneratePress...that's what
I did.
My final question: Should i go ahead and do the same for the rest of the Custom Post Types? That is, change to “get_template_part( ‘content’,’the_templates_name’);
Yeah that's pretty much it. You'll have to change that line on the respective single-your_CPT_template.php so it calls the appropriate content-your_CPT_template.php.
Great! Will do the changes.
Elvin, thank you sooo much! I'm closing this ticket with a smile, hope you're smiling too.
No problem. Regardless of the difficulty of the ticket, we're genuinely glad when it gets sorted. :D