按年份和月份折叠帖子标题菜单


Collapse posts titles menu by year and by month

我对这个问题完全迷失了方向。

显示年份

,然后单击年份展开显示任何月份 其中的帖子,然后在单击一个月时显示所有帖子标题 当月作为实际帖子的链接。

我对javascript很陌生,但我需要尽快解决这个问题。 在这个"问题"上,我坐了 4 个多小时。这是我需要做这种类型的菜单的网站:http://baltkojyterima.site90.com/

在这个网站上,您可以看到我到底需要什么:http://www.thewebsitedeveloper.co.nz/tempProject/nzca-wordpress/news-menu-test/

<aside>
  <div class="aside-left-menu">
   <?php if ( have_posts() ) : ?>
        <?php while ( have_posts() ) : the_post(); ?>
     
     
       
      </div><!--end post-->
    <?php endwhile; /* rewind or continue if all posts have been fetched */ ?>
    <?php else : ?>
    <?php endif; ?>
    <br> In this block i need to do this(i described) type of menu. </br>
  </div>
HERE I NEED JAVASCRIPT CODE>

谢谢你们提供的任何帮助!

------------------编辑-------------------

谢谢,但问题已经解决。我将开始学习使用jquery。:)

这可能是我能想到的最简单的方法。它甚至不是近乎完美的,但我希望它能帮助你。

https://jsfiddle.net/Arministrator/dt0f387t/1/

$(".clickthis").click(function(){
 var ct = $(this).children("ul");
 ct.show();})