No other fields have been tested and are supported at the moment.
From version 4.4 the plugin supports shortcode embeds.
Given the amount of options and their specific names (as in shortcode attributes) the shorcode builder has been introduced
see 7th and 8th screenshots for the reference.
You’ll see a popup once clicked on ACFRPW button which gives one an ability to automatically set up the shortcode code for you.
The rest follows all of the options specified here.
To use the shortcode one needs to have the WordPress editor enabled for the current page / post type.
In case it was disabled (say via ACF) the button won’t appear.
From version 4.3 the plugin supports custom templates.
in the acf-recent-posts-widget/templates directory and copy them over to the active template directory to acfrpw subdirectory.
The approach is similar to the way WooCommerce plugin works and has it’s drawbacks.
With every new feature the files may be outdated.
Similarly to the widget template files, a separate, custom markup can be created for the shortcode build post listing.
to acfrpw-blog directory created inside your active theme directory.
- loop-after.php (which displays the markup after each of the posts and closes the markup container)
- loop-after.php(在每个帖子后显示标记并关闭标记容器) li>
- loop-before.php (which displays the markup before each of the posts and opens the markup container)
- loop-before.php(在每个帖子之前显示标记并打开标记容器) li>
- loop-inner.php (which is enqueued for each of the posts separatelly and contains the markup of every single post)
- loop-inner.php(每个帖子分别排队,并包含每个帖子的标记) li>
ul>
Usage
用法 h4>
The usage is quite advanced hence each template file contains a quite detailed documentation on how to use it.
用法非常先进,因此每个模板文件都包含有关如何使用它的详细文档。 p>
First of all the template files mustn’t have the global variables removed.
首先,模板文件不得删除全局变量。
Each of these variables stores the widget settings, which are then used to generate the code.
这些变量中的每一个都存储小部件设置,然后将其用于生成代码。
Second of all the variable names are unobvious, loop-inner.php template file contains a list of all the names used, which are then extracted and available as php variables.
所有变量名中的第二个都不明显,loop-inner.php模板文件包含所有使用过的名称的列表,然后将其提取并用作php变量。 p>
Different template per widget / sidebar
每个小部件/边栏的模板不同 h4>
The templates allow one to adjust the markup of each single widget.
模板允许您调整每个小部件的标记。
One needs first to verify the widget id used, which may then be referenced.
首先需要验证所使用的小部件ID,然后可以引用该ID。
The variable which stores the widget id is $acf_rpw_args[‘widget_id’].
存储小部件ID的变量为$ acf_rpw_args [‘widget_id’]。
Dumping the value in the template is the best way to find out which automatic id has been created for your widget.
转储模板中的值是找出为您的小部件创建了哪个自动ID的最佳方法。 p>
The best way to handle the templates is to learn from their code.
处理模板的最好方法是从模板中学习。
My personal suggestion is to copy over the templates to the current theme and work directly on them, doing one change at a time.
我个人的建议是将模板复制到当前主题,然后直接对其进行处理,一次进行一次更改。
The templates require learning curve to use and there’s no single answer to everyones problem.
模板需要学习曲线才能使用,而且每个人的问题都无法得到唯一答案。 p>
Complex usage
复杂用法 h4>
This section covers plugin complex usage for advanced user willing to have more control over the behavior of the plugin as well as explains uncommon functionalities.
本节介绍了高级用户愿意对插件的行为进行更多控制的高级用户的插件复杂用法,并介绍了一些不常见的功能。 p>
Using the HTML textarea fields
使用HTML textarea字段 h4>
These sections might not be obvious.
这些部分可能并不明显。
The HTML or text before / after the whole loop setting is an area where you can specify custom HTML markup to be added before / after the whole posts list.
整个循环设置之前/之后的HTML或文本是一个区域,您可以在其中指定要在整个帖子列表之前/之后添加的自定义HTML标记。
The HTML or text before / after each post is an area where you can not only specify custom HTML, but you are also given an ability to print any meta key or certain ACF fields (see
每个帖子前后的HTML或文本是一个区域,您不仅可以指定自定义HTML,还可以打印任何元键或某些ACF字段(请参见
="nofollow">ACF supported fields)
=“ nofollow”> ACF支持的字段) p>
Meta Key Name / ACF Usage
元密钥名称/ ACF用法 h4>
These fields need to be wrapped inside the {meta name} or {acf field_name} tags (which are similar to shortcodes).
这些字段需要包装在{meta name}或{acf field_name}标记内(与简码相似)。
The plugin will then parse these fields and print their according value.
然后,插件将解析这些字段并打印它们的相应值。
Say we have a custom ACF field of type text, for which the Field Name is “text”.
假设我们有一个类型为text的自定义ACF字段,其字段名称为“ text”。
To print its value one has to use [acf text] inside the befoe / after each post textarea.
要打印其值,必须在每个发布文本区域之后在befoe /中使用[acf文本]。
A similar solution applies to the meta key.
类似的解决方案也适用于meta键。 p>
Meta Value Usage
元值用法 h4>
The Meta Value field supports an array of elements, so that all of the meta_compare parameters could be used.
“元值”字段支持元素数组,因此可以使用所有meta_compare参数。
To do so, please specify the two parameters separated by semicolon, for instance: 1234;12345.
为此,请指定用分号分隔的两个参数,例如:1234; 12345。
The plugin will convert these into an array and apply the proper operation for the two.
该插件会将它们转换为数组,并对两者应用正确的操作。
Whatsmore the [date] shortcode can be used here.
此外,[date]简码可以在此处使用。
It takes the timestamp paramater as an argument, which is required – the possible arguments are the same as for
它需要时间戳参数作为参数,这是必需的–可能的参数与
相同
the function described here: http://php.net/manual/pl/function.strtotime.php.
此处描述的功能:http://php.net/manual/pl/function.strtotime.php。
For instance [date +1 day] would generate the tomorrow date in “Ymd” format.
例如[date +1 day]将以“ Ymd”格式生成明天的日期。
This can be used with custom meta field date.
可以与自定义元字段日期一起使用。 p>
Plugin Filters
插件过滤器 h4>
The are several filters that can be used to enchance the plugin programatically:
以下几种过滤器可用于以编程方式附加插件: p>
- ‘acf_rwp_query’ which gives one the ability to filter the query applied to each widget.
- “ acf_rwp_query”使您能够过滤应用于每个小部件的查询。
li>
- ‘acp_rwp_before’ which gives on the ability to filter the Front End output of the plugin before each post.
- “ acp_rwp_before”可让您在每次发布之前过滤插件的前端输出。
There are two hooks attached here already which allow usage of the [acf] and [meta] shortcodes.
这里已经连接了两个钩子,可以使用[acf]和[meta]短代码。 li>
- ‘acp_rwp_after’ which gives on the ability to filter the Front End output of the plugin after each post.
- “ acp_rwp_after”可以在每次发布后过滤插件的前端输出。
There are two hooks attached here already which allow usage of the [acf] and [meta] shortcodes.
这里已经连接了两个钩子,可以使用[acf]和[meta]短代码。 li>
- ‘acf_meta_value’ which filters the meta_value query parameter.
- “ acf_meta_value”,用于过滤meta_value查询参数。
li>
ul>
Check the acf_widget_widget file for the arguments and use cases.
检查acf_widget_widget文件中的参数和用例。 p>
Dependencies
依赖项 h3>