Hi,
I am trying to show a badge on some of my posts in a wpsp list with the ID number 79. I have created a True/False ACF field called “multiple_images”.
If the field is true I would like to hook the following code:
<div class="badge"><span>Gallery</span></div>
With PHP it would look something like this:
<?php if ( get_field( 'multiple_images' ) ): ?>
<div class="badge"><span>Gallery</span></div>
<?php else: // field_name returned false ?>
<?php endif; // end of if field_name logic ?>
How exactly do I put it in the hook “wpsp_before_content”?
I have tried this, but unfortunately it is not working:
add_action( 'wpsp_after_content', function( $settings ) {
if ( 79 === $settings['list_id'] )
<?php if ( get_field( 'multiple_images' ) ): ?>
<div class="badge"><span>Gallery</span></div>
<?php else: // field_name returned false ?>
<?php endif; // end of if field_name logic ?>
} );
Thanks in advance,
Zlatan