Created
March 9, 2018 15:58
-
-
Save karissademi/8c497a7ffd0fc1e2d8a9519b600d5084 to your computer and use it in GitHub Desktop.
All non-stub service pages without Revenue, PPR + DHS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$args = array( | |
'post_type' => array( | |
'service_page', | |
), | |
'post_status' => 'any', | |
'posts_per_page' => -1, | |
'category__not_in' => array('2', '234', '230'), | |
'meta_query' => array( | |
array( | |
'key' => 'phila_template_select', | |
'value' => 'service_stub', | |
'compare' => 'NOT IN', | |
), | |
) | |
); | |
$the_query = new WP_Query( $args ); | |
// The Loop | |
if ( $the_query->have_posts() ) { | |
echo '<table>'; | |
while ( $the_query->have_posts() ) { | |
$the_query->the_post(); | |
echo '<tr><td>' . get_the_title(). '</td><td>' . get_permalink() .'</td> <td>'; | |
if( get_the_category() != null ) { | |
foreach((get_the_category()) as $category){ | |
echo $category->name; | |
} | |
} | |
'</td></tr>'; | |
} | |
echo '</table>'; | |
/* Restore original Post Data */ | |
wp_reset_postdata(); | |
} else { | |
// no posts found | |
}?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment