Gave it another try today but still no luck, I’m trying to insert the wpb_get_biography_box so it pulls your box instead of the generic one. Below is the way it shows on their plugin, and the php section I think I should be working with:
`// Author
if (!empty($this->params[‘author_tag’])):
if (!empty($this->params[‘author_class’])):
$lcp_display_output .= $this->get_author($single,
$this->params[‘author_tag’],
$this->params[‘author_class’]);
else:
$lcp_display_output .= $this->get_author($single, $this->params[‘author_tag’]);
endif;
else:
$lcp_display_output .= $this->get_author($single);
endif;
`
Plugin Author
vicchi
(@vicchi)
Trying to pull the output of a plugin’s template tag (from WP Biographia) into the output of another plugin’s shortcode (List Category Posts) is not going to be easy, if it’s possible at all.
I’ve taken (an admittedly brief) look at the code for List Category Posts and there doesn’t appear to be any way to extend this plugin via the WordPress filter mechanism, which is what you’d need that plugin to do.
But I’m not sure that this is the right approach for what I think you want to achieve.
It sounds like what you really want is for WP Biographia to append its biography box to each post on a page which is comprised of the output of the List Category Posts plugin? If that’s the case, then this might be possible out of the box, albeit with some configuration tweaking.
Let me know if this is the case and I’ll see if I can get this to hang together with the other plugin.
-Gary
Hi Gary,
Yes! thank you so much, if you want I can send you some more info on implementation via email if you’d like to look at site.
Plugin Author
vicchi
(@vicchi)
So I’ve got this working with both plugins out of the box on a clean, local, WordPress install.
The key thing to bear in mind is that WP Biographia uses two standard WordPress filter hooks, the_content
and the_excerpt
, to append or prepend the plugin’s Biography Box to the post’s content and excerpt respectively.
As a result, using the List Category Posts plugin’s shortcode and specifying that you want each post’s excerpt or content included will work … along the lines of
[catlist name="news" numberposts=5 content="yes"]
or …
[catlist name="news" numberposts=5 excerpt="yes"]
… if you want both the excerpt and the content displayed, you’ll need to remove the filter hook for the_excerpt
that WP Biographia uses so that the Biography Box doesn’t get appended/prepended twice, once for the excerpt and once for the content. The following code will do that for you …
remove_filter('the_excerpt', array(WP_Biographia::get_instance(), 'insert'));
However, if you simply want the list of category posts and with no content or no excerpt, then the above approach won’t work for you as the List Category Posts plugin never uses the WordPress API calls get_content()
or get_excerpt()
and thus the two filter hooks are never fired.
It may be possible to do this via the List Category Post’s template support, but I haven’t tried this, yet.
-Gary