开发者 |
michelwppi
MS dev.xiligroup.com |
---|---|
更新时间 | 2019年5月21日 15:21 |
捐献地址: | 去捐款 |
PHP版本: | 4.9 及以上 |
WordPress版本: | 5.2 |
版权: | GPLv2 |
xi_postinpost()
- see source ,[xilipostinpost query="p=1"]
or like <blockquote>[xilipostinpost query="cat=3,4,150&showposts=2&lang=en_us"]</blockquote>
.<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).[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.
New with 1.7.02 :
?p=1
or ?cat=17&tag=new
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).
xi_postinpost
: is it possible to use query passed as array ?YES, see below an example using array and userfunction (formatting the result of query differently than default) : ` '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).
xili-language plugin active
Very simple : [lang='cur']
xili-language plugin active
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()
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!
Are the queries recursive in widget ?
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.