-
What can it do?
-
Free and PRO Plugin
-
Ask your Question
-
Free Plugin: Installation and basic settings
-
Free Plugin: Start with easy Examples
-
Free Plugin: settings in detail
-
PRO Plugin: Installation and basic settings
-
PRO Plugin: Basic JCI start
-
PRO Plugin: settings in detail
-
PRO Plugin: twig-Template
-
PRO Plugin: Examples
-
PRO Plugin: create Custom Post Types
-
PRO Plugin: Other Plugins
-
PRO Plugin: application building
-
PRO Plugin: Data-Formats
-
PRO: Advanced Twig
Print
PRO: Use Custom Post Fields
A WordPress-Page can have some Custom Post Fields (CPF). By that one WP-page can be almost identical to another, the only differencewould be a CPF.
E. g. a CPF “language” on one page with “en” and on another “de”.
Having a JCI-Shortcode on such a page, the value of the CPF can be used in the API-URL and in the twig-template.
With twig this works this way: Get the current pageID by wp_get_page_properties
and then get the CPF by wp_get_custom_field_value
:
{% set pageprop = wp_get_page_properties(debug, pageid) %} {% set pageid = jcipageparam.post.ID %} pageid: {{pageid}}<br> {% set valkeyaa = wp_get_custom_field_value(pageid, 'keyaa') %} CPF-keyaa: {{valkeyaa | json_encode }}<br>
more on that an an example: http://api.json-content-importer.com/build-api-url-with-use-custom-fields/
Was this article helpful?
0.5 out Of 5 Stars
1 rating
5 Stars | 0% | |
4 Stars | 0% | |
3 Stars | 0% | |
2 Stars | 0% | |
1 Stars | 100% |
On this page: