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?
- The topic ‘PHP question: sneaking variable into line of code’ is closed to new replies.