This repository has been archived on 2026-10-23. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
studio-2013/wp-content/themes/studio13/sidebar.php
T
2013-05-18 17:51:35 +02:00

31 lines
1.3 KiB
PHP

<div id="sidebar1" class="sidebar small-4 columns" role="complementary">
<div class="lineup">
<a href="/artister/" class="hover artists" title="Artister"><span></span></a>
<ul class="artists headliners">
<?php
/* Print our custom post type */
$query = new WP_Query( array ( 'post_type' => 'artist', 'tag' => 'headliner' ) );
while ( $query->have_posts() ):
$query->the_post();
echo '<li><a href="'.get_permalink().'">' . get_the_title() . '</a></li>';
endwhile;
wp_reset_postdata();
?>
</ul>
<ul class="artists">
<?php
/* exclude all the headliners */
$headline_tag_id = get_term_by( 'slug', 'headliner', 'post_tag')->term_id;
$query = new WP_Query(array(
'post_type' => 'artist',
'tag__not_in' => array($headline_tag_id)));
while ( $query->have_posts() ):
$query->the_post();
echo '<li><a href="'.get_permalink().'">' . get_the_title() . '</a></li>';
endwhile;
wp_reset_postdata();
?>
</ul>
</div>
</div>