Ashley Cameron Design

Ashley Cameron Design

Shop the Creative Design Market

Good evening

query_posts for Custom Post Types

SnippetsWordPress

About a 1 minute read

"If you truly love nature, you will find beauty everywhere."

Vincent Van Gogh


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
        query_posts( array('post_type' => 'Snippets',
        'posts_per_page' => -1,
        'tax_query' => array(
            array(
                'taxonomy' => 'language',
                'field' => 'slug',
                'terms' => 'sql'
                )
            )
        )
    );
while ( have_posts() ) : the_post();
echo "<a href='". the_permalink() ."'>". the_title()."</a>";
the_terms( $post->ID, 'language', 'Tagged in: ', ', ', ' ' );
endwhile;