WordPress.org

Ready to get started?Download WordPress

Forums

PHP question: sneaking variable into line of code (2 posts)

  1. ianharris
    Member
    Posted 7 years ago #

    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

  2. whooami
    Member
    Posted 7 years ago #

    <?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/

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags