• Resolved Víctor

    (@njusted)


    Hi! First of all, congratulations for this awesome plugin!

    I have a small problem… when I try to put the php code instaid the shortcode in my theme, it fails and show up nothing. This is the code i used:

    <?php echo do_shortcode('[mycred_sell_this price="10" button_label="Desbloquear" expire="24"]'.$enlaces=get_post_meta($post->ID, 'wpcf_enlaces', true).'[/mycred_sell_this]'); ?>

    I read wordpress codex, but I think is a problem calling a custom field. Any solution?

    Thank you ??

    https://www.ads-software.com/plugins/mycred/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Víctor

    (@njusted)

    Solved… it’s: $enlaces=get_post_meta($post->ID, ‘wpcfenlaces’, true).

    Thread Starter Víctor

    (@njusted)

    Now, the content of $enlaces it’s unformatted and don’t have <br> (sorry for my english, i can’t speak very well). What can I do?

    Plugin Author myCred

    (@designbymerovingi)

    I would call the $enlaces first and format it according to your needs, then include it in the shortcode.

    $enlaces = get_post_meta($post->ID, 'wpcf_enlaces', true);
    $enlaces = nl2br( $enlaces );
    echo do_shortcode('[mycred_sell_this price="10" button_label="Desbloquear" expire="24"]' . $enlaces . '[/mycred_sell_this]' );

    P.S. Make sure you wrap code you insert here by selecting the entire code snippet and clicking on the “code” button above the textarea. This way it will be formatted properly.

    Thread Starter Víctor

    (@njusted)

    You’re a master! Thanks for this great support.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘PHP code instaid of shortcode’ is closed to new replies.