Hi
im trying to display the pay per post button in my content-single.php file with this code below but it is not working
<?php if ( is_user_logged_in() && is_singular('post') ) : ?> <div id="call-to-action" class="promote-action-btn"> <?php if ( function_exists( 'bblpro_ppp_promote' ) ) { echo bblpro_ppp_promote( get_the_ID(), array( 'label' => esc_html( '+ 10X Views - Promote Your Post ₦' ) ) ); } ?> </div> <?php endif; ?>
Hello Tosin,
Please try the following code:
<?php if ( is_user_logged_in() && is_singular( 'post' ) ) : ?> <div id="call-to-action" class="promote-action-btn"> <?php $post_id = get_the_ID(); $label = esc_html( '+ 10X Views - Promote Your Post ₦' ); echo do_shortcode( "[bblpro_ppp_promote post_id={$post_id} label={$label}]" ); ?> </div> <?php endif; ?>
Regards
RaviThanks Ravi
There was a typo error but this worked
<?php if ( is_user_logged_in() && is_singular( 'post' ) ) : ?> <div id="call-to-action" class="promote-action-btn"> <?php $post_id = get_the_ID(); $label = esc_html( '+ 10X Views - Promote Your Post ₦' ); echo do_shortcode( "[bblpro_ppp_promote post_id={$post_id} label='{$label}']" ); ?> </div> <?php endif; ?>
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic.
This topic is: resolved