Tell us what you are trying to do? => trying to display a file field (URL of the file) in the <head> section
Is there any documentation that you are following? => https://toolset.com/documentation/customizing-sites-using-php/functions/#file
---
CPT card. Created - header-card.php. I'm doing "<?php echo types_render_field("manifest", array('output'=>'raw')); ?>" in the head section (before <?php wp_head(); ?>), but getting the file URL in the body.
Also tried using the wp_head hook - "add_action('wp_head', 'add_manifest_url,99999);" - still outputs in the body.
I need the raw URL in the head section.
Thanks
Hello,
The problem you mentioned above is abnormal, the function types_render_field() won't output result in other place(body) unless you put it there.
I suggest you check these:
1) Check the HTML source codes, find the output's location. For example, with Chrome browser:
hidden link
2) Make sure you are using custom HTML custom codes by following below document:
hidden link
3) In case it is a compatibility problem, please deactivate all other plugins, and switch to wordpress default theme 2019, deactivate all custom PHP/JS code snippets, and test again
I'm sorry - I don't understand
The problem you mentioned above is abnormal, the function types_render_field() won't output result in other place (body) unless you put it there.
You mean "in other place OTHER THEN THE body??
1) Check the HTML source codes, find the output's location
I know how to view source, it is outputted right after the opening <body> tag
2) Make sure you are using custom HTML custom codes by following below document:
How does that go to do with is? The meta I need is <link rel="manifest" href="LINK TO CPT WEB MANIFEST"> (hidden link)
In case it is a compatibility problem
No other plugins active
Please copy/paste the problem URL here, I can test it in my Chrome browser, thanks
It's on a local machine.
This is the code. Output - screen shoot
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="profile" href="<em><u>hidden link</u></em>">
<em><link rel="manifest" href="<?php echo types_render_field("manifest", array('output'=>'raw')); ?>">
<?php wp_head(); ?></em>
</head>
I have tried the same settings in my localhost with a fresh wordpress installation + the latest version of Toolset plugins + 2019 theme, it works fine. see screenshot: manifest.JPG
Since it is a custom PHP codes problem, if you need more assistance for it, please provide a test site with the same problem, fill below private message box with login details and ftp access, also point out the problem page URL, and where I can edit your PHP codes, I need to test and debug it in a live website, thanks