Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="header-image"><?php
- $image = get_field('imagen_superior');
- if( !empty($image) ): ?>
- <img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" />
- <?php endif; ?></div>
- function my_image() {
- $image = get_field('imagen_superior');
- if( !empty($image) ) {
- echo '<img src="' . $image['url'] . '" alt="' . $image['alt'] . '" />';
- }
- }
- function my_shortcode( $attr ) {
- return '<div class="header-image">' . my_image() . '</div>';
- }
- add_shortcode( 'my-shortcode', 'my_shortcode' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement