예제 #1
0
function output_winners()
{
    $students = get_posts(array('posts_per_page' => -1, 'post_type' => 'student', 'tax_query' => array(array('taxonomy' => 'status', 'field' => 'slug', 'terms' => 'yes'))));
    $student_emails = fopen(TEMPLATEPATH . '/students.csv', 'w');
    foreach ($students as $student) {
        fputcsv($student_emails, array(get_post_meta($student->ID, 'entry-title', true), get_post_meta($student->ID, 'entry-name-first', true), get_post_meta($student->ID, 'entry-name-last', true), get_post_meta($student->ID, 'entry-email', true), get_post_meta($student->ID, 'entry-company', true), get_post_meta($student->ID, 'entry-url', true), get_the_term_names($student->ID, 'student-category', '', '', '')));
    }
    fclose($student_emails);
    $professionals = get_posts(array('posts_per_page' => -1, 'post_type' => 'professional', 'tax_query' => array(array('taxonomy' => 'status', 'field' => 'slug', 'terms' => 'yes'))));
    $professional_emails = fopen(TEMPLATEPATH . '/professionals.csv', 'w');
    foreach ($professionals as $professional) {
        fputcsv($professional_emails, array(get_post_meta($professional->ID, 'entry-title', true), get_post_meta($professional->ID, 'entry-name-first', true), get_post_meta($professional->ID, 'entry-name-last', true), get_post_meta($professional->ID, 'entry-email', true), get_post_meta($professional->ID, 'entry-company', true), get_post_meta($professional->ID, 'entry-url', true), get_the_term_names($professional->ID, 'professional-category', '', '', '')));
    }
    fclose($professional_emails);
}
예제 #2
0
            ?>
" <?php 
            if (has_term('yes', 'status')) {
                post_class('status-yes entry-container');
            } else {
                post_class('entry-container');
            }
            ?>
>
				<h1 class="entry-title"><?php 
            $post_type = get_post_type_object($post->post_type);
            echo $post_type->label;
            ?>
</h1>
				<h2 class="entry-cat"><?php 
            echo get_the_term_names($post->ID, $post->post_type . '-category', '', ', ', '');
            ?>
</h2>
				<?php 
            if (has_post_thumbnail()) {
                ?>
				<aside class="entry-image">
					<?php 
                the_post_thumbnail('large');
                ?>
				</aside>
				<?php 
            }
            ?>
				<?php 
            if (class_exists('MultiPostThumbnails') && MultiPostThumbnails::has_post_thumbnail($post->post_type, $post->post_type . '-secondary', $post->ID)) {