Last active
March 4, 2022 16:22
-
-
Save taotiwordpress/11ecd2effd656845a5fe87d48e5a1ad7 to your computer and use it in GitHub Desktop.
[ACF Anchor id] Add Anchor link to acf page builder block #acf #php #wordpress #flex-content #deprecated
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Note: If using Timber, a generated anchor is avaiable via {{ block.id }} | |
* This approach requires creating a custom 'anchor_id' field and/or using PHP to custom-generate one. | |
*/ | |
$anchor_id = get_sub_field( 'anchor_id' ); | |
?> | |
<section class="l-module form-block" <?php echo (!empty($anchor_id)) ? 'id="' . $anchor_id . '"' : ''; ?>> | |
<div class="inner"> | |
</div> | |
</section> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment