Support » Fixing WordPress » PHP question: sneaking variable into line of code

  • I wonder if one of you guys could take a look at line of code:

    <?php get_a_post(XXXblog); ?>

    Obviously, right now this line of code will grab the WordPress post named ‘XXXblog’.
    But what I’d like to do is replace XXX with the title of the current Page, and have the code pull up ‘post1blog’, ‘post2blog’ and so on.

    I know that to call the title of the page you use the code:
    <?php echo (wp_title("",false));?>

    But how can I sneak that into the first bit of code?

    Many thanks!
    Ian

Viewing 1 replies (of 1 total)
  • whooami

    (@whooami)

    Member

    <?php get_a_post(XXXblog); ?>

    Obviously, right now this line of code will grab the WordPress post named ‘XXXblog’.

    That’s not a function I’ve found in WordPress 2.2 — and googling it tells me its out of one of kaf’s plugins.

    You might want to ask on his own site 🙂 and/or read the comments:

    http://guff.szub.net/2005/01/27/get-a-post/

Viewing 1 replies (of 1 total)
  • The topic ‘PHP question: sneaking variable into line of code’ is closed to new replies.