Support » Fixing WordPress » How Do I Add Text To Bottom Of Posts

  • 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.

    Ie:

    —————————
    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?

    thx

Viewing 10 replies - 1 through 10 (of 10 total)
  • And where would that link go to?

    Moshu,

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

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

    [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.

    The link will always go to the same page.

    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.

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

    Thx

    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:
    http://www.w3schools.com/html/default.asp
    links:
    http://www.w3schools.com/html/html_links.asp

    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.

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

    whooami

    (@whooami)

    Member

    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:
    http://codex.wordpress.org/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.

    search.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘How Do I Add Text To Bottom Of Posts’ is closed to new replies.