Crocoblock Macros

Short Answer
Are you a CROCOLOVER and want/need to know all their Macros? here they are:
%related_children_from|post-type-slug% – %related_parents_from|post-type-slug% – %current_id% – %s – %name% – %media1|img_url_by_id% – %gallery1|img_gallery_grid% – %link|post_url_by_id% – %current_categories% – %current_tags% – %current_terms% – %queried_term% – %date|format_date% – %date_meta|format_date% or %date_meta|format_date(F j, Y)% – %title% – %field_value% – %current_meta% – %current_meta_string% – %related_children_between% – %author_id% – %queried_user_id% – %get_grandparent% – %get_grandchild% –

We ALL love MACROS! they make life sooo much easier ;) While the Crocoblock team are preparing the updated page (they promised that they will soon) I copied their macros from their site here, and added a few more that exists .. there are probably others around, so if you know of any that I have not listed, please let me know ;)

%related_children_from|post-type-slug% – this macro code is used for displaying only the child related posts. You need to paste it in Listing Grid widget (Posts Query block and here add a new item with the Posts Parameters type)

%related_parents_from|post-type-slug% – this macro code is used for displaying only the parent related posts. You need to paste it in Listing Grid widget (Posts Query block and here add a new item with the Posts Parameters type)

%current_id% – type in this macro in the Exclude posts by IDs field in the Posts Query > Posts Parameters query type of Listing Grid widget in order to let the query exclude the currently displayed posts on the page from the query.

Note: you can display either parent or child related posts, and the “|post-type-slug” stands for the actual post type slug (e.g., “events”)

%s – this macro stands for the value that is pulled, just add some content before and after it to add some text before and after the value in the Customize field input option of Dynamic Field widget.

%name% – this macro code and HTML markup (< span >< /span> or < div>< /div>) are used to format the repeater content in the Item Format field of Dynamic Repeater widget. You need to insert the particular IDs of the meta fields, which are included in the repeater to display the content added in the certain meta field (e.g., %text% – this is the macros that will help in displaying the content added in the Text meta field).

%media1|img_url_by_id% – insert this macro in the Item Format field of Dynamic Repeater widget to display the image URL link that will be pulled from the database.

%gallery1|img_gallery_grid% – insert this macro in the Item Format field of Dynamic Repeater widget to display the gallery in one of the repeater sub fields.

%link|post_url_by_id% – insert this macro in the Item Format field of Dynamic Repeater widget to add the Post URL that is added with ACF to the repeater sub field.

%current_categories% – in order to exclude the specific category term from showing up, add the Tax Query query type in Posts Query block and specify this marcos in the Taxonomy: Categories block in the Terms field.

%current_tags% – to exclude the specific tag from showing up, you need to add a new query item and then select the Tax Query query type and Tags in the Taxonomy field and type this macros in the Terms field and specify IN operator.

%current_terms% – in case one has a custom taxonomy, this macros helps query the current terms to display the posts related by the terms on Single post’s page.

%queried_term% – insert this macro in the Terms field, settings Posts Query block (Type:Tax Query > Taxonomy: Category) in Listing Grid widget to display related posts from the specific term.

%date|format_date% – insert this macro in the Notificaion Settings block in the Form and your Form’s field will inherrit the default date format set in WordPress settings.

%date_meta|format_date% or %date_meta|format_date(F j, Y)% – use those macros if you need to change the date in the Dynamic Repeater widget (the macro should be inserted to the Dynamic Field widget in the Content block on the Elementor editing page). Where date_key – stands for the name of the date field in repeater, and F j, Y – is the date format, which can be changed in accordance to this tutorial.

The above is a copy paste from Crocoblock’s page

The below are other Macros that exists .. I will try to find the time to explain how they work soon:

%title%

%field_value%

%current_meta%

%current_meta_string%

%related_children_between%

%author_id%

%queried_user_id%

%get_grandparent%

%get_grandchild%

 

it_ITItalian

Questo sito fa uso di cookie per migliorare l’esperienza di navigazione degli utenti. Può conoscere i dettagli consultando la nostra privacy policy qui. Proseguendo nella navigazione si accetta l’uso dei cookie; in caso contrario è possibile abbandonare il sito.