Accueil › Toolset Professional Support › [Résolu] I'm trying to set up a alt and title tag on my image field
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.
Marqué : Setting up custom types
Documentation connexe :
This topic contains 5 réponses, has 2 voix.
Last updated by lauraS-3 Il y a 4 années et 10 mois.
Assigned support staff: Luo Yang.
I want alt and title to picked up from the media library not manually entered in PHP files.
<?php echo types_render_field('image' , array('alt'=> ' ' , 'title' => ' ' , 'class' => 'attachment-large center-block img-responsive wp-post-image')); ?>
Anglais (English )
Chinois simplifié (简体中文 )
Please try this:
<?php echo types_render_field('image' , array('alt'=> ' %%ALT%%' , 'title' => '%%TITLE%% ' , 'class' => 'attachment-large center-block img-responsive wp-post-image')); ?
For the alt and title attributes, you can also use placeholders to output the values of standard image fields added in WordPress: %%TITLE%%, %%ALT%%, %%CAPTION %%, and %%DESCRIPTION%%.
Hi That didn't make any difference ....
I tested it in my localhost, it works fine, please check these in your website:
1) in above codes, replace the field slug "image" with the your custom field slug
2) deactivate other plugins and switch to wordpress default theme, and test again
actually It worked.
Thanks for help.
Known issues and solutions
Frequently asked support questions
Support tickets archive
Get help from experienced contractors
Meet Toolset support team
Toolset Customer Support Policy
Need to tell us something about the quality of support
How to remove personal information from your database for support