Tell us what you are trying to do?
My goal is to be able to append a PDF download link at the end of a custom post type. The PDF is a print-ready copy of the online content. The PDF link is stored in a custom field.
At this stage:
I have set up a standard wordpress category for the post type called "articles".
I have created a custom field for the PDF content which is stored in the Media Library.
I have specified that the custom field is a requirement for articles.
I have created a content template for these articles. The content template contains two blocks. One is "Post Excerpt" that pulls in the post excerpt, and the other is a Single Field block that specifies the custom field for the PDF content.
Up to this point everything works well. However, I realised that only the blocks defined in the content template are displayed. I would like the post content to be displayed too.
I edited the content template to include a Single field block that used Post Content (Body). The template then had three blocks:
Post Excerpt
Post Content
File Link
On looking at the output I could see the excerpt and the file link duplicated. The published page looked like this:
Post Excerpt
Post Excerpt
Post Content
File Link
File Link
I reverted the template. I'm wondering how to include the post content without duplicating the excerpt and file link.
I'm not an experienced Toolset user so I appreciate any advice you have.
What is the link to your site?
hidden link
This link displays all the custom post type "articles". Click through to see the content template in action.
Hi there,
It seems the issue is working with Block editor rather than the concept of the Toolset post types as I think you set things up correctly.
The Post Content setting that you mentioned is also correct, what you need to do is to make sure that there is no additional block duplicated.
For that, please click the three-line button at the top left section of the screen, it'll give you a hierarchical representation of the blocks you have on the content template.
There, please double-check and see if you have some duplicated blocks. If yes, select them and delete them.
Please check the screenshot.
Thanks.
Hi Christopher,
I have checked the structure of the template in list view. I have attached a screen shot of the editor view and the published view.
The three single field objects visible in the editor view are: post excerpt, custom field, and post content. You can see that the excerpt and custom field link are displayed in the post content block the template editor view. The published view does the same thing.
The post content block has determined that the excerpt and custom field are page content and included them. In some ways that makes sense. In this case, I want to get the post content prior to the inclusion of those objects.
Hi there,
I'd appreciate it if you could give me the URL/User/Pass of your WordPress dashboard after you make sure that you have a backup of your website.
It is absolutely important that you give us a guarantee that you have a backup so if something happens you will have a point of restore.
Make sure you set the next reply as private.
Also, please tell me which content template to check.
Hi there,
Thank you for the login information. I checked and the problem of the duplicate content comes from the information that you have inside the single posts.
For example, if you go to the "protein rich foods for vegans" post you will see that you embedded the content template itself inside the content of the post. (Check the screenshot)
That is the problem cause. You need to add static text and content inside that post.
Thank you.
Aha! I didn't understand the way in which the templates were being applied.
thanks for the assistance.