Skip Navigation

[Resolved] Introducing text into the page through custom fields or similar

This support ticket is created 6 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 1 reply, has 2 voices.

Last updated by Luo Yang 6 years, 3 months ago.

Assisted by: Luo Yang.

Author
Posts
#1089543

Tell us what you are trying to do?
I want to introduce code into the <head></head> tags of the pages, for example a metatag, personalized schema tags or similar, and I would like to do it via custom fields that I can set in each CPType or CPTaxonomy. Is that possible with toolset plugins?

Is there any documentation that you are following?

Is there a similar example that we can see?

What is the link to your site?

#1090040

Hello,

There isn't such kind of built-in feature within Toolset plugins, but it is possible with some custom codes, for example:
1) Use wordpress built-in action hook "wp_head" to trigger a custom PHP function
https://codex.wordpress.org/Plugin_API/Action_Reference/wp_head

2) in this PHP function, check if it is a single post of specific custom post type
https://developer.wordpress.org/reference/functions/is_singular/

Then output the custom fields value and taxonomy value as meta tag
https://developer.wordpress.org/reference/functions/get_post_meta/
https://developer.wordpress.org/reference/hooks/get_object_terms/

For your reference.