WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How do I add a signature to (ALL) blog posts? (5 posts)

  1. bs9902
    Member
    Posted 3 years ago #

    I want to be able to add a signature to the end of all of my blog posts but NOT doing it manually. I would like it to just automatically show up below the post. What code and where do I put this? Please leave detailed instructions. Thanks!

  2. bs9902
    Member
    Posted 3 years ago #

    Oh, sorry... my blog is http://brandisutherlin.com

  3. bs9902
    Member
    Posted 3 years ago #

    can anyone help with this?

  4. chinmoy
    Member
    Posted 3 years ago #

  5. alchymyth
    Forum Moderator
    Posted 3 years ago #

    where exactly do you want the signature?

    - after the content?

    try to add a filter to functions.php of your theme; something like:

    add_filter('the_content','add_signature');
    function add_signature($text) {
    global $post;
    if($post->post_type == 'post') $text .= '<div class="signature">my signature text; could be a html image tag as well</div>';
    return $text;
    }

    - after the line 'posted in:... '?

    you would need to edit index.php and single.php (and the other template files where you want to have the signature; http://codex.wordpress.org/Template_Hierarchy )

    find the line with 'endwhile;' of the loop;
    add the signature code, for instance <div class="signature">my signature text; could be a html image tag as well</div>, just before this line.

    always make a backup copy of your theme files before editing

    http://codex.wordpress.org/The_Loop_in_Action
    http://codex.wordpress.org/The_Loop

    you can add formatting for the signature into style.css, for instance using the example code:
    .signature { ... }

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags