Skip to content

Instantly share code, notes, and snippets.

@iammahmudur
Last active December 19, 2015 02:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iammahmudur/8f38979f143cdc668ff9 to your computer and use it in GitHub Desktop.
Save iammahmudur/8f38979f143cdc668ff9 to your computer and use it in GitHub Desktop.
<?php
$queried_artist = get_queried_object();
// Find connected posts
$connected = new WP_Query( array(
'connected_type' => 'artists_to_posts',
'connected_items' => get_queried_object(),
'paged' => (get_query_var('page')) ? get_query_var('page') : 1,
) );
/* Start the Loop */
if ($connected->have_posts()) :
?>
<?php my_pagination( $connected->max_num_pages ); ?>
<div class='post_wrap'>
<?php
while ($connected->have_posts()) : $connected->the_post();
?>
<article <?php post_class('posts_listing post') ?> id="post-<?php the_ID(); ?>" >
<?php if (has_post_thumbnail()){?><figure class="post_img"><a href="<?php the_permalink() ?>" title="<?php echo the_title(); ?>" class="imgborder clearfix thumb listing"><?php get_theme_blog_thumbnail(get_the_ID(), $post_thumb); ?></a></figure><?php } ?>
<div class="post_format" <?php if(!has_post_thumbnail()) { echo 'style="margin-top:0px"'; } ?>><a href="<?php the_permalink() ?>" <?php if ($post_color){ echo 'style="background-color:'.$post_color.'"';}?>></a></div>
<div class="post_area_title">
<h2 class="entry-title"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php _e('Permanent Link to', 'mahmudur'); ?> <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
<div class="postcategories">By <?php //_e('Categories:', 'mahmudur'); ?><?php //the_author(' / '); ?><?php echo $queried_artist->post_title; ?></div>
</div>
<div class="entry-content">
<?php if (get_option(SHORTNAME . "_excerpt")) { the_content(__('Read more','mahmudur')); } else { the_excerpt(); ?>
<div class="aligncenter"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php _e('Permanent Link to', 'mahmudur'); ?> <?php the_title_attribute(); ?>" class="qd_button_small"><?php _e('Read more', 'mahmudur'); ?></a></div>
<?php }?>
</div>
<?php if ($postmetashow): ?>
<div class="postmeta">
<span class="postdata"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php _e('Permanent Link to', 'mahmudur'); ?> <?php the_title_attribute(); ?>"><?php echo get_the_date( ) ?></a></span>
<?php if (comments_open() && !post_password_required()) : comments_popup_link(__('0', 'mahmudur'), __('1', 'mahmudur'), __('%', 'mahmudur'), 'commentslink'); endif;?>
<?php edit_post_link( __( 'Edit', 'mahmudur' ), '<span class="edit-link">', '</span>' ); ?>
</div>
<?php endif; ?>
</article>
<?php endwhile; ?>
</div>
<?php my_pagination( $connected->max_num_pages ); ?>
<?php else : ?>
<article class="hentry">
<h1>
<?php _e('Not Found', 'mahmudur'); ?>
</h1>
<p class="center">
<?php _e('Sorry, but you are looking for something that isn\'t here.', 'mahmudur'); ?>
</p>
</article>
<?php
wp_reset_postdata();
endif;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment