Adding Static Box And Text At Bottom Of Posts

5 replies
I'm trying to add a static box and text at the bottom of all my wordpress posts. I want it to be under all the post and widgets but above the comments box.

I'm trying to do this in the single.php file but am having a very hard time getting it to work. Whenever I add text, links or images in this php file...all code below it goes away.

As you can see, I got the box to show up using a <div class="optinbox"> </div> but I can't get a small arrow image or text to show up inside the box.

Here is an example of what it looks like so far.

Beginner Workout Routine For Kids

So how can I get text and an image in that box without messing up the rest of the code?

It will be the following text plus a red arrow image.....

Get 52 free kids exercise activities to boost your kids energy so you know for sure they're getting exercise -- <a href="http://www.myfamilyexercise.com/kids-exercise-newsletter">click here</a>
#adding #bottom #box #posts #static #text
  • Profile picture of the author Istvan Horvath
    <div class="optinbox">
    Get 52 free kids exercise activities to boost your kids energy so you know for sure they're getting exercise -
    <a href="http://www.myfamilyexercise.com/kids-exercise-newsletter">click here</a>
    </div>

    You mean the code above wouldn't work? I replaced your non-web long dash...
    Signature

    {{ DiscussionBoard.errors[3687897].message }}
    • Profile picture of the author vajoma
      You can try the "Add Post Footer" plugin. Search for it on the wordpress plugin site.
      {{ DiscussionBoard.errors[3688203].message }}
    • Profile picture of the author wiseworks
      Originally Posted by Istvan Horvath View Post

      <div class="optinbox">
      Get 52 free kids exercise activities to boost your kids energy so you know for sure they're getting exercise -
      <a href="http://www.myfamilyexercise.com/kids-exercise-newsletter">click here</a>
      </div>

      You mean the code above wouldn't work? I replaced your non-web long dash...
      I tried the plugins but they don't work right. They add the code right after the post and I want it after the social plugins and right before the comments box. They also add a sponsored link.

      Yes, the above code wouldn't work for me. When I add that code on my single.php page the following code goes away.

      <!--include comments template-->
      <?php comments_template(); ?>

      <!--do not delete-->
      <?php endwhile; else: ?>

      Sorry, no posts matched your criteria.

      <!--do not delete-->
      <?php endif; ?>

      <!--single.php end-->
      </div>


      <!--include footer-->
      <?php get_footer(); ?>

      -------------------------------------------------------
      If this was html here's the code I want to use.

      <table style="border: 3px solid #CC0000;" border="0" cellspacing="0" cellpadding="10" width="500">
      <tr>
      <td style="padding-top:15px;"><a href="http://www.myfamilyexercise.com/kids-exercise-newsletter"><img src="http://www.myfamilyexercise.com/wp-content/uploads/2011/04/red-arrow-1.gif" style="margin: -4px 10px 5px 0px;" border="0" alt="Free Kids Exercise Report" align="left"></a>
      Get 52 free kids exercise activities to boost your kids energy so you know for sure they're getting exercise -- <a href="http://www.myfamilyexercise.com/kids-exercise-newsletter">click here</a>.</td>
      </tr>
      </table>
      {{ DiscussionBoard.errors[3688412].message }}
      • Profile picture of the author Istvan Horvath
        Originally Posted by wiseworks View Post

        Yes, the above code wouldn't work for me. When I add that code on my single.php page the following code goes away.
        Honestly, I don't believe it.
        Looking at the source code of your page (at the link you posted above) - the DIV thingy already is THERE in your code... it's just empty... AND the code below is also there and working. I can tell you because I know what that code does and I see its result on your page!

        <
        HTML Code:
        !--include comments template-->
            <?php comments_template(); ?>
            
                <!--do not delete-->
            <?php endwhile; else: ?>
            
            Sorry, no posts matched your criteria.
        
        <!--do not delete-->
        <?php endif; ?>
            
        <!--single.php end-->
        </div>
        
        
        <!--include footer-->
        <?php get_footer(); ?>
        -------------------------------------------------------
        Originally Posted by wiseworks View Post

        If this was html here's the code I want to use.

        <table style="border: 3px solid #CC0000;" border="0" cellspacing="0" cellpadding="10" width="500">
        <tr>
        <td style="padding-top:15px;"><a href="http://www.myfamilyexercise.com/kids-exercise-newsletter"><img src="http://www.myfamilyexercise.com/wp-content/uploads/2011/04/red-arrow-1.gif" style="margin: -4px 10px 5px 0px;" border="0" alt="Free Kids Exercise Report" align="left"></a>
        Get 52 free kids exercise activities to boost your kids energy so you know for sure they're getting exercise -- <a href="http://www.myfamilyexercise.com/kids-exercise-newsletter">click here</a>.</td>
        </tr>
        </table>
        1. All the template files ARE html (+PHP).
        HTML is "responsible" for the visible part of it, i.e. what the browser shows you (adding the style from the stylesheet) and the PHP portions just add the functionality to interact with the WP engine and with the database.

        2. You don't need the table because you already have a "div" with reddish border. Did you really try to use the code I gave you in your template file?
        Signature

        {{ DiscussionBoard.errors[3688568].message }}
    • Profile picture of the author wiseworks
      Originally Posted by Istvan Horvath View Post

      <div class="optinbox">
      Get 52 free kids exercise activities to boost your kids energy so you know for sure they're getting exercise -
      <a href="http://www.myfamilyexercise.com/kids-exercise-newsletter">click here</a>
      </div>

      You mean the code above wouldn't work? I replaced your non-web long dash...
      I went back and bingo! You were right! The longer dash was messing the code up. Your shorter dash was the fix. Thank you!
      {{ DiscussionBoard.errors[3688623].message }}

Trending Topics