Php wordpress添加媒体与插件冲突
我的wordpress“添加媒体”灯箱功能被我添加的jquery中断。我不知道为什么会有问题。谁能看一看并帮忙吗 jquery在这里:Php wordpress添加媒体与插件冲突,php,jquery,wordpress,conflict,Php,Jquery,Wordpress,Conflict,我的wordpress“添加媒体”灯箱功能被我添加的jquery中断。我不知道为什么会有问题。谁能看一看并帮忙吗 jquery在这里: jQuery(document).ready( function($){ $("header > h2").click( function() { var div = $("div#OvertheTop"); $.post('wp-admin/admin-ajax.php', { action: "tpp_comments", post_id: $(t
jQuery(document).ready( function($){
$("header > h2").click( function() {
var div = $("div#OvertheTop");
$.post('wp-admin/admin-ajax.php', {
action: "tpp_comments",
post_id: $(this).find("a").attr("id")
}, function (data) {
div.append($(data));
div.css("opacity","1");
div.css("display","block");
$("body").css("overflow","hidden");
$("#BigContainer").fadeIn();
$("#BigContainer").css("display","block");
}
);
return false;
});
$(document).click(function(event) {
if(!$(event.target).closest('#post').length) {
if($('#post').is(":visible")) {
$("#post").remove();
$("#BigContainer").fadeOut();
$("body").css("overflow","visible");
}
}
})
});
php在这里:
function tpp_posts_comments_return()
{
$post_id = isset( $_POST['post_id'] ) ? $_POST['post_id'] : 0;
if ( $post_id > 0)
{
$post = get_post($post_id);
?>
<div id="post"><?php echo apply_filters('the_content', $post->post_content); ?></div>
<?php
}
die();
}
add_action('wp_ajax_nopriv_tpp_comments','tpp_posts_comments_return');
function tpp_posts_get_scripts()
{
wp_enqueue_script("tpp-posts", path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ )). "/top_post.js") , array("jquery"));
}
add_action('wp_print_scripts','tpp_posts_get_scripts');
函数tpp\u posts\u comments\u return()
{
$post\u id=isset($\u post['post\u id'])?$\u post['post\u id']:0;
如果($post_id>0)
{
$post=get\u post($post\u id);
?>
“中断”-到底是什么问题?什么不起作用?您在控制台中有任何错误吗?我们需要更多信息。文本框和所有内容都是这样:我认为没有任何错误