Showing the contents of an Ultimate Member Gallery tab somewhere else

This is 3rd-party plugin territory, so this may lead me nowhere -- though what I'm asking is something that could apply to many Wordpress stuff (including BuddyPress). So I'm hoping to get lucky and find someone who's implemented a similar solution for my problem!

So... I'm using the Ultimate Member profiles plugin for my site. I find it better than BuddyPress profiles and a lot more attractive out of the box.

I'm also using the Ultimate Member Gallery extension (which isn't even done by the UM guys -- so it's 3rd party of 3rd party...yikes). This extension generates an "Images" tab on user profiles, and when you click on that tab you can see all the photos a member has uploaded.

What I really need to do is have that gallery of images ON THE MAIN PROFILE itself (and not hidden away in a tab). Ultimate Member allows you to customize the way profiles look, and you can arrange fields in any order, or in columns, etc. There's a "Content Block" field option (with a WYSIWYG editor), as well as a "Shortcode" field, which allows further customized content to be placed on a profile. What I want is to be able to display the contents of the "Images" tab in one of these places somehow -- but I don't know how to do it yet.

I've written in the Support page of the UM Gallery, but it's been over 3 weeks and no reply. The regular UM guys couldn't help either. This feels like something that's probably easy to do, but I haven't quite figured it out yet and time's running out.

Any help or suggestions would be greatly appreciated....

  • Adam Czajczyk

    Hello Anton,

    I hope you're well today and thank you for your question!

    I admit this is a bit complex. I'm not familiar with Ultimate Member and Ultimate Member Gallery plugin so I installed them on my test setup and took a quick look at settings. It seems there's nothing that could be achieved this way in relation to what you wish to achieve.

    There's a way however, I think. I've noticed that you can select a template to be used for showing user profile and there's a default template delivered with the plugin. You may find it on your server:
    - access your WP install with FTP
    - go to "/wp-content/plugins/ultimate-member/templates/" directory.

    I didn't find any documentation on this but I think you may want to analyze the files inside and this should be a good starting point.

    I hope this helps at least a bit.

    Best regards,
    Adam

  • Anton

    Hi @Adam Czajczyk -

    Thanks for your reply!

    Hmmmm.....I'm looking at the default template, and I can't really see how the answer could be there. (I'm not really a coder, so could be wrong).
    As I mentioned, Ultimate Member already allows you to customize the layout (fields) of a profile page however you like -- so I'm not entirely sure there's a need to tinker with the actual template file itself.

    I did, however, look in the Ultimate Member Gallery plugin, and saw that in the ultimate-member-gallery/templates/profile folder, there's "gallery.php" file (as well as "video.php" for videos, but I'm not concerned with that).

    So I'm assuming "gallery.php" must be what displays the gallery within the "Images" tab? If that's the case, I need to figure out how to get a call to gallery.php within a "Content Block" field of the main user profile form.

    That's where I'm stuck, and don't know how to continue.
    Any suggestions from anyone in the know would be greatly appreciated!!!!

  • Anton

    @Adam Czajczyk -

    I'm on a deadline, so just seeing if you (or anyone else) might be able to step in and help here.

    As mentioned, I'm assuming that "gallery.php" is what displays the photo gallery. Is it just a matter of calling it somewhere? I think I read somewhere how you can create a shortcode out of a php file. If I made a shortcode out of "gallery.php" and added it to a shortcode module of the profile content form, would that work? Or am I thinking too simplistically, and the solution is actually more complex?

    If anyone has ideas or suggestions, I'd greatly appreciate it!!!!

  • Predrag Dubajic

    Hi Anton,

    Maybe you can try adding a function in your themes functions.php or creating new mu-plugin with the code below:

    function custom_shortcode() {
    	include_once(plugins_url().'/ultimate-member-gallery/templates/profile/gallery.php');
    }
    add_shortcode( 'include_gallery', 'custom_shortcode' );

    And then use [include_gallery] shortcode to call gallery.php anywhere you want, but I'm not sure if this is enough to make the gallery work anywhere on site.

    Best regards,
    Predrag

  • Anton

    @Predrag Dubajic -

    Thanks for this reply and suggestion!
    It was a good idea...
    ...unfortunately it didn't work.

    I added it to functions.php and included the shortcode to the profile page, but nothing displayed differently. (I also tried it as a mu-plugin, but that whitescreened my site, so I deleted it).

    Thinking about it more, I guess it makes sense it doesn't work -- there needs to be some way to tie it to the ID of the user whose profile you're viewing, right? It looks like this may be more complex than I initially thought...

  • Predrag Dubajic

    Hi Anton,

    I was doing some further testing on my end and unfortunately I was unable to find a working solution for this.

    Since this does look more complicated you might want to post a job in our job board where you can hire a developer to assist further:
    https://premium.wpmudev.org/wpmu-jobs/
    Please note that, no WPMU official staff members are allowed to work in the job board.

    Best regards,
    Predrag

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.