WordPress.org

Ready to get started?Download WordPress

Forums

where do I upload custom signature so it appears on posts (9 posts)

  1. jthomson3rd
    Member
    Posted 2 years ago #

    I have a question about to what folder on my server do I upload my custom png signature that will appear after each post, using s process like this:

    <?php the_content(); ?>
    <?php if (is_single())
    {
    echo '<div class="signature">
    <img src="" alt="signature" />
    </div>';
    } ?>

    then the pathe would be ig src="mysite.com/theFOLDER/signature.png"
    yes?

  2. Digest WP
    Member
    Posted 2 years ago #

    Hey,

    Do something like this for the Src

    <?php bloginfo('template_directory'); ?>/images/yourimage.png" title="" alt="" />

    That will call to the images folder in your theme.

    The full URL would be

    <img src="yourblog/wp-contents/themes/yourtheme/images/yourimage.png" title="" alt="">
  3. jthomson3rd
    Member
    Posted 2 years ago #

    a bit confused of what u suggested replaces exactly

    <?php the_content(); ?>
    <?php if (is_single())
    {
    echo '<div class="signature">
    <?php bloginfo('template_directory'); ?>yourblog/wp-contents/themes/yourtheme/images/yourimage.png" title="" alt="" />
    </div>';
    } ?>

    that what u meant?

  4. Digest WP
    Member
    Posted 2 years ago #

    <?php the_content(); ?>
    <?php if (is_single())
    {
    echo '<div class="signature">
    <img src="<?php bloginfo('template_directory'); ?>images/yourimage.png" title="" alt="" />" alt="signature" />
    </div>';
    } ?>
  5. jthomson3rd
    Member
    Posted 2 years ago #

    you're awesome

  6. jthomson3rd
    Member
    Posted 2 years ago #

    it doesn't seem to work. perhaps cuz there isn't an exact <?php the_content(); ?> in either the index or single.php

    regardless therebis alspo the add a function method

    function post_signature($sign) {
    global $post;
    if($post->post_type == 'post') $sign .= '<div class="signature">
    <img src="" alt="signature" />
    </div>';
    return $sign;
    }
    add_filter('the_content','post_signature');

  7. jthomson3rd
    Member
    Posted 2 years ago #

    function post_signature($sign) {
    global $post;
    if($post->post_type == 'post') $sign .= '<div class="signature">
    <img src="<?php bloginfo('template_directory'); ?>images/sig.png" title="" alt="" />" alt="signature" />
    </div>';
    return $sign;
    }
    add_filter('the_content','post_signature');

  8. jthomson3rd
    Member
    Posted 2 years ago #

    i wonder where on the functions.php to add the code

  9. jthomson3rd
    Member
    Posted 2 years ago #

    haha i screwed up the blog
    OOPS

Topic Closed

This topic has been closed to new replies.

About this Topic