Support » Plugins » Moose Candy Troubles

  • Hey all – I’ve searched here and everywhere, but cannot figure this moose out.

    First of all, the moose candy plugin download needs serious updating. It seems to have been missing the opening php tag (<?php) among other things that rendered it unusable. So, I did my best by looking at solif plugins and this is what I constructed:

    Plugin Name: Moose Candy
    Version: 0.3
    Plugin URI: http://
    Description: This plugin puts stuff between posts.
    Author: Jason Goldsmith
    Author URI:

    $candy[2] = ‘<script type=”text/javascript”><!–
    google_ad_client = “pub-removed”;
    google_ad_width = 468;
    google_ad_height = 60;
    google_ad_format = “468x60_as”;
    google_ad_channel =”18742957876″;
    google_ad_type = “text”;
    google_color_border = “FFFFFF”;
    google_color_bg = “FFFFFF”;
    google_color_link = “663300”;
    google_color_url = “663300”;
    google_color_text = “000000”;
    <script type=”text/javascript”

    $dropping = 1; function moosecandy($text) { global $dropping, $candy; if (isset($candy[$dropping])) { $the_date = “
    “; $the_date .= $candy[$dropping]; $the_date .= ‘
    ‘; $dropping++; $text = $the_date . “\n” . $text; } else { $dropping++;} return $text; } add_filter(‘the_date’, ‘moosecandy’); ?>

    Now, I’m trying to put adsense ads between my first and second posts but it isn’t working right for some reason. The ads are showing but in strange places (like halfway behind my post’s posted by, category, time, date, and edit info. links.

    How or what do I have to do to get the ads between the first and second posts?

    I’m running WP 1.2 with Azevedo’s Gollum template. Here’s my loop:

    <div id=”maincontent”>
    <?php if ($posts) : foreach ($posts as $post) : start_wp(); ?>

    <p class=”storytitle” id=”post-<?php the_ID(); ?>”>” rel=”bookmark” title=”Permanent Link: <?php the_title(); ?>”><?php the_title(); ?>

    <div class=”post”>
    <?php the_content(); ?>

    <div class=”postoptions”><img src=”themes/gollum/arrow-left-comments.gif” width=”21″ height=”16″ alt=””/><img src=”themes/gollum/time.gif” alt=”Time”/> Posted By: “>
    <?php the_author(); ?>
    @ <?php the_date();?> <?php the_category(‘,’) ?> <?php comments_popup_link(__(‘<img src=”themes/gollum/comment.gif” alt=””/> Comment’), __(‘<img src=”themes/gollum/comment.gif” alt=””/> Comment’), __(‘<img src=”themes/gollum/comment.gif” alt=””/> Comment (%)’)); ?> <?php edit_post_link(); ?>/wp-print.php?p=<?=the_ID()?>”>Print</div>

    <?php wp_link_pages(); ?>

    <?php trackback_rdf(); ?>

    <?php include(ABSPATH . ‘wp-comments.php’); ?>

    <?php endforeach; else: ?>
    <?php author(true, 5); ?>
    <?php endif; ?>

    <?php if ($single) { ?>

      <b>Related Articles:</b> <?php related_posts(); ?>

    <?php } ?>

Viewing 12 replies - 1 through 12 (of 12 total)
  • Anyone?

    I don’t rate your chances, sorry. The plugin author seems not to be around anymore. Have you tried looking for alternative plugins with the same functionality?

    Put <?php moosecandy(“blah”);?> after <b>Related Articles:</b> <?php related_posts(); ?>

    Try Moose Candy 1.2.0 at it actually works. 🙂

    Oh, and you should definitely not have a call to moosecandy() in the loop. Very strange things will happen which won’t be what you want.

    If he posts it out side the loop it will only occur at the bottom of his posts

    Nope, nothing seems to be working. The Moose Candy I’m using is 1.2.0. The download, as is, doesn’t even load into the plugins correctly (wp-content/plugins).

    Are there other alternatives for inlcuding google adsense? I’ve searched these forums and google but haven’t found anything that actually works.

    Since you haven’t really stated WHAT the problem is, I don’t think too many people (not even NuclearMoose!) will be able to help. Aside from that, you probably have extra spaces or blank lines after the ?> at the end of the file. Take those out.

    Or just put it directly into index.php. The catch is it will appear above the first post (and on every page). Mine looks like:

    <div class="googlesyndication"><p><script type="text/javascript"><!--
    google_ad_client = "pub-000000000000000";
    google_alternate_ad_url = "";
    google_ad_width = 468;
    google_ad_height = 60;
    google_ad_format = "468x60_as";
    google_ad_channel ="";
    google_page_url = document.location;
    google_color_border = "FFFFFF";
    google_color_bg = "FFFFFF";
    google_color_link = "000099";
    google_color_url = "006600";
    google_color_text = "000000";
    <script type="text/javascript"

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?> (this last line is the start of the loop)

    If you really want it to be between the first and second posts, it’ll have to be Moose Candy.

    Thanks people for all your help…I think I have it.

    Hi everyone. I have gotten Moosecandy to work fine to display text (thanks Jason), but what I really need it to do is include a file at that spot. Can someone provide a sample of what would go here:

    $candy[2] = ‘file include reference’;

    Thanks much. All assistance greatly appreciated.

    Just so everyone knows, Jason Goldsmith created this plugin after he and I had a chat about some stuff I was looking for. He named it “Moose Candy” for fun. I did not have anything to do with the code, only part of the concept. As I’ve said before, I can only spell PHP. 🙂

    If this now works for WP 1.5, I’d sure appreciate someone posting the necessary changes so that others can use it if they so wish.

    heloo everybody
    does someone know if plugin works with 1.5 ??

    any other stuff that works equaly to this stuff for WP1.5 ?

    I discussed how to do this type of thing yourself in your index.php:


Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Moose Candy Troubles’ is closed to new replies.