I need help! common php question regarding wordpress titles and categories

Discussion in 'WordPress' started by stuuntn, Feb 21, 2010.

  1. #1
    I'll explain this the best way I can. I just hope it comes out right. Maybe someone has seen this problem before and can help.

    Here is what I trying to do. I want to post a piece of text on every single post on my site (im using an advertising plugin to do this above every post). but i need some type of php code (i think) in order get the results im after.

    here is my example:
    "You are reading [page title] on mywebsite.com, [page title] is part of [postcategory]"

    does anyone know if there is a code that would replace [page title] with the post's title? that probably doesn't make sense.

    so for example if the page's title is "I love Dr. Pepper" i type in something like this: you're reading [post title code].
    but when someone visits the post they will see "you're reading i love dr. pepper"

    im looking for a code for the page title and also the post category. if you know how to do this or could even point me in the right direction please helpp! thanks in advance
     
    stuuntn, Feb 21, 2010 IP
  2. broxen

    broxen Peon

    Messages:
    60
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    here's the code, for compete code please refer to wordpress codex
    pagetitle=
    <?php the_title(); ?>
    PHP:
    category=
    <?php the_category(', ') ?>.
    PHP:
     
    broxen, Feb 21, 2010 IP
  3. stuuntn

    stuuntn Member

    Messages:
    179
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    30
    #3
    didn't seem to work. ill continue searching
     
    stuuntn, Feb 21, 2010 IP