Tips on Webhosting, Blogging, Web Design, Webmastering, SEO, CSS, and whatever the damn hell I know.
This is regarding where to place the < ?php wp23_related_posts(); ?> code. I downloaded WP 2.3 Related Posts plugin by Denis, PaoPao.
This plugin is only available for WordPress 2.3 beta 1.
I’m quite a PHP dummy myself, so I’m always fiddling around with this and that and going “oops” 101 times before finally getting anywhere.
1. Activate Plugin
Once you’ve downloaded and activated the plugin (under the Plugins tab in your WordPress admin panel), you’ll have to add
< ?php wp23_related_posts(); ?>
to the template. This makes the related posts show up.
2. Where to Place Code
In my case, I added it to the Index template (the “main” template — the index.php file), and the Single Post template (for individual posts).
Get to the files by going into Presentation » Theme Editor. Please remember to store the original files somewhere ^^.

Go to the index.php file. This is your main template.
Then, look for < ?php the_content; ?>. It is under <div class=”PostContent”>, in the current theme I’m using.
On index.php file:

On single.php file:

3. Configure
One more step (optional).
The plugin allows you to make some specifications. I set mine to a max of 5 related posts, and to show random posts if there are no related posts at the moment.
Go to Options » WP23 Related Posts.

That’s it.
* Thanks to Hani, or I’d have sat on this for longer :P.
6 Responses for "WordPress Related Posts Plugin, Where to Place Code"
But I’m using wordpress 2.2. So how?
hmm, you could try this version.
or d/l the newer wp? :D
Can liao!!! Thx!!! Muackz!
I tried it on my site but it made my template all funky.. so i took it off.. thanks for your help tho..
hello, oh dear — but yeah, that sometimes happens to my templates too. then it’s guesswork til it works, lol. sometimes it could be due to the theme’s design.
if you get a new theme, you can try again then ^^.
// continuing from above…
sorry, i forgot to mention this earlier.
the
< ?php wp23_related_posts(); ?>code has to be within the<div class="">and</div>elements.mine is
<div class="PostContent">— it can vary slightly with different themes.that took me 3 hrs + to figure out with another plugin on another site, urgh. it *did* make the template all wonky :P
Leave a reply
Some HTML is allowed: ‹b›, ‹i›, ‹a›.