Digital experiences for all disciplines
New Landing › How can we help? › Themeforest Theme Support › Flexform › how to select a new page template in the admin ? › Reply To: how to select a new page template in the admin ?
October 27, 2014 at 9:15 pm
#123525
it works very well but titrede page and sidebar are not displayed …
Is something missing in the code of my page?
<?php
/*
Template Name: Sitemap
*/
?>
<?php get_header(); ?>
<?php /* Liste des pages */ ?>
<h2>Pages</h2>
<ul>
<?php wp_list_pages("title_li=" ); ?>
</ul>
<?php /* Flux RSS */ ?>
<h2>Flux RSS</h2>
<ul>
<li><a title="Flux articles" href="feed:<?php bloginfo('rss2_url'); ?>">Flux RSS principal</a></li>
<li><a title="Flux commentaires" href="feed:<?php bloginfo('comments_rss2_url'); ?>">Flux RSS des commentaires</a></li>
</ul>
<?php /* Liste des catégories */ ?>
<h2>Catégories</h2>
<ul>
<?php wp_list_categories('sort_column=name&optioncount=1&hierarchical=0&feed=RSS&title_li='); ?>
</ul>
<?php /* Liste des articles */ ?>
<h2>Articles</h2>
<ul>
<?php $archive_query = new WP_Query('showposts=1000'); while ($archive_query->have_posts()) : $archive_query->the_post(); ?>
<li><a href="<?php the_permalink() ?>" rel="bookmark" title="Lien à <?php the_title(); ?>"><?php the_title(); ?></a>(<?php comments_number('0', '1', '%'); ?>)</li>
<?php endwhile; ?>
</ul>
<?php /* Liste des éléments d'un custom post type */ ?>
<h2>Custom Post Type</h2>
<ul>
<?php $archive_query = new WP_Query('showposts=1000&post_type=custom_post_type'); while ($archive_query->have_posts()) : $archive_query->the_post(); ?>
<li><a href="<?php the_permalink() ?>" rel="bookmark" title="Lien à <?php the_title(); ?>"><?php the_title(); ?></a></li>
<?php endwhile; ?>
</ul>
</div>
<?php get_footer(); ?>