I am trying to: edit the code in visual editor placed in layouts. After saving I see that code is getting changed. This is in continuation with https://toolset.com/forums/topic/how-to-convert-custom-field-image-to-header-image-for-that-custom-post/
A temporary fix was suggested by writing the code in content template and calling that into layout. But now I see that the code in content template also gets changed.
For example,
<div style="background-image:url('[types field="image-background" output="raw"][/types]')">
...
</div>
when pasted and saved , the code looks like this
<div style="background-image:url('[types field=" image-background"="" output="raw" ][="" types]')"="">
...
</div>
="" gets added at places and the functionality of code is not achieved. May I know why this is happening? What can I do to fix this?
Thanks in Advance
Dear indianplayschools,
I can duplicate same problem, and escalate it to our 2nd supporters. Currently, please try as I mentioned in your thread:
https://toolset.com/forums/topic/how-to-convert-custom-field-image-to-header-image-for-that-custom-post/#post-472486
Edit the content template directly:
lien caché
And setup HTML codes in above URL.
Hello Luo Yang,
Thanks for the update. The previous solution no longer works. The code changes even when I upload through content template. I will wait for the solution. Thanks a lot
I just tested in your website:
lien caché
And it works fine, but I guess you will need to update this content template again, everytime after you have edit/update your layout.
lien caché
And it is a temp workaround, so you can also wait for the fix from our developers.
Sorry, but this is the output
lien caché
Please check.
I understand that previously it worked.
I can not find the custom image field "image-background" in your website, so I replace it with another image field "image", edited the content template:
lien caché
To:
<div style="background-image:url('[types field='image' output='raw'][/types]'); height:400px;">
...
</div>
Test the problem page again, seems it works fine now:
lien caché
Yes. Now it is working. Thank You.
Now I see that my code is not being changed even if I paste this code in visual editor. So, I am able to achieve the results even without content template. Have you changed anything? Any guesses what might have gone wrong before?
It is strange, I did not change anything. I can duplicate same problem in my localhost, and this ticket has already been put into our to-do list, our developers are working on it.
I am closing the thread as I no longer face the problem.
Thank you very much
Here is the feedback from our 2nd supporters:
Correct is:
<div style="background-image:url('[types field='image-background' output='raw'][/types]')">
...
</div>
And with that it works. This is autogenerated