确实需要一些有关社交共享按钮的帮助

发布于 2024-11-19 08:21:43 字数 5365 浏览 4 评论 0原文

我遇到这个问题:

当您访问我的网站时: 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

予囚 2024-11-26 08:21:43

我下载了该插件,我可以在文件“la-click-and-shared.php”的代码中看到,大约第 560 行,该小部件获取从当前帖子/的永久链接传递到社交按钮的链接页。我不知道你为什么有那个永久链接。

我猜想这一定是永久链接/帖子名称、一般永久链接设置或 AJAX 功能的问题,但如果没有更多详细信息,很难为您提供进一步的帮助。

您可以尝试以下操作:

  1. 检查您显示为主页的页面或帖子的永久链接。
  2. 暂时禁用自定义永久链接,然后看看它是否有效。
  3. 是设置>阅读>首页显示的选项设置正确吗?
  4. 暂时禁用其他插件

编辑:
您还可以编辑 la-click-and-shared.php。在我刚刚下载的最新版本中,这是第 556 行:

$args['link'] = htmlentities($link1);

如果您无法以任何其他方式修复它和/或您很着急,您可以这样做:

$args['link'] = 'http://www.appartementtekooputrecht.nl';

因为您的网站仅公开该 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:

  1. Check the permalink of that page or post you are showing as home.
  2. Disable custom permalinks temporarily and see if it works then.
  3. Is the Settings > Reading > Front page displays option set correctly?
  4. Disable other plugins temporarily

Edit:
You could also edit la-click-and-shared.php. In the latest version that I just have downloaded, this is line 556:

$args['link'] = htmlentities($link1);

If you can't fix it any other way and/or you are in a hurry, you could just do:

$args['link'] = 'http://www.appartementtekooputrecht.nl';

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).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文