Wordpress Facebook-Like共享了错误的url
我有一个网站,当使用类似Facebook的按钮时,它总是有不同帖子的URL 例如: 我使用了不同的插件,甚至添加了我自己的like按钮,它们都做同样的事情。唯一能修复它的是如果我更改模板,不幸的是这不是一个选项 有什么想法吗Wordpress Facebook-Like共享了错误的url,wordpress,facebook,facebook-opengraph,Wordpress,Facebook,Facebook Opengraph,我有一个网站,当使用类似Facebook的按钮时,它总是有不同帖子的URL 例如: 我使用了不同的插件,甚至添加了我自己的like按钮,它们都做同样的事情。唯一能修复它的是如果我更改模板,不幸的是这不是一个选项 有什么想法吗 更新 我在WordPress循环中发现了以下内容 <?php if (have_posts()) : $post = $posts[0]; // Hack. Set $post so that the_date() wo
更新
我在WordPress循环中发现了以下内容
<?php if (have_posts()) :
$post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
<?php /* If this is a category archive */ if (is_category()) { ?>
<h3><?php printf(__('Archive for the ‘%s’ Category', TEXTDOMAIN), single_cat_title('', false)); ?></h3>
<?php /* If this is a tag archive */ } elseif( is_tag() ) { ?>
<h3><?php printf(__('Posts Tagged ‘%s’', TEXTDOMAIN), single_tag_title('', false) ); ?></h3>
<?php /* If this is a daily archive */ } elseif (is_day()) { ?>
<h3><?php printf(__('Archive for %s | Daily archive page', TEXTDOMAIN), get_the_time(__('F jS, Y', TEXTDOMAIN))); ?></h3>
<?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
<h3><?php printf(__('Archive for %s | Monthly archive page', TEXTDOMAIN), get_the_time(__('F Y', TEXTDOMAIN))); ?></h3>
<?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
<h3><?php printf(__('Archive for %s | Yearly archive page', TEXTDOMAIN), get_the_time(__('Y', TEXTDOMAIN))); ?></h3>
<?php /* If this is a yearly archive */ } elseif (is_search()) { ?>
<h3><?php printf( __( 'Search Results for: %s', TEXTDOMAIN ), '<span>' . get_search_query() . '</span>' ); ?></h3>
<?php /* If this is an author archive */ } elseif (is_author()) { ?>
<h3><?php _e('Author Archive', TEXTDOMAIN); ?></h3>
<?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
<h3><?php _e('Blog Archives', TEXTDOMAIN); ?></h3>
<?php }
while (have_posts()) : the_post();
global $more;
if(!is_single()) $more = 0;
$type_blog = ( $GLOBALS['yiw_custom_blog_type'] != false ) ? $GLOBALS['yiw_custom_blog_type'] : get_option( $GLOBALS['shortname'] . '_blog_type', 'classic' );
?>
我很确定这是一个问题(祈求好运),但我找不到解决办法。任何帮助都会很好!谢谢 您可能正在使用一个小部件或其他自定义查询,而该查询没有调用以更改回默认的
global$post
如果无法更改主题,请尝试禁用小部件或查看设置$post
对象的位置