Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/249.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Wordpress中的Ajax内容-需要为书签添加URL_Php_Jquery_Ajax_Wordpress - Fatal编程技术网

Php Wordpress中的Ajax内容-需要为书签添加URL

Php Wordpress中的Ajax内容-需要为书签添加URL,php,jquery,ajax,wordpress,Php,Jquery,Ajax,Wordpress,我使用的技术如下:将Ajax内容加载到此页面上的wordpress div中: 代码是: jQuery.noConflict(); jQuery(document).ready(function($){ $.ajaxSetup({cache:false}); $("a.ajax").click(function(){ var post_url = $(this).attr("href"); var post_id = $(this).attr("rel"); $("#shop").html(

我使用的技术如下:将Ajax内容加载到此页面上的wordpress div中:

代码是:

jQuery.noConflict();
jQuery(document).ready(function($){

$.ajaxSetup({cache:false});
$("a.ajax").click(function(){
var post_url = $(this).attr("href");
 var post_id = $(this).attr("rel");
$("#shop").html('<div class="loading"><img src="http://dev.riverroadcoffees.com/blog/wp-content/uploads/2013/12/ajax-loader.gif" /> <span>Loading...</span></div>');
$("#shop").load(post_url);

return false;});
});

CODE IN TEMPLATE:
<article>
<a href="<?php the_permalink(); ?>" rel="<?php the_ID(); ?>" class="ajax"><?php the_post_thumbnail('bag', array('class' => 'alignleft')); ?></a>
<h4><a href="<?php the_permalink(); ?>" rel="<?php the_ID(); ?>" class="ajax"><?php the_title(); ?></a></h4>
<?php the_field('strength'); ?>
</article>
jQuery.noConflict();
jQuery(文档).ready(函数($){
$.ajaxSetup({cache:false});
$(“a.ajax”)。单击(函数(){
var post_url=$(this.attr(“href”);
var post_id=$(this.attr(“rel”);
$(“#shop”).html('Loading…');
$(“#商店”).load(发布url);
返回false;});
});
模板中的代码:

一切都按预期进行…但我没有一种方式让用户将某个URL作为书签或引用某个产品的URL。我希望这是件简单的事。但我可能错了。

是否将URL添加到书签或引用?那是什么?听起来很困惑!!只需要一种方式,让用户能够发送到使用Ajax加载的特定产品的链接。(即…“看看这个很棒的产品。这里有一个链接:)现在什么都没有。他们总是会被引导到所有产品的主页。