WordPress.org

Ready to get started?Download WordPress

Forums

Related Posts by Zemanta
[resolved] Plugin Loading Location (4 posts)

  1. cartar929
    Member
    Posted 1 year ago #

    I currently have this plugin loading after my posts and it is working fine. However, I would like to be able to change the order in which the plugin is shown.

    Because right now it is loading as:

    1. post-content
    2. social sharing toolkit
    3. related posts
    4. ccta-below the post
    5. comments
    6. sidebar

    I am trying to get the order to be:

    1. post-content
    2. social sharing toolkit
    3. ccta-below the post
    4. related posts
    5. comments
    6. sidebar

    Here is a link to post where I am talking about: http://junto.franklinstreetwebserver.com/aco-resources/marketing-acos-and-medical-homes.

    Here is how my single.php file is currently setup:

    <?php get_header(); ?>
    
    	<div id="content">
    	<?php if (have_posts()) : ?>
    
    		<?php while (have_posts()) : the_post(); ?>
    
    		<div class="post">
    			<h1><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h1>
    			<div class="post-details"><small><b>Posted:</b> <?php the_time('F jS, Y') ?> | <b>Author:</b> <?php the_author_posts_link(); ?> </small></div>
    			<div class="post-content"><?php the_content('Read the rest of this entry &raquo;'); ?>
                <div class="ccta-widget">
    			<?php if ( !function_exists('dynamic_sidebar')
            	|| !dynamic_sidebar('Contextual Call To Action') ) : ?>
    			<?php endif; ?>
        		</div>
                </div>
                <hr/>
            </div>
    
    		<?php comments_template(); ?>
    
    		<?php endwhile; ?>
    
    		<div class="navigation">
    			<div class="old-posts"><?php next_posts_link('Older Entries &raquo;') ?></div>
    			<div class="new-posts"><?php previous_posts_link('&laquo; Newer Entries') ?></div>
    		</div>
    
    	<?php else : ?>
    
    		<h2 class="center">Not Found</h2>
    		<p class="center">Sorry, but you are looking for something that isn't here.</p>
    
    	<?php endif; ?>
    
    	</div>
    
    <?php get_sidebar(); ?>
    
    <?php get_footer(); ?>

    I have currently tried loading the Contextual Call To Action widget in numerous locations in this template. But, I can only seem to get it to go before the Social Sharing Toolkit and Related Posts or after it. I can not seem to get the order to be Social Sharing Toolkit, Contextual Call to Action, and then Related Posts.

    Does anyone know of a way that I can order these plugins accordingly or know of a different way I need to set my template up?

    Thanks in advance,
    Carter

    http://wordpress.org/extend/plugins/related-posts-by-zemanta/

  2. jureham
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Carter,

    you can add related posts to the template if you disable "Auto Insert Related Posts" in Zemanta settings.

    Something like this should work for what you're trying to do:

    <div class="post-content">
      <?php the_content('Read the rest of this entry &raquo;'); ?>
      <div class="ccta-widget">
        <?php if ( !function_exists('dynamic_sidebar')
          || !dynamic_sidebar('Contextual Call To Action') ) : ?>
        <?php endif; ?>
      </div>
      <?php zemanta_related_posts(); ?>

    or you can move <?php zemanta_related_posts(); ?> directly above <?php comments_template(); ?>.

    Best, Jure

  3. cartar929
    Member
    Posted 1 year ago #

    Jure,
    You are awesome thanks so much for that. I just had to make one small change on what you gave me to get that to behave correctly.

    This is what I used to get it to work:

    <div class="post-content">
    <?php the_content('Read the rest of this entry &raquo;'); ?>
    <div class="ccta-widget">
    <?php if ( !function_exists('dynamic_sidebar')
    || !dynamic_sidebar('Contextual Call To Action') ) : ?>
    <?php endif; ?>
    </div>
    <?php wp_related_posts(); ?>
    </div>
  4. jureham
    Member
    Plugin Author

    Posted 1 year ago #

    Thank you for using the plugin,
    I'll mark the topic as resolved.

Topic Closed

This topic has been closed to new replies.