我的建议。前端未添加js。除此之外,所有脚本都已正确加载。我只想在frontpage上加载它,以便:
add_action(\'wp_enqueue_scripts\', \'homescripts\');
function homescripts()
{
if (is_front_page()):
wp_enqueue_script(\'suggest\');
endif;
}
在我家的html中<script>
jQuery("#my_input").suggest("<?php echo get_bloginfo(\'wpurl\'); ?>/wp-admin/admin-ajax.php?action=ajax-tag-search&tax=my_taxonomy", {multiple:true, multipleSep: ","});
</script>
在哪里#my_input
是我想要的带有建议和tax=my_taxonomy
是源分类法。我在做什么?提前谢谢。