WordPress.org

Support

Support » Plugins and Hacks » Yet Another Related Posts Plugin (YARPP) » [Resolved] [Plugin: Yet Another Related Posts Plugin] How to Put Ads Between Text and List

[Resolved] [Plugin: Yet Another Related Posts Plugin] How to Put Ads Between Text and List

Viewing 3 replies - 1 through 3 (of 3 total)
  • You can turn off the automatic placement of the related posts and then call the function in your theme directly

    <?php if (function_exists('related_posts') ) : related_posts(); endif; ?>

    Thank you. When I do that, though, my entire page disappears, so I’m not sure where to put the code. I think the problem is that I’m trying to put a conditional within an array. Here’s my content-single.php currently:

    <?php
    	global $post;
    	theme_post_wrapper(
    		array(
    				'id' => theme_get_post_id(),
    				'class' => theme_get_post_class(),
    				'title' => theme_get_meta_option($post->ID, 'theme_show_post_title') ? get_the_title() : '',
    				'before' => theme_get_metadata_icons('date,author,edit', 'header'),
    				'content' => '<!-- AddThis Button BEGIN -->
    <div class="addthis_toolbox addthis_default_style "><br>
    <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_counter addthis_pill_style"></a>
    </div>
    <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=*****"></script>
    <!-- AddThis Button END -->
    <hr>
    <div style="text-align:left; float:left; margin:5px 10px 10px 0"><script type="text/javascript"><!--
    google_ad_client = "*****";
    /* 300 x 280 */
    google_ad_slot = "*****";
    google_ad_width = 300;
    google_ad_height = 250;
    //-->
    </script>
    <script type="text/javascript"
    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script></div>'. theme_get_content(),
    				'after' => '<hr><br><center><script type="text/javascript"><!--
    google_ad_client = "*****";
    /* 468x60 */
    google_ad_slot = "*****;
    google_ad_width = 468;
    google_ad_height = 60;
    //-->
    </script>
    <script type="text/javascript"
    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script></center>'. theme_get_metadata_icons('', 'footer')
    		)
    	);
    ?>

    Where should I put that code, please?

    Put it just before the ?>
    You don’t need the <?php prefix as you already have one of those at the top.

    So the last 3 lines would be

    )
    	);
    if (function_exists('related_posts') ) : related_posts(); endif; ?>
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] [Plugin: Yet Another Related Posts Plugin] How to Put Ads Between Text and List’ is closed to new replies.
Skip to toolbar