title: How to display associated WordPress category's posts on Magento product page (Fishpig integration)?
body: <p>I'm having trouble filtering out just the associated category posts associated with a product in the posts.phtml block (using Fishpig).  I tried to use the following solution to get the posts:</p>
  
  <p><a href="https://stackoverflow.com/questions/11774330/fishpig-wordpress-magento-post-issue">Fishpig Wordpress Magento Post issue</a></p>
  
  <p>like so:  </p>
  
  <pre><code>$categoryId = Mage::registry('wordpress_category')-&gt;getId();
  $recentPostCollection = Mage::getModel('wordpress/post')-&gt;getCollection()
      -&gt;addIsPublishedFilter()
      -&gt;addCategoryIdFilter($categoryId)
      -&gt;setOrder('post_date', 'desc')
      -&gt;setPageSize($numPostsToShow)
  ;
  </code></pre>
  
  <p>Then modifying the original Related Posts block:</p>
  
  <pre><code>&lt;?php //$posts = $this-&gt;getPosts() ?&gt;
  &lt;?php $posts = $recentPostCollection; ?&gt;
  &lt;?php if (count($posts) &gt; 0): ?&gt;
      &lt;div class="block block-blog block-recent-posts"&gt;
          &lt;?php if ($title = $this-&gt;getTitle()): ?&gt;
              &lt;div class="block-title"&gt;
                  &lt;strong&gt;&lt;span&gt;&lt;?php echo $this-&gt;__($title) ?&gt;&lt;/span&gt;&lt;/strong&gt;
              &lt;/div&gt;
          &lt;?php endif; ?&gt;
          &lt;div class="block-content"&gt;
              &lt;ul id="&lt;?php echo $this-&gt;getListId() ?&gt;"&gt;
                  &lt;?php foreach($posts as $post): ?&gt;
                      &lt;li class="item"&gt;
                          &lt;?php $image = $post-&gt;getFeaturedImage(); ?&gt;
                          &lt;img src="&lt;?php echo $this-&gt;htmlEscape( $image-&gt;getAvailableImage() ) ?&gt;" ?&gt;
                      &lt;/li&gt;
                  &lt;?php endforeach; ?&gt;
             &lt;/ul&gt;
             &lt;script type="text/javascript"&gt;decorateList('&lt;?php echo $this-&gt;getListId() ?&gt;')&lt;/script&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;?php endif; ?&gt;
  </code></pre>
  
  <p>And, well, that's not working.  When I put a static number into $categoryID, I can at least get data into the $recentPostCollection, but the loops does not work with that data structure...  Any help would be amazing!  Thanks.</p>