コード例 #1
0
/**
 * Template Name: Portfolio archive page
 *
 * @version 1.0.6
 */
get_header();
?>
	<main role="main">
		<header>
			<h1 class="page-title"><?php 
single_post_title();
?>
</h1>
		</header>
		<?php 
$args = hannover_page_template_query_args($post, 'portfolio-archive');
$archive_query = new WP_Query($args);
$temp_query = $wp_query;
$wp_query = null;
$wp_query = $archive_query;
$archive_alt_layout = get_theme_mod('portfolio_archive_alt_layout');
if ($archive_query->have_posts()) {
    while ($archive_query->have_posts()) {
        $archive_query->the_post();
        if ($archive_alt_layout == 'checked') {
            get_template_part('template-parts/content', 'portfolio-element-alt');
        } else {
            get_template_part('template-parts/content', 'portfolio-element');
        }
    }
} else {
コード例 #2
0
/**
 * Template Name: Portfolio category page
 *
 * @version 1.0.6
 */
get_header();
?>
	<main role="main">
		<header>
			<h1 class="page-title"><?php 
single_post_title();
?>
</h1>
		</header>
		<?php 
$args = hannover_page_template_query_args($post, 'portfolio-category-page');
$portfolio_query = new WP_Query($args);
$temp_query = $wp_query;
$wp_query = null;
$wp_query = $portfolio_query;
$portfolio_category_alt_layout = get_theme_mod("portfolio_category_page_alt_layout_{$post->ID}");
if ($portfolio_query->have_posts()) {
    while ($portfolio_query->have_posts()) {
        $portfolio_query->the_post();
        if ($portfolio_category_alt_layout == 'checked') {
            get_template_part('template-parts/content', 'portfolio-element-alt');
        } else {
            get_template_part('template-parts/content', 'portfolio-element');
        }
    }
} else {