Skip to content

Instantly share code, notes, and snippets.

Created March 31, 2014 16:37
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 anonymous/9896420 to your computer and use it in GitHub Desktop.
Save anonymous/9896420 to your computer and use it in GitHub Desktop.
function yoga_content( $atts, $content = null ) {
// $args = array(
// 'post_type' => 'page',
// 'perm' => '12 poses group',
// 'order' => 'ASC',
// 'orderby' => 'title',
// 'posts_per_page' => -1
// );
echo "<h2>Available Content</h2>";
$exclude_ids = array( 3240,2600,2612,2610 );
$the_query = new WP_Query(array( 'post_type' => 'page', 'perm' => 'member_content_access', array( 'post__not_in' => $exclude_ids ) ));
if(current_user_can( 'member_content_access' ) ) :
while($the_query->have_posts()) :
$the_query->the_post();
?>
<ul class="display-posts-listing">
<li class="listing-item"><a href="<?php echo get_permalink( ); ?>" title="<?php the_title() ?>"><?php the_title() ?></a></li>
</ul>
<?php
endwhile;
else:
?>
<?php
endif;
// Reset Post Data
wp_reset_postdata();
}
add_shortcode("yoga_content", "yoga_content");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment