Support » Plugin: Gallery by BestWebSoft » Albums and Sub Albums

  • Resolved itissue


    Is there a way to have sub albums be listed in a parent album and only display parent albums on the gallery page until the user selects the parent album they want to view? Then the sub albums will display within that parent album?

    For instance:

    Parent album 1 | Parent album 2 | Parent album 3

    Parent album 1 has the following:
    Sub album 1 | Sub album 2 | Sub album 3 | Sub album 4

    Parent album 2 has different sub albums, and Parent album 3 has different sub albums. Each sub album has images.


Viewing 15 replies - 1 through 15 (of 17 total)
  • I am interested in this, too.

    I know there’s a way to create pages manually and put each album on the page every time a new album is created. In that way, don’t pick the gallery template for the page. But is there an automatic way, since you are already given the option of making sub albums in choosing if the album has a parent and what that parent is.

    itissue, if you’re going to make up a separate page for each gallery (parents and children), you might as well just use the in-built WP gallery instead. Part of the point of using a plugin is to automate gallery generation. 😉

    While the Gallery plugin does support parent/child relationships, it does not separate them on the main gallery page. When I added a child gallery it just added it to the main gallery page along with the parent, instead of showing the child only on the parent’s page. The child doesn’t show on the parent’s page at all, but this what it logically should do.

    Thanks kchayka.

    Well, this is what I ended up doing. I created a page called Projects and put the shortcode for each parent album there. Then for the gallery, I had parent and children albums. The parent albums have each of the children albums shortcode listed in them. I made some modifications to the template and styles to suit my needs.

    Projects page:

    Parent album example:

    Child album example:

    I forgot to explain this:

    The projects page lists the types of projects. Then when you click on a project type, it lists the different projects in that project type. Then you click on a project to view individual images and a short desription about that project. Clicking on those images then triggers fancybox.

    I can see how this functions, but it’s a lot of extra work if you have many galleries.

    Is there a better solution? That’s what I was trying to look for, but I couldn’t find it, so that’s why I am stuck with this solution.

    I may think about this more. There has to be a better way. Meanwhile, if someone else has a better idea, please feel free to chime in. Thanks!

    IMO it’s something the plugin should already be doing. It’s not on the list of features for the Pro version, either. It would be nice for the plugin author to respond to this…

    I thought of an idea, but haven’t gotten it to work, though it should work in theory. I created a query string called cat and when it’s “residential”, then the gallery template will filter “residential” based on the “residential id”. I tried making the filter in $args = array(); as

    'post_parent' => $parent_id

    and the $parent_id is something like this:

    global $parent_id;
    					if(isset($_GET['cat'])) { $url = $_GET['cat']; }
    					if($url="residential") { $parent_id = 145; }
    					if($url="commercial") { $parent_id = 30; }

    But it isn’t working.

    I also hope the plugin author may respond. It would be nice to know how to do this.

    Oh!!!! I got it! I didn’t write my if statements correctly.

    global $parent_id;
    global $url;
    if(isset($_GET['cat'])) {
    	$url = $_GET['cat'];
    	if($url=="residential") { $parent_id = 30; }
    	elseif($url=="commercial") { $parent_id = 145; }
    	else $parent_id = "";
    $args = array(
    						'post_type'					=> 'gallery',
    						'post_status'				=> 'publish',
    						'orderby'						=> 'post_date',
    						'posts_per_page'		=> -1,
    						'post_parent'	=> $parent_id
    Plugin Author bestwebsoft


    Hi itissue,

    Unfortunately this functionality is not provided.

    Support Team

    itissue, I would try to make it more dynamic so you don’t have to hard-code names and IDs.

    The response from the plugin author is disappointing. How about adding it to the next release? Or at least say you’ll consider doing that?

    Thanks kchayka for being there so I’m not the only one on this thread. I couldn’t figure out how to not hardcode the query string values without using SQL queries to get the table with the parent titles and ids to match with the children ones, which may also not be a good thing to do. Maybe that’s better than hardcoding. I’ll try working on this and then document it better so it might help someone in the future in case they are looking for the same functionality. I’ll keep you posted.

    Thanks bestwebsoft for responding. Maybe you can work something out for the future? I do hope it may be in the future. Thanks for developing this plugin for us all to use. It’s nice in that it’s pretty simple and easy to set up.

    Well I got the SQL statement to use:

    SELECT post_title, id
    FROM  wp_posts
    WHERE (
    post_parent =0
    AND  post_type =  "gallery"
    AND  post_status =  "publish"

    Yay!! Getting there. (Where wp is is the prefix you use for your tables)

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Albums and Sub Albums’ is closed to new replies.