Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- global $imgDimensions, $substrExcerpt, $itemCaption, $shortname, $paged;
- $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
- $pageInfo = get_post_meta($post->ID, 'max_show_gallery_info', true);
- // get the gallery name
- $taxonomy_name = get_post_meta($post->ID, 'max_select_gallery', true);
- // Test leading numeric title sort
- query_posts("posts_per_page=".PER_PAGE_DEFAULT."&post_type=gallery&".GALLERY_TAXONOMY."=".$taxonomy_name."&paged=".$paged."&caller_get_posts=1&orderby=title&order=asc");
- if (have_posts()) {
- usort($wp_query->posts, 'my_post_sort');
- while (have_posts()) {
- the_post();
- echo "<br />";the_title();
- }
- }
- function my_post_sort($a,$b) {
- $akey = $a->post_title;
- if (preg_match('/^(\d+) /',$akey,$matches)) {
- $akey = sprintf('%010d ',$matches[0]) . $akey;
- }
- $bkey = $b->post_title;
- if (preg_match('/^(\d+) /',$bkey,$matches)) {
- $bkey = sprintf('%010d ',$matches[0]) . $bkey;
- }
- if ($akey == $bkey) {
- return 0;
- }
- return ($akey < $bkey) ? -1 : 1;
- }
- ?>
- <?php if (have_posts()) : ?>
- <ul id="portfolioList" class="clearfix portfolio-list">
- <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
- <li class="item <?php echo max_get_post_lightbox_class() ?>">
- <span class="shadow">
- <?php
- // get the gallery item
- max_get_post_custom_image();
- if($itemCaption === true) {
- // check if caption option is selected
- if ( get_option_max( 'image_show_caption' ) == 'true' ) {
- ?>
- <div class="item-caption">
- <strong><?php echo get_the_title() ?></strong><br />
- <?php
- // check if there is a excerpt
- if( max_get_the_excerpt() ){
- max_get_the_excerpt(true);
- }
- ?>
- </div>
- <?php
- }
- }
- ?>
- </span>
- <?php
- // check if additional options is selected
- if ( $pageInfo == 'true' ) {
- ?>
- <div class="item-information">
- <ul>
- <?php if( get_post_meta($post->ID, $shortname.'_photo_copyright_link_value', true) != "" ){ ?>
- <li><?php _e('Copyright','pictree') ?>: <a href="<?php echo get_post_meta($post->ID, $shortname.'_photo_copyright_link_value', true) ?>" title="<?php echo get_post_meta($post->ID, $shortname.'_photo_copyright_information_value', true) ?>" target="_blank"><?php echo get_post_meta($post->ID, $shortname.'_photo_copyright_information_value', true) ?></a></li>
- <?php } else { ?>
- <li>Copyright<?php _e('Copyright','pictree') ?>: <?php echo get_post_meta($post->ID, $shortname.'_photo_copyright_information_value', true) ?></li>
- <?php } ?>
- <li><?php _e('Location','pictree') ?>: <span><?php echo get_post_meta($post->ID, $shortname.'_photo_location_value', true) ?></span></li>
- <li><?php _e('Date','pictree') ?>: <span><?php echo get_post_meta($post->ID, $shortname.'_photo_date_value', true) ?></span></li>
- </ul>
- </div>
- <?php
- }
- ?>
- </li>
- <?php endwhile; ?>
- <?php else : ?>
- <h2><?php _e('No Entries found','pictree') ?></h2>
- <?php endif; ?>
- </ul>
- <?php
- /* Display navigation to next/previous pages when applicable */
- if (function_exists("max_pagination")) {
- max_pagination();
- }
- ?>
- <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement