WordPress.org

Ready to get started?Download WordPress

Forums

Sociable WP Category archive (3 posts)

  1. jtovar
    Member
    Posted 4 years ago #

    I've installed the Sociable plugin on my http://statickadesign.jefftovar.com WP blog and find it to be the best of its kind. There is an issue I would like some help with, however.

    On the WP Admin page, I have set the plugin's Position field to "Individual blog posts" only. Then, on each of my Category archives, I have placed the following code where I want Sociable to appear:

    <?php if (function_exists('sociable_html')) {
        		echo sociable_html();
    			} ?>

    My reasoning for this is that when I had the plugin Position also set to "Category archives," it would place Sociable under each entry. This was obviously cluttered and not how I wanted it to act so I removed it. You can see an example of these pages here:

    http://statickadesign.jefftovar.com/category/websites/wordpress-blog-customization/

    The plugin is working on the Category pages, but it's linking to the latest post instead of the archive appears on. Is there a way I can correct this without affecting the link it displays on each individual blog post?

    Thanks for your help,
    Jeff Tovar

  2. jtovar
    Member
    Posted 4 years ago #

    Anyone?

  3. nosferatuscoffin
    Member
    Posted 4 years ago #

    It looks like you have set the Sociable code outside of the loop in your category.php or page.php file.

    So when it is called, it is by default going to the latest post.

    It needs to be called within the loop of your category file in order for it to pick up each story properly.

    Something like this:

    <!-- loop -->
    
    <?php if (have_posts()) :?>
    <?php $postCount=0; ?>
    <?php while (have_posts()) : the_post();?>
    
    --Your story content code goes here--
    
    <?php if (function_exists('sociable_html')) {echo sociable_html(); } ?>

    Reverse the last two lines if you want the Sociable links to appear above the story content.

Topic Closed

This topic has been closed to new replies.

About this Topic