我正在创建自定义页面模板:
< ?php
/*
* Template Name: sliding content
* Description: Sliding category contents
*/
get_header(); ?>
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php while ( have_posts() ) : the_post(); ?>
<div class="post">
<h2 id="post-<?php the_ID(); ?>"><?php the_title();?></h2>
<div id="accordion">
<?php the_content();?>
</div>
</div>
<?php endwhile; // end of the loop. ?>
</main><!-- #main -->
</div><!-- #primary -->
< ? php get_footer(); ?>
我想有预定义的文本,这将显示在wp管理页面的编辑器一旦这个模板被选中。管理员将能够修改;编辑器中将显示类似的内容:<h1>modify this header for title</h1>
<div id="accordion">
write your content here
</div>
wordpress实现此任务的方式是什么?