Open pixolin opened 8 years ago
Thats graet! That is my second Problem. At first i want to save the one image in my CPT. But it's right, i want more images in the gallery. The Reapeater is a good solution. I will try it. The featured Image is for the Gallery-Picture, that you can see, when you visit the gallery pages with all gallerys. You think theres is a better solution?
The featured Image is for the Gallery-Picture, that you can see, when you visit the gallery pages with all gallerys.
Do we talk about the same thing? Galleries usually show a bunch of images in a grid, often combined with a link to see single images in a larger format (e.g. in a lightbox). Where would that single preview image come in?
Featured image would work, if you create portfolios and want one thumbnail image for each portfolio on an overview page. I wouldn't name the Custom Post Type gallery
then, as this is rather confusing.
it's the same. i only want one page for the overview for all gallerys where the user can choose, what gallery he/she want to see. and for that is the featured image. in my case, a friend write for every gallery the title with the hand. is for a artist website. is it clear what i mean?
That's what usually is referred to as a portfolio. Gallery is the part which shows all images on a single page then.
Metaboxes with repeater fields aren't quite that easy. You might have a better start with CMB2.
you are right. a lot of thanks. i will try CMB2. Its maybe the same like Custom Post Type UI.
I guess you refer to the plugin Custom Post Type UI? That plugin is based on CMB2, but CMB2 is a library which you can use in your own plugin to easily add custom post types and all sorts of meta boxes for custom fields. It may especially be handy if you want to use repeating fields in a metabox, as discussed above.
I assume, your galleries should display more than just one image. Why would you use a featured image for your post type
galerien
then? Also adding a simple meta box won't help, as you again could only add a single image. What you need instead is a repeater – each time a field is filled with a new image, a new field must be opened to add more images. Helen has published a Gist with such repeater at https://gist.github.com/helen/1593065.