Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $eventpostid = $post->ID;
- $eventslug = wp_get_post_terms( $eventpostid, 'album-categories' );
- $eventvenueslug = $eventslug[0]->slug;
- $eventvenuetitle = $eventslug[0]->name;
- $querydetails = "
- SELECT posts.* FROM wp_posts posts
- left join wp_term_relationships rel on posts.id = rel.object_id
- left join wp_term_taxonomy tax on rel. term_taxonomy_id = tax.term_taxonomy_id
- left join wp_terms terms on tax.term_id = terms.term_id
- WHERE
- (posts.post_type = 'gallery') AND
- (post_status = 'Publish') AND
- (tax.taxonomy = 'album-categories') AND
- (terms.slug = '".$eventvenueslug."')
- ";
- $pageposts = $wpdb->get_results($querydetails, OBJECT);
- echo '<div style="height:0;width:0;overflow:hidden;visibility:hidden">';
- echo '</div><ul id="cpAlbumCategory_thumbnails">';
- if ($pageposts) {
- foreach ($pageposts as $post):
- setup_postdata($post); ?>
- <li>
- <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><img src=<?php echo get_template_directory_uri() ?>/timthumb.php?src=<?php echo max_get_image_path($post->ID, 'full') ?>&h=58&w=57&q=80&zc=1 /></a>
- </li>
- <?php endforeach;
- echo '</ul><br class="clearfix" />';
- } else {
- echo '<p style="padding:5px">No Photos have been added to this album yet.</p>';
- }
- wp_reset_query();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement