Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function sc_loop_highlights_lehrer() {
- $args = array( 'post_type' => 'lehrer', 'posts_per_page' => -1, 'orderby' => 'title', 'order' => 'ASC', 'post_status' => array('publish'),
- 'tax_query' => array(
- array(
- 'taxonomy' => 'highlights',
- 'field' => 'slug',
- 'terms' => array('ja')
- )
- )
- );
- $string = '';
- $count = 0;
- $query = new WP_Query( $args );
- if( $query->have_posts() ){
- $string .= '<div class="list-posts">';
- $string .= '<div class="lehrer-referenten-highlights wrap-cpt cf">';
- $string .= '<h2 class="heading-title">Highlights 2017</h2>';
- while( $query->have_posts() ){
- $query->the_post();
- $count++;
- global $post;
- $string .= '<div class="cpt nth-'. ($xyz++%2) .' ">';
- /* $string .= '<a class="block scroll " title="' . get_the_title() . '" href="' . esc_url( get_permalink(3970) ) .'#lehrer-referenten-id-' . get_the_ID() . '">'; */
- $string .= '<a class="block" title="' . get_the_title() . '" href="' . esc_url( get_permalink(3970) ) .'#' . $post->post_name . '">';
- $string .= '<div class="outer cf">';
- if( has_post_thumbnail() ) {
- $string .= get_the_post_thumbnail( $post_id, 'partnerlogo' );
- }
- $string .= '<div class="inner">';
- $string .= '<h4>';
- $string .= get_the_title();
- $string .= '</h4>';
- $string .= '</div>';
- $string .= '</div>';
- $string .= '</a>';
- $string .= '</div>';
- }
- $string .= '</div></div>';
- }
- wp_reset_postdata();
- return $string;
- }
- add_shortcode( 'highlights_lehrer', 'sc_loop_highlights_lehrer' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement