コード例 #1
0
$the_query = new WP_Query( $args ); 


?>

<main class="reporting-dashboard">
	<div class="hero">

		<h1><?php echo get_userdata($current_user->ID)->data->display_name; ?>'s Dashboard</h1>
	</div>

	<div class="page-container">
		<?php the_partial('report-section-title', array('title' => 'Reports')); ?>
		<?php if ( $the_query->have_posts() ) : ?>
			<?php while ( $the_query->have_posts() ) : $the_query->the_post(); $report = new Report_View_Model( $post );?>

				<a href="<?php echo $report->get_permalink();?>" class="report-card report__item">
					<div class="report-card__header">
						<div class="report-card__header-group">
							<h2 class="report-card__title"><?php echo $report->get_title(); ?></h2>
						</div>
						<div class="report-card__header-group">
							<p class="report-card__date"><?php echo $report->report_date; ?></p>
							<?php if ( $report->label ) : ?>
							<p class="report-card__label"><?php echo $report->label; ?></p>
							<?php endif; ?>
						</div>
					</div>
					
					<?php if( have_rows('pull_quotes') ): ?>
コード例 #2
0
<?php
	include( get_template_directory() . '/functions/data/class-report-view-model.php' );
	$report = new Report_View_Model( $post );

	// check if current user matches the report user
	// or if the current user is an admin
	// if not, send them back to their admin page

	if ($current_user->ID != $report->report_client['ID'] && !current_user_can('manage_options')) {
		auth_redirect();
	}
	
	// Get all report content
	// then sort it and get ready to be printed to the screen
	$features_recap = sort_repeater('features_recap');	
	$pending_recap = sort_repeater('pending_recap');
	$passed_recap = sort_repeater('passed_recap');
	$news_recap = sort_repeater('news_recap');
	$tv_radio_recap = sort_repeater('tv_radio_recap');
	$reviews_recap = sort_repeater('reviews_recap');

	get_header();
?>

<?php the_partial('nav'); ?>
	
<?php if ( have_post ) : while ( have_posts() ) : the_post(); ?>
	<div class="hero">
		<div class="page-container">
			<div class="client-mantle">
				<?php if (get_field('client_image', $report->report_client['ID'])): ?>