BuddyDev

Search

[Resolved] pay per post button display

  • Participant
    Level: Guru
    Posts: 900
    Tosin on #50340

    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; ?>
     
  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on #50348

    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
    Ravi

  • Participant
    Level: Guru
    Posts: 900
    Tosin on #50357

    Thanks 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; ?>
     
  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on #50361

    Hello Tosin,

    Thank you for the acknowledgement. I am glad that It worked.

    Regards
    Ravi

You must be logged in to reply to this topic.

This topic is: resolved