add_action( 'wpsp_before_content', function( $settings ) {
if ( 123 === $settings['list_id'] ) {
$meta = get_post_meta( get_the_ID(), 'test_acf_field', true );
if ( $meta ) {
add_action( 'wpsp_before_content', function( $settings ) {
if ( 100 === $settings['list_id'] ) {
$meta = get_post_meta( get_the_ID(), 'test_field', true );
if ( $meta ) { echo '<div class="wpsp-meta-1">'; } echo $meta; echo '</div>'; }
} );
add_action( 'wpsp_before_content', function( $settings ) {
if ( 287 === $settings['list_id'] ) {
$meta_datum = get_post_meta( get_the_ID(), 'acf-termin-datum', true );
$meta_beschreibung = get_post_meta( get_the_ID(), 'acf-termin-beschreibung', true );
if ( $meta_datum ) {
echo '<h2>'; }
echo $meta_datum;
echo '</h2>';
if ( $meta_beschreibung ) {
echo '<p>'; }
echo $meta_beschreibung;
echo '</p>';
}
} );
replace 123 with the ID of the WPSP list
add_action( 'wpsp_before_content', function( $settings ) {
if ( 100 === $settings['list_id'] ) {
$meta = get_post_meta( get_the_ID(), 'test_field', true );
if ( $meta ) { echo '<div class="wpsp-meta-1">'; } echo $meta; echo '</div>'; }
} );
add_action( 'wpsp_after_content', function(){
echo get_field('the_advanced_custom_field');
});
WPSP Hooks
wpsp_before_wrapper
wpsp_before_header
wpsp_before_title
wpsp_before_content
wpsp_after_content
wpsp_after_wrapper