{"id":6295,"date":"2020-09-04T00:32:32","date_gmt":"2020-09-04T00:32:32","guid":{"rendered":"https:\/\/the7kennisbank.nl\/uncategorized\/advanced-shortcodes-wp-brain\/"},"modified":"2020-09-04T00:55:19","modified_gmt":"2020-09-04T00:55:19","slug":"advanced-shortcodes-wp-brain","status":"publish","type":"post","link":"https:\/\/the7kennisbank.nl\/en\/wp-brain\/advanced-shortcodes-wp-brain\/","title":{"rendered":"Advanced Shortcodes \u2013 WP Brain"},"content":{"rendered":"
<\/p>\n
This shortcode is very important if you want to redirect users to other pages or to external website, you have just to add this shortcode at the top of the editor to prevent users from reading the page content.<\/p>\n
<\/p>\n
You can add the redirect element within the IF and Else containers to redirect users based on the logic conditions, for example: redirect users to login pages if they aren\u2019t logged in.<\/p>\n
Imagine that you need to render the content of an HTML or PHP file within your pages or posts without creating a shortcode for each file. That\u2019s what WP Brain Include do, it allow you to include your files within pages and posts without coding<\/p>\n
<\/p>\n
As it\u2019s mentioned under the fields, the path to file must be relative WordPress directory (ABSPATH), for example if you want to include a file from your theme, you should start with \u2018\/wp-content\/themes\/\u2019 and so on.<\/p>\n
The following elements are advanced logic shortcodes and they are only suitable for programmers, so if you don\u2019t have coding skills, you don\u2019t need to use them.<\/p>\n<\/div>\n
With the help of this element, you can now trigger your custom action at any point of pages and posts content. This shortcode is useful for programmers who want to render content linked to an action<\/p>\n
<\/p>\n
In the example above, all the functions linked to \u2018wp_brain_test\u2019 hook will be called, that\u2019s equivalent to writing This shortcode is useful when you want to repeat some content or element with different index.<\/p>\n The first parameter is used to define the start index for the loop, the second is for the limit of the index, and the last parameter is referencing to the index incrementing step<\/p>\n In programing languages, this is equal to the FOR statement and it\u2019s arguments, so you should be familar with the syntax of this shortcode.<\/p>\n What\u2019s important about WB Brain loop, is that you can use the variable $index wherever you want in the child shortcodes, and it will be replaced by the loop index.<\/p>\n The result will be equivalent to writing the following shortcodes:<\/p>\n That\u2019s all about the logic shortcodes for pages and posts, let us know what other shortcodes you need and we will add them in future release.<\/p>\n","protected":false},"excerpt":{"rendered":" Redirect to Other Page This shortcode is very important if you want to redirect users to other pages or to external website, you have just to add this shortcode at the top of the editor to prevent users from reading the page content. You can add the redirect element within the IF and Else…<\/p>\n","protected":false},"author":2,"featured_media":6319,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[58],"tags":[],"class_list":["post-6295","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wp-brain","category-58","description-off"],"acf":[],"_links":{"self":[{"href":"https:\/\/the7kennisbank.nl\/en\/wp-json\/wp\/v2\/posts\/6295","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/the7kennisbank.nl\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/the7kennisbank.nl\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/the7kennisbank.nl\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/the7kennisbank.nl\/en\/wp-json\/wp\/v2\/comments?post=6295"}],"version-history":[{"count":3,"href":"https:\/\/the7kennisbank.nl\/en\/wp-json\/wp\/v2\/posts\/6295\/revisions"}],"predecessor-version":[{"id":6360,"href":"https:\/\/the7kennisbank.nl\/en\/wp-json\/wp\/v2\/posts\/6295\/revisions\/6360"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/the7kennisbank.nl\/en\/wp-json\/wp\/v2\/media\/6319"}],"wp:attachment":[{"href":"https:\/\/the7kennisbank.nl\/en\/wp-json\/wp\/v2\/media?parent=6295"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/the7kennisbank.nl\/en\/wp-json\/wp\/v2\/categories?post=6295"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/the7kennisbank.nl\/en\/wp-json\/wp\/v2\/tags?post=6295"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}do_action('wp_brain_test');<\/code> in PHP, but without coding.<\/p>\nRepeat Elements<\/h3>\n
<\/p>\n
<\/p>\n[show_post id=1][show_post id=2][show_post id=3][show_post id=4][show_post id=5]<\/pre>\n