Support » Fixing WordPress » auto add a text to a post

  • Resolved mxmx

    (@mxmx)


    Hi,

    I am looking for a plugin or piece of code that can add a piece of text to every post on my blog automatically. The text needs to include the title of the post, so here’s an example of what I am looking for.

    Thanks for reading <post title>. see you again.

    The plugin needs to do this automatically for every single post I submit. I don’t wanna do it manually.

    Thanks for your help and time.

    Regards

Viewing 2 replies - 1 through 2 (of 2 total)
  • With the help of the Template Hierarchy article, determine what Template is displaying your posts (could be index.php, single.php, archives.php). Then add that text to the code displaying your title.

    With the WordPress Default theme, ONE of the files you would change would be wp-content/themes/default/index.php. You would change:

    <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>

    to this:

    <h2>Thanks for reading <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a>. See you again.</h2>

    You will probably need to do that in several template files.

    Thread Starter mxmx

    (@mxmx)

    Thanks!

    It worked!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘auto add a text to a post’ is closed to new replies.