确实需要一些有关社交共享按钮的帮助
我遇到这个问题:
当您访问我的网站时: http://www.appartementtekooputrecht.nl 并单击twitter 分享按钮,它将 twitter 定向到 http://www.appartementtekooputrecht.nl/samenvatting(最后一页)而不是主页。 我已将共享插件共享代码放置在主题的更多部分中,但效果不佳。
仅供参考,在此主题中,所有页面都显示在主页上。
任何帮助将非常感激!
这是我的header.php(分享在最后)
<?php global $shortname; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<title><?php elegant_titles(); ?></title>
<?php elegant_description(); ?>
<?php elegant_keywords(); ?>
<?php elegant_canonical(); ?>
<link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/style.css" type="text/css" media="screen" />
<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
<link rel="alternate" type="application/atom+xml" title="<?php bloginfo('name'); ?> Atom Feed" href="<?php bloginfo('atom_url'); ?>" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/css/ie6style.css" />
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/DD_belatedPNG_0.0.8a-min.js"></script>
<script type="text/javascript">DD_belatedPNG.fix('img.overlay, div#content-bg-bottom');</script>
<![endif]-->
<?php wp_head(); ?>
</head>
<body>
<div id="wrapper">
<div id="content">
<div id="content-bg-bottom">
<div id="header">
<ul>
<li class="active"><a href="#" rel="resume">Home</a></li>
<?php query_posts(array
('post_type' => 'page',
'orderby' => get_option('myresume_nav_sort_pages'),
'order' => get_option('myresume_nav_order_page'),
'post__not_in' => get_option('myresume_nav_exclude_pages')
)); ?>
<?php if (have_posts()) : while (have_posts()) : the_post()?>
<li><a href="#" rel="<?php echo($post->post_name) ?>"><?php the_title() ?></a></li>
<?php endwhile; endif; wp_reset_query(); ?>
</ul>
<br class="clear" />
<div id="logo">
<img class="avatar" alt="Appartement te koop Utrecht Utrecht" src="http://www.tim-productions.tv/appartementtekooputrecht.nl/wp-content/themes/MyResume/images/appartement-te-koop-utrecht-logo.jpg" />
<img class="overlay" src="<?php bloginfo('template_directory'); ?>/images/photo-overlay.png" alt="" />
<span>
<br />
<?php echo(get_option('myresume_email')) ?>
<br />
<?php echo(get_option('myresume_phone')) ?>
</span>
</div>
</div>
<div id="inside">
<div id="inside-bg-top">
<div id="inside-bg-bottom">
<div class="resume slide">
<div class="social"><?php lacands_wp_filter_content_widget(); ?></div>
这里是主题index.php
<?php get_header(); ?>
<?php query_posts(array
('post_type' => 'page',
'orderby' => get_option('myresume_sort_pages'),
'order' => get_option('myresume_order_page'),
'post__in' => get_option('myresume_exclude_pages')
)); ?>
<?php if (have_posts()) : while (have_posts()) : the_post()?>
<div class="page-content">
<div class="entry">
<?php the_content('') ?>
</div>
<h2><?php the_title() ?></h2>
</div>
<?php endwhile; endif; wp_reset_query(); ?>
<?php get_footer(); ?>
I bump into this problem:
When you go to my website: http://www.appartementtekooputrecht.nl and click on the twitter share button, it directs twitter to http://www.appartementtekooputrecht.nl/samenvatting (last page) in stead of to the homepage.
I have placed the share plugin share code in more parts of the theme, but with no good result.
Fyi in this theme all pages are displayed on the homepage.
Any help would be realy appreciated!
here is my header.php (share is at the end)
<?php global $shortname; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<title><?php elegant_titles(); ?></title>
<?php elegant_description(); ?>
<?php elegant_keywords(); ?>
<?php elegant_canonical(); ?>
<link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/style.css" type="text/css" media="screen" />
<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
<link rel="alternate" type="application/atom+xml" title="<?php bloginfo('name'); ?> Atom Feed" href="<?php bloginfo('atom_url'); ?>" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/css/ie6style.css" />
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/DD_belatedPNG_0.0.8a-min.js"></script>
<script type="text/javascript">DD_belatedPNG.fix('img.overlay, div#content-bg-bottom');</script>
<![endif]-->
<?php wp_head(); ?>
</head>
<body>
<div id="wrapper">
<div id="content">
<div id="content-bg-bottom">
<div id="header">
<ul>
<li class="active"><a href="#" rel="resume">Home</a></li>
<?php query_posts(array
('post_type' => 'page',
'orderby' => get_option('myresume_nav_sort_pages'),
'order' => get_option('myresume_nav_order_page'),
'post__not_in' => get_option('myresume_nav_exclude_pages')
)); ?>
<?php if (have_posts()) : while (have_posts()) : the_post()?>
<li><a href="#" rel="<?php echo($post->post_name) ?>"><?php the_title() ?></a></li>
<?php endwhile; endif; wp_reset_query(); ?>
</ul>
<br class="clear" />
<div id="logo">
<img class="avatar" alt="Appartement te koop Utrecht Utrecht" src="http://www.tim-productions.tv/appartementtekooputrecht.nl/wp-content/themes/MyResume/images/appartement-te-koop-utrecht-logo.jpg" />
<img class="overlay" src="<?php bloginfo('template_directory'); ?>/images/photo-overlay.png" alt="" />
<span>
<br />
<?php echo(get_option('myresume_email')) ?>
<br />
<?php echo(get_option('myresume_phone')) ?>
</span>
</div>
</div>
<div id="inside">
<div id="inside-bg-top">
<div id="inside-bg-bottom">
<div class="resume slide">
<div class="social"><?php lacands_wp_filter_content_widget(); ?></div>
And here the theme index.php
<?php get_header(); ?>
<?php query_posts(array
('post_type' => 'page',
'orderby' => get_option('myresume_sort_pages'),
'order' => get_option('myresume_order_page'),
'post__in' => get_option('myresume_exclude_pages')
)); ?>
<?php if (have_posts()) : while (have_posts()) : the_post()?>
<div class="page-content">
<div class="entry">
<?php the_content('') ?>
</div>
<h2><?php the_title() ?></h2>
</div>
<?php endwhile; endif; wp_reset_query(); ?>
<?php get_footer(); ?>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我下载了该插件,我可以在文件“la-click-and-shared.php”的代码中看到,大约第 560 行,该小部件获取从当前帖子/的永久链接传递到社交按钮的链接页。我不知道你为什么有那个永久链接。
我猜想这一定是永久链接/帖子名称、一般永久链接设置或 AJAX 功能的问题,但如果没有更多详细信息,很难为您提供进一步的帮助。
您可以尝试以下操作:
编辑:
您还可以编辑 la-click-and-shared.php。在我刚刚下载的最新版本中,这是第 556 行:
如果您无法以任何其他方式修复它和/或您很着急,您可以这样做:
因为您的网站仅公开该 URL,无论如何它都不是一件大事。但是,当然,如果您将来更改站点,那么您就“破坏”了该插件,因此它不会使用 AJAX(我认为这是不恰当的)来加载具有相同 URL 的所有页面(也没有浏览历史记录)。
I downloaded that plugin and I can see in the code of the file "la-click-and-shared.php", around line 560, that the widget gets the links that passes to the social buttons from the permalink of the current post/page. What I can't know is why you have that permalink.
I would guess it must be a problem either with the permalink/name of the post, with the permalinks setting in general or with the AJAX functionality, but it is difficult to help you further without further details.
You could try these:
Edit:
You could also edit la-click-and-shared.php. In the latest version that I just have downloaded, this is line 556:
If you can't fix it any other way and/or you are in a hurry, you could just do:
Since your site only exposes that URL anyway it is not a big deal. But, of course, you are 'breaking' the plugin if you change your site in the future so it doesn't use AJAX (inappropriately in my opinion) to load all the pages with the same URL (no browsing history either).