xili-postinpost provides a triple toolkit to insert post(s) everywhere in webpage. Template tag function, shortcode and widget are available.
xili-postinpost provides a triple toolkit to insert post(s) everywhere in webpage – outside or inside WP loop – . The displayed post(s) are resulting of queries (see codex) like those in WP loop but not interfere with main WP loop. Widget contains conditional syntax.
xi_postinpost()
– see source ,[xilipostinpost query="p=1"]
or like <blockquote>[xilipostinpost query="cat=3,4,150&showposts=2&lang=en_us"]</blockquote>
.A shortcode like <blockquote>[xilipostinpost query="cat=3,4,150&showposts=2" lang="cur"]</blockquote>
with param lang
set to cur
give a result according the current language (example: inside an undefined page displayed according browser language).
and widget with powerful syntax for contextual display of query’s result.
are available for developers, authors and webmasters.
In widget (and template tag), if option is set, it is possible to choose display period and expiration date.
In widget – if xili-language plugin active – to combine a query and the current language use params like [query="cat=14" lang="cur"]
with square bracket[]
and lang set cur. Don’t put cur in query. See screenshot.
For each post of the resulting list, the displayed result is hightly customizable and can contain title, excerpt, content, thumbnail image with or without link to the post as single.
Paging is preserved even if a shortcode is used in a list of posts.
xili-postinpost is compromise between minimum php coding (but not accessible by everybody) and end-user tool (like widget) – but with lot of php lines in background – to afford flexibility for webmaster and data-designer for CMS. The core function of the plugin ( xi_postinpost()
) and its rich argument (array with lot params) was created 4 years ago to insert by example a recent news in header, a target post inside blockquote set in content of a page or a post. Doing a public version is like finishing a book. Remind that free code is not gratis, include fees in quotation for commercial use or clients and donate. For free use, send an email!
No, it is only possible to combine one true and another one if the first is false: the syntax is [condition=… query=…]:[query=…]
. The second part can have is own condition as in screenshot 6.
Upload the xili-postinpost plugin to your blog, Activate it. Go to settings.
If you want to use widget, go to Widgets menu of Appearance menu.
To use shortcode inside post’s content, refer to examples provided in these posts here.
To use core functions of plugin, as developer, refer directly to code source before inserting (and echoing result) of the function in your theme.
?p=1
or ?cat=17&tag=new
widget settings UI for a simple query
widget settings UI for a simple conditional query and all display/input options set.
widget settings UI for a two conditional queries.
widget settings UI for a query combined with current language (requires xili-language).
widget settings UI: in this case, Featured images of category ID11 will be listed in ul li list according current language.
appearance - customize - widget settings UI: real time results during settings (WP 3.9+)
Recent Posts only displays title with link of latest posts from all categories.
With xili-postinpost it is possible to choose what to display and which categories or tags associated with post (and html tags or class).
YES, see below an example using array and userfunction (formatting the result of query differently than default) :
<?php echo xi_postinpost( array( 'showposts' => '4' , 'query' => array( 'category__and' => array( $cat_id, 7 ) ), 'userfunction' => 'xili_pip_banner' ) ); ?>
Currently the result of widget is ever displayed. Here it is possible to use function (currents or made by webmaster) to decide when to display according context. By example if you use is_page
, if the condition return true, the widget show the result here when a page is displayed in website. Another example with is_category
and params 1,5,87
in the query input : when one these three categories is shown, the widget show the resulting list.
If the condition is false, you can decide to show result of another query. If the condition is not inside the conditional template tags, it is possible
to create and use a conditional function created by you (in functions.php).
Very simple : [lang='cur']
In this case, condition uses a function available with xili_language :
[condition='is_xili_curlang' param='fr_fr' query='p=4953']:[query='p=4972']
param fr_fr
is passed to function is_xili_curlang
, so the first query is fired only if french webpage.
The result adapts and displays the content (can be image+text) according webpage language.
See the topic here in forum
The webmaster is able to define a period (a slot) when the widget is visible in sidebar (or the shortcode is display inside the content). By example: for an advertising post or an article for a future meeting which disappears the day after the meeting (expiration date).
Yes xili-language plugin is compatible, visit here and look on the right sidebar or go in WordPress repository.
Effectively, prefer forum to obtain some support.
xili_postinpost_query
) for complex presetted queries (shortcode or template_tag) usable in mailing list plugin, add param for no post msg, default option for editlink for authorxi_postinpost()
© 2019-05-20 – MS – dev.xiligroup.com