function foogallery_album_remove_gallery_from_link() { $gallery = foogallery_album_get_current_gallery(); $slug = foogallery_album_gallery_url_slug(); $url = untrailingslashit(remove_query_arg($slug)); return str_replace($slug . '/' . $gallery, '', $url); }
<?php /** * FooGallery default responsive album template */ global $current_foogallery_album; global $current_foogallery_album_arguments; $gallery = foogallery_album_get_current_gallery(); $no_images_text = foogallery_album_template_setting('no_images_text', false); $single_image_text = foogallery_album_template_setting('single_image_text', false); $images_text = foogallery_album_template_setting('images_text', false); $alignment = foogallery_album_template_setting('alignment', 'alignment-left'); $foogallery = false; if (!empty($gallery)) { $foogallery = FooGallery::get_by_slug($gallery); //check to see if the gallery belongs to the album if (!$current_foogallery_album->includes_gallery($foogallery->ID)) { $foogallery = false; } } if (false !== $foogallery) { $album_url = foogallery_album_remove_gallery_from_link(); echo '<div id="' . $current_foogallery_album->slug . '" class="foogallery-album-header">'; echo '<p><a href="' . $album_url . '">' . foogallery_album_template_setting('back_to_album_text', '« back to album') . '</a></p>'; echo '<h2>' . $foogallery->name . '</h2>'; echo '</div>'; echo do_shortcode('[foogallery id="' . $foogallery->ID . '"]'); } else { $title_bg = foogallery_album_template_setting('title_bg', '#ffffff'); $title_font_color = foogallery_album_template_setting('title_font_color', '#000000'); $args = foogallery_album_template_setting('thumbnail_dimensions', array());