Guides
Display Custom Fields (Meta)
Custom meta fields may be used by developers. If you don't know how it works, read here more info https://wordpress.org/support/article/custom-fields/.
Display Meta Value
PHP
<p>
<?php echo get_lzb_meta( 'control_meta_name' ); ?>
</p>
Use Conditions
PHP
if ( get_lzb_meta( 'control_meta_name' ) ) {
?>
<p>The value is True</p>
<?php
} else {
?>
<p>The value is False</p>
<?php
}
Work With Arrays
PHP
$repeater = get_lzb_meta( 'control_meta_name' );
foreach ( $repeater as $inner_control ) {
?>
<p><?php echo $inner_control; ?></p>
<?php
}
Work With Images
PHP
$image = get_lzb_meta( 'control_meta_name' );
if ( isset( $image['url'] ) ) : ?>
<img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>">
<?php endif; ?>
Work With Image ID
PHP
$image = get_lzb_meta( 'control_meta_name' );
if ( isset( $image['id'] ) ) {
echo wp_get_attachment_image( $image['id'], 'large');
}
Previous ArticleInclude Lazy Blocks within theme or pluginNext ArticleCustom Post Type and Save in Meta control