From 983f6b742a2281e318d8c26ccdabb5c1ab64437a Mon Sep 17 00:00:00 2001 From: Laury GvR Date: Thu, 15 Nov 2018 10:07:26 -0500 Subject: [PATCH] No longer need to list all templates used --- lib/misc.php | 100 +++++++++++++++++++++++++-------------------------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/lib/misc.php b/lib/misc.php index a2776ab..26d63d2 100644 --- a/lib/misc.php +++ b/lib/misc.php @@ -78,65 +78,65 @@ function mytheme_search_loop() {

Templates Used

"; - list_templates_by_type( 'page' ); - list_templates_by_type( 'post' ); - //list_templates_by_type( 'custom-post-type' ); -} +// function list_templates_used( ) { +// global $post; +// echo "

Templates Used

"; +// list_templates_by_type( 'page' ); +// list_templates_by_type( 'post' ); +// //list_templates_by_type( 'custom-post-type' ); +// } -function list_templates_by_type( $type = 'page' ) { +// function list_templates_by_type( $type = 'page' ) { - $args = array( 'post_type' => $type, 'posts_per_page' => -1 ); - $posts = get_posts( $args ); - $count = 0; +// $args = array( 'post_type' => $type, 'posts_per_page' => -1 ); +// $posts = get_posts( $args ); +// $count = 0; - $output = ''; - $output .= '

\''. $type .'\' List

'; +// $output = ''; +// $output .= '

\''. $type .'\' List

'; - foreach ($posts as $post) { - setup_postdata( $post ); - if ( get_page_template_slug( $post->ID ) ) { - if ( $count == 0 ) { - $output .= ' Every '. $type .' not listed below has template "Default".

'; - $output .= ' '; - $output .= ' '; - } - $count++; - $output .= ''; - $output .= ''; - $output .= ''; - $output .= ''; - $output .= ''; - $output .= ''; - } +// foreach ($posts as $post) { +// setup_postdata( $post ); +// if ( get_page_template_slug( $post->ID ) ) { +// if ( $count == 0 ) { +// $output .= ' Every '. $type .' not listed below has template "Default".

'; +// $output .= '
IDNameSlugTemplate
' . $post->ID . '' . $post->post_title . '' . $post->post_name . '' . get_page_template_slug( $post->ID ) . '
'; +// $output .= ' '; +// } +// $count++; +// $output .= ''; +// $output .= ''; +// $output .= ''; +// $output .= ''; +// $output .= ''; +// $output .= ''; +// } - } - $output .= ''; - $output .= '
IDNameSlugTemplate
' . $post->ID . '' . $post->post_title . '' . $post->post_name . '' . get_page_template_slug( $post->ID ) . '
'; +// } +// $output .= ''; +// $output .= ''; - if ( $count == 0 ) { - $output .= ' Either there are no posts with type "' . $type . '", or none of them have custom templates set (and have the Default template). '; - } +// if ( $count == 0 ) { +// $output .= ' Either there are no posts with type "' . $type . '", or none of them have custom templates set (and have the Default template). '; +// } - wp_reset_postdata(); - echo $output; -} +// wp_reset_postdata(); +// echo $output; +// } add_action('thematic_searchloop', 'mytheme_search_loop'); // End of the Contextual/Highlight Search functions \ No newline at end of file -- 2.17.1