【发布时间】:2015-05-09 07:11:55
【问题描述】:
我为wordpress 主题创建了一个自定义页面模板,只要我在本地安装了该主题页面就会显示并在其中显示与之关联的自定义帖子类型,但是当我加载在线主题并创建通过选择要使用的模板页面,页面内容不显示。 似乎通过选择页面模板不是使用此模板创建页面,而是使用索引的内容创建页面。 这是我的页面代码,带有显示 custom_post_type 的循环
<?php
/*
*Template Name: Partecipanti
*Description : Pagina che raggiude tutte le associazioni partecipanti
*/
?>
<?php get_header(); ?>
<div id="partecipanti" class="content-container row">
<h2 class="titolo-pagina"><?php the_title(); ?></h2>
<?php
$wpquery = new WP_Query(array(
'post_type' => 'partecipanti',
'posts_per_page' => -1,
));
while ($wpquery->have_posts()): $wpquery->the_post();
?>
<div class="container-partecipante col-lg-3 col-md-3 col-sm-4 col-xs-12 visible-xs">
<?php the_post_thumbnail() ?>
<h2 class="nome"><?php the_title() ?></h2>
</div>
<div class="flip-container container-partecipante col-lg-3 col-md-3 col-sm-4 col-xs-12 hidden-xs" ontouchstart="this.classList.toggle('hover');">
<div class="flipper">
<div class="front">
<?php the_post_thumbnail() ?>
</div>
<div class="back">
<h2 class="nome"><?php the_title() ?></h2>
<a class="glyphicon glyphicon-plus" href="<?php the_permalink(); ?>"></a>
</div>
</div>
</div>
<?php endwhile; wp_reset_query(); ?>
【问题讨论】:
标签: wordpress php html wordpress wordpress-theming