ACF & PHP-API (WordPress): verschil tussen versies
Naar navigatie springen
Naar zoeken springen
(Nieuwe pagina aangemaakt met ' == Zie ook == * ACF (Advanced Custom Fields, WordPress) == Bronnen == * https://www.advancedcustomfields.com/resources/') |
|||
Regel 3: | Regel 3: | ||
* [[ACF (Advanced Custom Fields, WordPress)]] | * [[ACF (Advanced Custom Fields, WordPress)]] | ||
+ | |||
+ | == the_field() == | ||
+ | |||
+ | Voorbeeld: | ||
+ | |||
+ | <pre> | ||
+ | <?php | ||
+ | # | ||
+ | # | ||
+ | ############################################################### | ||
+ | # Set variables & load libraries | ||
+ | ############################################################### | ||
+ | # | ||
+ | echo "Set variables & load libraries...\n"; | ||
+ | |||
+ | $path="/var/www/example.com/"; | ||
+ | |||
+ | require_once($path . "/wp-load.php"); | ||
+ | |||
+ | |||
+ | ############################################################### | ||
+ | # ACF - the_field | ||
+ | ############################################################### | ||
+ | # | ||
+ | echo "ACF - the_field...\n"; | ||
+ | |||
+ | the_field("hero_text",7); | ||
+ | |||
+ | ?> | ||
+ | |||
+ | Uitvoer: | ||
+ | |||
+ | <pre> | ||
+ | $ php 110.php | ||
+ | |||
+ | Set variables & load libraries... | ||
+ | |||
+ | |||
+ | ACF - get_field... | ||
+ | Eet more chips! | ||
+ | </pre> | ||
== Bronnen == | == Bronnen == | ||
* https://www.advancedcustomfields.com/resources/ | * https://www.advancedcustomfields.com/resources/ | ||
+ | * https://www.advancedcustomfields.com/resources/#functions - Alle PHP-functies bij elkaar! |
Versie van 29 jul 2022 09:58
Zie ook
the_field()
Voorbeeld:
<?php # # ############################################################### # Set variables & load libraries ############################################################### # echo "Set variables & load libraries...\n"; $path="/var/www/example.com/"; require_once($path . "/wp-load.php"); ############################################################### # ACF - the_field ############################################################### # echo "ACF - the_field...\n"; the_field("hero_text",7); ?> Uitvoer: <pre> $ php 110.php Set variables & load libraries... ACF - get_field... Eet more chips!
Bronnen
- https://www.advancedcustomfields.com/resources/
- https://www.advancedcustomfields.com/resources/#functions - Alle PHP-functies bij elkaar!