我需要一个在wordpress日历中的ajaxify“next”和“prev”链接来导航几个月,而不更新页面。
有一些插件可以实现这一点,但我称之为calendar,而不使用小部件——get_calendar();
我需要一个在wordpress日历中的ajaxify“next”和“prev”链接来导航几个月,而不更新页面。
有一些插件可以实现这一点,但我称之为calendar,而不使用小部件——get_calendar();
编写所需的javascript,然后使用此代码将其显示在页面上,这样可以确保仅在显示日历时才包含脚本
add_filter(\'get_calendar\', \'add_calendar_scripts\');
function add_calendar_scripts($content) {
add_action( \'wp_footer\', \'output_calendar_scripts\', 11);
return $content;
}
function output_calendar_scripts() {
?>
<script type="text/javascript" src="<?php echo get_template_directory_uri();?>/path/to/script.js"></script>
<?php
}
我想在jquery中添加php代码。我知道该文件不能保存为js文件,但必须保存为php文件才能执行php代码。如果我们将其保存为php文件,那么它也不能在函数中排队。php。jQuery(document).ready(function() { jQuery(\'#a, #b\').change(function () { var $this = jQuery(this), // Get a handle on the checkbox we just clicked.