Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gallery Option #383

Open
mathieupreaud opened this issue Jan 4, 2017 · 5 comments
Open

Gallery Option #383

mathieupreaud opened this issue Jan 4, 2017 · 5 comments

Comments

@mathieupreaud
Copy link

Hi,

I just tried for the first time the Gallery option and I'm facing to a problem. When I upload the second image, it always deletes the first one and takes its position.

Anyone found out how to resolve this issue?

I'm using the last version of TF (1.11) and WP (4.7).

Thank you!

@mathieupreaud
Copy link
Author

Anyone can confirm this issue?

@msoal-design
Copy link

Its happening with me too.
Wordpress 4.7.5 and Titan 1.11

@amin3d
Copy link
Contributor

amin3d commented Feb 25, 2018

In the name of Allah, I fix the problem::
put this code in class-option-gallery.php which is in lib folder.
the best place for putting your code is line 148::

` frame.on('open',function() {

                var selection = frame.state().get('selection');
                if(_input.val()!="")
                {
                    var ids = _input.val().split(',');
                    ids.forEach(function(id) {
                        var attachment = wp.media.attachment(id);
                        attachment.fetch();
                        selection.add( attachment ? [ attachment ] : [] );
                    });
                }

            });`

@emadelawady
Copy link

it works now, just try is carefully to understand how it works , dont add new code

== when you set-up your type to "gallery" , just go in meta-box in admin panel and test it by add multi images

notes to make it works

  • i think max, images to add " 3 ",
  • the way i found is by click add and CTLR button on keyboard and select 3 images and then click add

you should now see the three images is there,
i'm working now on how to display images in the front

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
@amin3d @mathieupreaud @emadelawady @msoal-design and others