ヘッダーにエンキューjquery-ui-accordion
し、それをアクティブにする次の関数を含めました。
$(function() {
$( "#accordion" ).accordion();
});
以下はhtmlの設定方法です。出力は、アコーディオン機能を持たない通常の WordPress 投稿のリストです。タイトルがクリックできるようにしてほしいです。誰かが私が間違ったことを理解するのを手伝ってくれますか?
<?php get_header();?>
<section id="content">
<h2>Our Latest Videos</h2>
<section id="latest-videos" class="video-archive">
<section id="accordion">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<article class="entry" id="post-<?php the_ID(); ?>">
<section class="description">
<h3><?php the_title(); ?></h3>
<div>
test test test
</div>
</section>
</article>
<?php endwhile; ?>
<?php endif; ?>
</section>
</section>
</section>
<?php get_sidebar(); ?>
<?php get_footer(); ?>