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}

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