Paste it inbetween the same if statement that handles the full content for the first post, but right after the_content for that first post 🙂
Doesn’t the_content
handle the full content for each post?
I have the Sociable script beneath the_content
now. Above that is the beginning of the loop. The only “if” statement I see is if ( have_posts() )
.
I set Excerpt Editor to force excerpts of all posts following the first. Other than that, I’m hazy on how this thing works.
Thanks.
Please paste the entire loop in here, so I can tell you what to do, can’t tell you if I don’t know what code you’re running.
Here’s my Loop
:
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div id="post-<?php the_ID(); ?>">
<p><?php the_content(); ?></p>
<?php if (function_exists('sociable_html')) { echo sociable_html(Array("Digg", "del.icio.us", "StumbleUpon", "NewsVine", "Technorati", "Google", "YahooBuzz", "Reddit", "Facebook", "SphereIt", "Propellor", "TailRank", "email")); } ?>
<p>Posted in:</em> <span id="tags"><?php the_category(', ') ?></span> at <?php the_time('g:i a'); ?> <?php the_time('D, M j, Y'); ?>.</p>
<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><em>Permalink</em></a> • <?php edit_post_link('Edit', '', ' • '); ?><?php comments_popup_link('Add a comment!', '1 comment', '% comments'); ?>
</div>
<?php endwhile; ?>
<?php if(function_exists('wp_pagenavi')) { // if PageNavi is activated ?> <?php wp_pagenavi(); // Use PageNavi ?> <?php } else { // Otherwise, use traditional Navigation ?> <div class="nav-previous"> <!-- next_post_link --> </div> <div class="nav-next"> <!-- previous_post_link --> </div> <?php } // End if-else statement ?>
<?php else : ?>
<h1><?php _e('Search again!'); ?></h1>
<p><img src="http://www.mysite.com/images/logo.jpg" width="60" height="57" alt=""><?php _e('No posts matched your criteria. Please try another term, or select a menu item to continue browsing.'); ?></p>
<?php endif; ?>
Here goes, I guess this should work:
<?php
if (function_exists('sociable_html') && !$sociable_displayed) {
echo sociable_html(Array("Digg", "del.icio.us", "StumbleUpon", "NewsVine", "Technorati", "Google", "YahooBuzz", "Reddit", "Facebook", "SphereIt", "Propellor", "TailRank", "email"));
$sociable_displayed = true;
} ?>
Where you’d have to add this:
<?php $sociable_displayed=false; ?>
Outside of and before the loop.
With your additional script, Sociable does appear in the first entry only. Looks great on the front page.
But it continues to follow that pattern as you page through the entries (http://www.mysite.com/page/2/
).
I do appreciate the extra effort, but for consistency’s sake, I’ll stay with the original script.
Thanks, joost!
you could just add another parameter to the above if query:
if (!$paged &&function_exists('sociable_html') && !$sociable_displayed) {