How Do I Add Text To Bottom Of Posts (11 posts)

  1. Synergy10
    Posted 9 years ago #

    I want to add text with a link to the bottom of every other post on my blog.

    I don't want to add the text manually. I want it to be added automatically when I make my posts.


    post 1

    text link here

    post 2

    post 3

    text link here

    post 4


    The link would say something like:

    "Click Here For More Information"

    How can I do this?


  2. moshu
    Posted 9 years ago #

    And where would that link go to?

  3. Synergy10
    Posted 9 years ago #


    It would be a link outside of the WordPress directory, on the main root of the Website.

    ie http://www.mysite.com/link.html

  4. moshu
    Posted 9 years ago #

    [don't use "mysite" for examples: that's living site. Always use example.com!]

    BAck to the question: it would always be the same link? For every post? Or different for every post? If the latter - then you have to do it manually, there is no other way.

  5. Synergy10
    Posted 9 years ago #

    The link will always go to the same page.

  6. moshu
    Posted 9 years ago #

    Then put in in the index.php file of your theme (or in whichever file you want it to be displayed).
    Put it inside the Loop, somewhere after the_content tag.

  7. Synergy10
    Posted 9 years ago #

    Can you please show me an example of how it should be coded?


  8. moshu
    Posted 9 years ago #

    Exactly as in any normal html file. You just use the anchor tag (<a href...)
    If you want to be a webmaster you have to learn html basics:

  9. Synergy10
    Posted 9 years ago #

    I already know how to do html. I asked how to code it in the php file WITHOUT causing a loop problem.

    I'd rather get someone else's help than deal with your constant lecturing.

  10. jabecker
    Posted 9 years ago #

    maybe add a counter to the loop, and if the counter is an odd number display your link.

  11. whooami
    Posted 9 years ago #

    He answered your question.

    You put it in the theme file the same way you would if you put it in any other file. If you can create a link inside a plain old regular HTML page, you can create a link inside a theme file.

    What more do you need -- a link is a link is a link.

    I love <a href="http:///www.cookies.com">cookies</a>

    Depending on were you want to display your link and on what pages, you need to add your link(s) to your theme file, inside the loop.

    About the loop:

    Crack open your theme files, and take a look. If you have your website open in a browser window,and a theme file open in the other window, it tends to be pretty easy figuring out what causes what..

    <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
    or something similar, displays all the posts titles,and permalink.

    <small><?php the_time('F jS, Y'); ?></small>
    That or something similar is going to show the time of the post.

    <?php the_content(); ?>

    thats the content of your post.

    If you want to put your link after your content, thats what you are looking for. And yes you will need to use the typical method of counting posts to do exactly what you want.

    There are hundreds of threads already here on how to count posts for the purposes of adding, for example, google adsense or whatever.


Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.