How to post->post_content as Html

I have to post a content as html in bellow code you can see that div <div class='pbg_info' i want post as html using $post->post_content=" and any other way

The div class ‘pbg_info’ is script of pay by group payment gateway to display the pay group button.

Read More

If anybody have any idea how achieve this then let me know.

$post->post_content="
    <div class='pbg_info'
    data-purchase-image-url='http://example.com/picture.png'
    data-purchase-name='Awesome Escape'
    data-purchase-inventory-id='ESCAPE-23'
    data-purchase-cost='"<?php echo $price;" ?>'
    data-purchase-currency='CAD'
    data-purchase-link-url='http://example.com/property'
    data-purchase-description='Great rental for 3 people with lake view.' >
    </div>
    <script src='https://cdn.paybygroup.com/snippet/v2/loader.js?merchant_id=example'>
    </script>";

with this code i am getting a output like this. i am expecting a button to display here using this code.

data-purchase-image-url=’http://example.com/picture.png’
data-purchase-name=’Awesome Escape’
data-purchase-inventory-id=’ESCAPE-23′
data-purchase-cost=’100′
data-purchase-currency=’CAD’
data-purchase-link-url=’http://example.com/property’
data-purchase-description=’Great rental for 3 people with lake view.’ > 

Related posts

Leave a Reply

1 comment

  1. I think you have to filter that content before outputting, that means you have to use the code like below :

    <?php
    $content=$post->post_content;
    echo apply_filters('the_content', $content);
    ?>