0

WordPress Web サイトに合わせてカスタム ブログ ページを作成しました。このページは、ブログ フィードから 1 つのカテゴリのみを表示するように作成されています。「AddThis」プラグイン共有ボタンを追加し、手動でテーマにコーディングしました。

問題は、ボタンが表示されないことです。他の共有プラグインをページに追加しようとしましたが、どちらも表示されません。現在、ボタンは他のブログ ページや記事自体に表示されるので機能します。

ページとコードの Web サイトは次のとおりです。何か不足していますか、それともコード行を変更する必要がありますか?

共有ボタンが機能していないページ

共有ボタンが機能しているページ

<?php /* Template Name: Page - Online Reviews */ ?>
    <div class="main_container">
        <div class="page_container">


    <h2 style="border-bottom: solid thin #000; line-height: 50px; margin-bottom: 50px;"><?php the_title(); ?></h2>
    <?php
    $temp = $wp_query;
    $wp_query = NULL;
    $wp_query = new WP_Query();
    $wp_query->query('cat=4&paged='.$paged); $tb_counter = 1;
    while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
    <div <?php if(function_exists('post_class')) : ?><?php post_class(); ?><?php else : ?>class="post post-<?php the_ID(); ?>"<?php endif; ?>>
        <h3><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s','easycarebath'),the_title_attribute('echo=0')); ?>"><?php the_title(); ?></a></h3>
            <a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( '%s', 'easycarebath' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_post_thumbnail(); ?></a>
            <?php the_content(); ?>
            <!-- AddThis Button BEGIN -->
            <div class="addthis_toolbox addthis_default_style ">
                <a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
                <a class="addthis_button_tweet"></a>
                <a class="addthis_button_google_plusone" g:plusone:size="medium"></a>
                <a class="addthis_button_linkedin_counter"></a>
                <a class="addthis_counter addthis_pill_style"></a>
            </div>
            <script type="text/javascript">var addthis_config = {"data_track_addressbar":true};</script>
            <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-4dd51ec729a7fec7"></script>
            <!-- AddThis Button END -->
    <footer class="entry-meta">
    <?php the_time(__('M d, Y', 'easycarebath')); ?> | <?php _e('Categories:','easycarebath'); if (the_category(', '))  the_category(); ?> <?php if (get_the_tags()) the_tags(__('| Tags: ','easycarebath')); ?> | <?php comments_popup_link(__('Leave A Comment »', 'easycarebath'), __('1 Comment »', 'easycarebath'),__ngettext('% Comment »', '% Comments »',get_comments_number (),'easycarebath')); ?> <?php edit_post_link(__('Edit','easycarebath'), '| ', ''); ?>
    </footer>
    <?php $tb_counter++; endwhile; ?>
    <nav id="nav-below" class="navigation" role="navigation">
        <div class="nav-previous alignright"><?php next_posts_link(__('&laquo; Older Entries','easycarebath')); ?></div>
        <div class="nav-next alignleft"><?php previous_posts_link(__('Newer Entries &raquo;','easycarebath')); ?></div>
    </nav>
    <?php $wp_query = NULL; $wp_query = $temp;?>

        </div>
        <?php get_sidebar(); ?>
    </div>
4

1 に答える 1

0

問題を見つけました。問題となったのはコードではなく、コードを適切に保存していなかったのは送信でした。プログラムを再起動した後、コードを保存することができ、共有ボタンが表示されるようになりました。

皆さんの試みに感謝します、それはソフトウェアの問題でした。:)

于 2013-01-29T00:13:27.787 に答える