我们正在将公司新闻稿转换为Wordpress。我们的旧站点是基本的HTML/CSS/JS。在那个网站上,我们有一个“打印所有故事”按钮,可以以可打印的格式从该期中提取每篇文章。在WP中,有没有一种方法可以通过在下面这样的可打印页面上按类别或标记过滤帖子来实现?
(参见http://ddmonews.com/insightfulsmiles/octnov2016/print-all-stories.html)
它使用了以下JS:
<script type="text/javascript" src="common/jquery-1.7.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
var stories = [\'story1.php\', \'story2.php\', \'story3.php\', \'efn_adv.php\', \'efn_ddmo.php\', \'efn_ddsc.php\', \'ghsh1.php\', \'ghsh2.php\', \'ghsh3.php\', \'ghsh4.php\', \'ghsh5.php\', \'npnf_ddmo.php\', \'npnf_deniserv.php\', \'atwc_adv.php\', \'atwc_ddmo.php\', \'familyphotos1.php\', \'familyphotos2.php\', \'familyphotos3.php\', ];
function nextLoad(i) {
if(i < stories.length) {
loadContent(stories[i]+\' div.content\', i);
}
}
function loadContent(toLoad, i) {
$(\'#temp\').load(toLoad,\'\',function(){appendContent(i);});
}
function appendContent(i) {
$(\'#content\').append($(\'#temp\').html());
i++;
nextLoad(i);
}
nextLoad(0);
});
</script>