WordPress.org

Support

Support » Themes and Templates » title() inside post area

title() inside post area

  • Hi,

    I’m looking for someone who could could help me out…
    I’ve recently started a new blog about music reviews and stuff, and I’m looking for a way to have the posts modified a little.

    I’m looking for a way how to insert something like:

    a href=”google.com/q=<title>”>search <title> on google

    (cant’ format properly because forums edit it, i assume you understand what i mean)

    at end of every post.

    I looked into my theme but it doesn’t seem like I’m able to do it trough there..I would appreciated any help if possible…

    sorry for my bad English!

Viewing 3 replies - 1 through 3 (of 3 total)
  • <?php if(is_single()): ?>
    <a href="http://www.google.com/q=<?php the_title(); ?>">text</a>
    <?php elseif: ?>
    <?php endif; ?>

    Or you can add this to every post manually:

    <a href="http://www.google.com/q=<?php the_title(); ?>">text</a>

    Remember, you’ll have to install a plugin which executes php in posts if you want to do it manually, or u can also make use of custom fields and check if the field matches, then display the text or whatever you want.

    Hi,

    thanks for rapid quick reply, but could you please tell me where exactly I should put the first code you provided?

    Thanks a lot!

    in single.php

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘title() inside post area’ is closed to new replies.