if ($p_tpl == "template-sortable.php") { $pageInfo = false; $categories = get_post_meta($post->ID, 'max_sortable_galleries', true); $per_page = 9999; } // query the posts if we are not in a tax page template if (!is_tax()) { global $max_random_posts_query; $orderby = get_post_meta($post->ID, 'max_gallery_order', true); $order = get_post_meta($post->ID, 'max_gallery_sort', true); $seed = date('Ymdhi'); // Use date('Ymdhi') to get a change minutely $max_random_posts_query = " ORDER BY rand({$seed}) "; // Turn on filter // get the portfolio posts $portfolio_args = array('post_type' => POST_TYPE_GALLERY, 'orderby' => $orderby, 'order' => $order, 'showposts' => $per_page, 'paged' => $paged, 'tax_query' => array(array('taxonomy' => GALLERY_TAXONOMY, 'terms' => max_set_term_order($categories), 'field' => 'term_id'))); // query posts with arguments from above ($portfolio_args) $portfolio_posts = new WP_Query($portfolio_args); } else { // it's a taxonomy, query the posts $tax = $wp_query->get_queried_object(); $args = array('post_type' => POST_TYPE_GALLERY, 'paged' => $paged, 'showposts' => $per_page, 'orderby' => $orderby, 'order' => $order, 'tax_query' => array(array('taxonomy' => GALLERY_TAXONOMY, 'terms' => $tax->term_id, 'field' => 'term_id'))); $portfolio_posts = new WP_Query($args); } if (!post_password_required()) { ?> <?php if ($portfolio_posts->have_posts()) { ?>
* @since Photonova 1.0 */ global $body_class_array, $meta; wp_enqueue_script('galleria'); wp_enqueue_style('galleria-css', get_template_directory_uri() . '/js/galleria/galleria.classic.css', false, false); /*-----------------------------------------------------------------------------------*/ /* Main Settings and variables /*-----------------------------------------------------------------------------------*/ $meta = max_get_cutom_meta_array(); $meta[MAX_SHORTNAME . "_page_gallery_fullwidth"] = false; get_header(); $categories = get_post_meta($post->ID, 'max_select_gallery', true); $orderby = get_post_meta($post->ID, 'max_gallery_order', true); $order = get_post_meta($post->ID, 'max_gallery_sort', true); // get the portfolio posts $portfolio_args = array('post_type' => 'gallery', 'orderby' => $orderby, 'order' => $order, 'showposts' => 9999, 'tax_query' => array(array('taxonomy' => GALLERY_TAXONOMY, 'terms' => max_set_term_order($categories), 'field' => 'term_id'))); // get the password protected login template part if (post_password_required()) { get_template_part('includes/page', 'password.inc'); } else { ?> <div id="single-page" class="clearfix left-sidebar"> <div id="primary" class="hfeed"> <div id="content" role="main"> <div <?php if (!is_front_page() && !is_Home()) { the_post();
?> </div><!-- .entry-content --> </div> <?php // Check if other images of a gallery should be shown if (get_option_max('image_show_gallery_images') == "true") { // fetch the gallery terms attached to this photo posts $obj_galleryTerms = wp_get_post_terms($post->ID, GALLERY_TAXONOMY); foreach ($obj_galleryTerms as $index => $value) { $galleryTerms[$value->term_id] = $value->term_id; } // get the gallery posts $gallery_args = array('post_type' => 'gallery', 'orderby' => 'rand', 'order' => 'DESC', 'showposts' => get_option_max('image_count_gallery_images'), 'tax_query' => array(array('taxonomy' => GALLERY_TAXONOMY, 'terms' => max_set_term_order($galleryTerms), 'field' => 'term_id'))); // query posts with arguments from above ($gallery_args) $gallery_posts = new WP_Query($gallery_args); $imgDimensions = array('width' => 400, 'height' => 300); ?> <?php if ($gallery_posts->have_posts()) { // show posts if query found some ?> <div id="relatedGalleryImages" class="entry-related-images portfolio-four-columns"> <h3 class="related-title"><?php _e('More from this Gallery', MAX_SHORTNAME); ?> </h3>
<?php /** * @package WordPress * @subpackage Invictus */ global $fullsize_gallery_posts; $main_homepage = true; // get featured galleries $cat_string = is_array(get_option_max('fullsize_featured_cat')) ? implode(',', get_option_max('fullsize_featured_cat')) : get_option_max('fullsize_featured_cat'); // get post order $order_string = get_option_max('fullsize_featured_order'); $sorting_string = get_option_max('fullsize_featured_sorting'); // get the portfolio posts $portfolio_args = array('post_type' => POST_TYPE_GALLERY, 'orderby' => $order_string, 'order' => $sorting_string, 'showposts' => get_option_max('fullsize_featured_count'), 'tax_query' => array(array('taxonomy' => GALLERY_TAXONOMY, 'terms' => max_set_term_order(get_option_max('fullsize_featured_cat')), 'field' => 'term_id'))); // query posts with arguments from above ($portfolio_args) $fullsize_gallery_posts = new WP_Query($portfolio_args); $cntPosts = $fullsize_gallery_posts->post_count; // sort the posts in correct numeric order if (!empty($order_string) && $order_string === 'title') { usort($fullsize_gallery_posts->posts, 'max_numeric_post_sort'); if ($sort_string == 'DESC') { $fullsize_gallery_posts->posts = array_reverse($fullsize_gallery_posts->posts); } } // check if a slide show is available => more than 1 image for the gallery $show_slideshow = false; if (get_option_max('fullsize_featured_count') > 1) { $show_slideshow = true; } // check if there are video posts in the query
<?php } ?> </header> <?php } ?> </div> </div> </div> <?php // get the portfolio posts $portfolio_args = array('post_type' => POST_TYPE_GALLERY, 'orderby' => $order_string, 'order' => $sort_string, 'showposts' => get_post_meta($post->ID, MAX_SHORTNAME . '_page_fullsize_count', true), 'tax_query' => array(array('taxonomy' => GALLERY_TAXONOMY, 'terms' => max_set_term_order(get_post_meta($post->ID, 'max_select_gallery', true)), 'field' => 'term_id'))); // query posts with arguments from above ($portfolio_args) $fullsize_gallery_posts = new WP_Query($portfolio_args); $cntPosts = $fullsize_gallery_posts->post_count; // sort the posts in correct numeric order if (!empty($order_string) && $order_string === 'title') { usort($fullsize_gallery_posts->posts, 'max_numeric_post_sort'); if ($sort_string == 'DESC') { $fullsize_gallery_posts->posts = array_reverse($fullsize_gallery_posts->posts); } } // check if there are video posts in the query $_query_has_videos = false; if ($fullsize_gallery_posts->have_posts()) { while ($fullsize_gallery_posts->have_posts()) { $fullsize_gallery_posts->the_post();