Skip Navigation

[Resolved] Wrong template file use, I cannot edit template file – how to edit template file

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 7 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 10 replies, has 2 voices.

Last updated by stavrosP 7 years, 9 months ago.

Assisted by: Beda.

Author
Posts
#488183
x-version.jpg
wrong-2.jpg
wrong-1.jpg
correct-2.jpg
correct-1.jpg

I am trying to:

Dear All,

Wrong template file.

I have this problem:

I have created a clone of our site in a staging URL and when I create a new template file (single-what-we-treat.php), this file is used for this post type (treatments).

Please check these screenshots:

hidden link
hidden link

When I make the same changes to the live site (creating the template file and then editing the slug of the post type to what-we-treat), I see those warning messages:

hidden link
hidden link

Why does this happen?

Can I edit the template file via phpMyAdmin or via WordPress dashboard so that the correct template file is used (the single-what-we-treat.php and archives-what-we-treat.php)?

Please let me know.

Thanks in advance.

I visited this URL:
https://toolset.com/forums/topic/where-to-change-base-of-type-template-from-single-php-to-a-diff-theme-file/

I expected to see:
hidden link
hidden link

Instead, I got:
hidden link
hidden link

#488290

It seems your template does not include any Types data (fields for example).

Can you confirm to have followed these Docs:
https://toolset.com/documentation/customizing-sites-using-php/creating-templates-single-custom-posts/
https://toolset.com/documentation/customizing-sites-using-php/creating-templates-custom-post-type-archives/

This should work flawlessly and be recognised correctly.

#488298

Dear Beda,

Thank you for the prompt response.

I had checked the URL that you mention.

The funny thing is that it works for clone site but not for the live site.

Needless to say, I have created a single-what-we-treat.php file but it is not picked up.

How can I "edit" the template file so single-what-we-treat.php is used?

Regards,
Stavros

#488300

Well, it should be used by the WordPress hierarchy, this is basically not really a Types behaviour only.

I need to see that in action.
Can you provide Site Access, with exact links to the Post Types, single Posts, and also FTP details so I can see the file?

It would help a lot if the site would be using only a Native Theme (Child of it, without any customization but the File), and no other plugin but Types.

#488307

OK, I have sent you what you asked me for.

If you manage to fix it, please let me know what you changed and made it work.

#488309
Front end single post (edited live).png
Backend single post (edited live).png
Front End, see
Backend edit of file (see

You do not have any single Field for those Post types configured with Types.
If you see under Toolset > Post Fields, there are 2 groups but those are empty.

So you cannot display any Types fields with that Template - since they do not exist.
You can ignore the message because your template IS applied, you can see this by visiting the Archive and edit the Template as shown in my ScreenShots

#488315

Thank you for the prompt response.

I know that the correct template file was used but it was not shown at Toolset dashboard.

I have deleted the 2 empty post field groups and it looks fine on Toolset dashboard as well.

Have you added anything else apart from the "EDITED LIVE" string? If yes, please let me know so I can remove it.

Thanks in advance.

#488318

It's because that message says, there are no fields displayed.
It doesn't say, that the template isn't used.

1. Have you added anything else apart from the "EDITED LIVE" string? If yes, please let me know so I can remove it.

No, this is my only edit (once in the Single and once in the Archive file)

2. I assume on the old/other site, you have Types Custom Fields added, and coded into the template?

#488319

Thank you, I know, it was just confusing to see the warning message.

I have removed the "EDITED LIVE" string.

This issue has been fixed but I have noticed something else as well.

When I create a new post, I see many new fields e.g. if you click "Posts > Add new" and you scroll down a bit below the SEO tab, you will notice many new fields e.g. banner image, box 1/3 and so on.
Why do those show up at posts?

Please have a look.

Thanks in advance.

#488320

Dear Beda,

Please ignore my last message, I have sorted this out as well.

Thank you once again for your help and prompt responses.

Have a great Sunday.

Regards,
Stavros

The forum ‘Types Community Support’ is closed to new topics and replies.