View Single Post
Old 08-14-2009, 01:38 PM  
harvey
Confirmed User
 
harvey's Avatar
 
Industry Role:
Join Date: Jul 2001
Location: 127.0.0.1
Posts: 9,266
Quote:
Originally Posted by Angry Jew Cat View Post
huh? i'm lost on that one...


what i need is to be able to include a specific piece of html for eachpost into the design, outside of the loop. like in my sidebar.

could i say, drop it into the excerpt. and in my single.php drop the_excerpt tags outside of the loop? does that work? can i create a second loop in single.php to show my extra html as the excerpt? would that work?

i want to include a little review in my sidebar for the site related to each post i make.

pffft, I thought you already had the content, hence the xml thing. If you still need to write it just do this: in your sidebar, include the following code

Code:
<div id="some-name"><?php echo get_post_meta($post->ID, "myreview", $single = true); ?></div>
And in your posts add a custom field called myreview with the text you want. And that's it, your problem solved in 2 easy steps (I recommend you to add a text field area for that custom code so it's easy to see what you write, you can edit functions.php or grab one of several existing plugins to do it).

PS: since you will want this only in single.php pages, be sure to either call a sidebar2.php (with the same content as sidebar.php PLUS the review) or call the review outside the sidebar code and adjust the placement of the div. I recommend you the first approach. Of course you can load the sidebar.php with conditionals (if single.php load something) but it seems to me you'll have more trouble this way
__________________
This post is endorsed by CIA, KGB, MI6, the Mafia, Illuminati, Kim Jong Il, Worldwide Ninjas Association, Klingon Empire and lolcats. Don't mess around with it, just accept it and embrace the truth
harvey is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote