[Resolved] Some custom field images are not displayed although they exist
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, 4 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.
Could you please describe how you have added the image fields to your site?
Is this a content template for a custom post type where the posts have the images added as custom fields. Or a layout for such single posts? Or something else?
Can you show how/where you have inserted the shortcodes to output the images?
i have create toolset types fields and one field is image field for book images than i have create content template and create a design with visual composer.
i don't know what is wrong but i have another problems too. If i have this shortcode
add_action('init', 'add_mapped_shortcodes_on_init');
function add_mapped_shortcodes_on_init()
{
WPBMap::addAllMappedShortcodes();
}
in my functions.php and if I disable visual composer than the sites breaks with 500 error
If i want create a visual composer grid and add some elements that don't work too and in my console i become these message:
editor.min.js?ver=4.8:1 Uncaught TypeError: Cannot read property 'get' of undefined
at Object.e [as go] (editor.min.js?ver=4.8:1)
at vc.Storage.setContent (backend.min.js?ver=5.1.1:6)
at vc.Storage.save (backend.min.js?ver=5.1.1:6)
at vc.Storage.update (backend.min.js?ver=5.1.1:6)
at n.sync (backend.min.js?ver=5.1.1:6)
at n.save (load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-widget,jquery…:98)
at n.create (load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-widget,jquery…:98)
at n.vc.AddElementUIPanelBackendEditor.createElement (grid-builder.min.js?ver=5.1.1:1)
at HTMLDivElement.dispatch (load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-widget,jquery…:3)
at HTMLDivElement.r.handle (load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-widget,jquery…:3)
if i disable types than it works. Can you help me too solve it too?
I can give you access to my site can I sent you the acceess Data private?
I tried to reproduce the problem locally on a test site but I was unable to.
I created a Content Template for Books and designed the template using Visual Composer, using a text module to insert the shortcode for a Types image field, and the image was correctly rendered.
Can you try a small test.
Find the post ID of one of your book posts which you know has an image added in the image field.
Create a test page and without using the Visual Composer editor insert the types shortcode for the image field, adding the id attribute to specify the book post the image should be taken from (e.g. [types field='cover' alt='%%ALT%%' title='%%TITLE%%' size='medium' align='none' resize='proportional' id='99'][/types], using the same values as from your template and with the id edited accordingly.)
Does that display the image correctly when you view that page?
It sounds like the image fields for your books are not added to the book posts correctly, but, yes, let me look for myself.
I will mark your next reply as private so that I can get log-in credentials from you—you may want to create a temporary admin user for me to use that you can later delete. And be sure to have a current backup of your site.
Regarding the code snippet you added to your functions.php file, why did you add it? (I recognise the code from Visual Composer and I know what it does, but I want to check why you are adding it to your site.)
I looked at your site and viewed some books at random on the front of the site and all of the ones I tried looked fine (e.g. see screenshot).
Do you have any specific books where the images are not working?
(Note, I temporarily changed the language of your user profile to English so I can move around the admin pages easily. I have left it in English for now in case I need to go back into the site.)
So the problem is not with the individual book posts, it is with the grid view of books on this page.
I assumed you had added a View to create this list of books, but I see that you are using the Visual Composer Post Masonry Grid module to show the list of books.
We don't have any control over how that grid looks. I assumed that the module uses the featured images of the posts in that grid display.
I compared a post that works (id = 1054) with one that does not (id = 2215) but I saw that you do not have featured images enabled for your book post type (in Toolset > Post Types in the "Sections to display..." block).
I enabled this setting to be able to see whether the book posts had featured images or not, and found that the post that works does, the post that does not work does not.
So if you are going to use the VC Post Masonry Grid module to show your list of books you will need to make sure those book posts have a featured image.
thank you very much for your great help. I don't know why some images have featured images too. I have a idea i create a grid with toolset and style it, I think it's better 🙂
best regards
André
The forum ‘Types Community Support’ is closed to new topics and replies.