Smarty Plugins Working in WP!

Yay! I got the “relatedstories” plugin working! The hardest bit was converting to use $wpdb instead of the PHP MySQL interface. I love that I could call get_permalink in post.html to figure out the story link:

{relatedstories}
{if $relatedstories}
  <b>Related Stories</b> ({$relatedstoriesWords})
  <ul>
  {foreach from=$relatedstories key=key item=story}
    <li> <a href="{get_permalink id=$story->ID}" >{$story->post_title}</a></li>
  {/foreach}
  </ul>
{/if}


You might also like

If you like this post then please subscribe to my full RSS feed. You can also click here to subscribe by email. There are also my fabulous photos to explore too!

Published by

Donncha

Donncha Ó Caoimh is a software developer at Automattic and WordPress plugin developer. He posts photos at In Photos and can also be found on Google+ and Twitter.

One thought on “Smarty Plugins Working in WP!”

Leave a Reply