xili-postinpost function (template tag) provides a toolkit to insert post(s) everywhere in theme. The displayed post(s) are resulting of queries like those in WP loop but not interfere with main WP loop.
Args is an array or a concatenation with & chars.
Simple example:
<?php echo xi_postinpost("query=cat=1,2"); ?> |
As readable in source code, in addition to « query », lots of parameters are available:
$defaults = array( 'query'=>'','showposts'=>1, 'showtitle'=>1,'titlelink'=>1,'showexcerpt'=>0,'showcontent'=>1, 'beforeall'=>'<div class="xi_postinpost">', 'afterall'=>'</div>', 'beforeeach'=>'', 'aftereach'=>'', // 0.9.4 'beforetitle'=>'<h3 class="xi_postinpost_title">', 'aftertitle'=>'</h3>', 'beforeexcerpt'=>'', 'afterexcerpt'=>'', 'beforecontent'=>'', 'aftercontent'=>'', 'featuredimage' => 0, 'featuredimageaslink' => 0, 'featuredimagesize' => 'thumbnail', 'read' => 'Read…' ); $r = array_merge( $defaults, $r ); |
Note: this function is used by the shortcode and the widget of xili-postinpost plugin.