plugins - How to add social locker on custom fields

i want to add social locker on custom fields like demo and download buttons<center><p><a class="mbut

i want to add social locker on custom fields like demo and download buttons

<center><p><a class="mbutton" target="_blank" href="<?php echo get_field(demo_link); ?>">DEMO</a><p></center>
<center><p><a class="dbutton" target="_blank" href="<?php echo get_field(download_link); ?>">DOWNLOAD</a><p></center>

i tried to use <?php echo do_shortcode("[lockercat]"); ?> added here buttons <?php echo do_shortcode("[/lockercat]"); ?>

..... with this locker works now but get_field function doesnt work and getting link like this

example/post-name/php echo get_field(download_link); ?>

....

<?php
$lockit = '[lockercat]' . '<center><p><a class="mbutton" target="_blank" href="<?php echo get_field(demo_link); ?>">DEMO</a><p></center>
                            <center><p><a class="dbutton" target="_blank" href="<?php echo get_field(download_link); ?>">DOWNLOAD</a><p></center>' . '[/lockercat]';
echo do_shortcode($lockit);
?>

i want to add social locker on custom fields like demo and download buttons

<center><p><a class="mbutton" target="_blank" href="<?php echo get_field(demo_link); ?>">DEMO</a><p></center>
<center><p><a class="dbutton" target="_blank" href="<?php echo get_field(download_link); ?>">DOWNLOAD</a><p></center>

i tried to use <?php echo do_shortcode("[lockercat]"); ?> added here buttons <?php echo do_shortcode("[/lockercat]"); ?>

..... with this locker works now but get_field function doesnt work and getting link like this

example/post-name/php echo get_field(download_link); ?>

....

<?php
$lockit = '[lockercat]' . '<center><p><a class="mbutton" target="_blank" href="<?php echo get_field(demo_link); ?>">DEMO</a><p></center>
                            <center><p><a class="dbutton" target="_blank" href="<?php echo get_field(download_link); ?>">DOWNLOAD</a><p></center>' . '[/lockercat]';
echo do_shortcode($lockit);
?>
Share Improve this question edited Mar 26, 2018 at 20:50 Lashh a asked Mar 26, 2018 at 19:44 Lashh aLashh a 112 bronze badges 1
  • What's a social locker? Shortcodes have to be self contained, you can't pass [shortcode] in one call, then [/shortcode] in another – Tom J Nowell Commented Mar 26, 2018 at 20:09
Add a comment  | 

1 Answer 1

Reset to default 1

The do_shortcode() syntax requires everything in one string.

<?php
$lockit = '[lockercat]' . 'your buttons etc.' . '[/lockercat]';
echo do_shortcode($lockit);
?>

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744649321a4585804.html

相关推荐

  • plugins - How to add social locker on custom fields

    i want to add social locker on custom fields like demo and download buttons<center><p><a class="mbut

    1天前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信
['keyword'] : $thread['subject']; $header['description'] = $thread['description'] ? $thread['description'] : $thread['brief']; $_SESSION['fid'] = $fid; if ($ajax) { empty($conf['api_on']) and message(0, lang('closed')); $apilist['header'] = $header; $apilist['extra'] = $extra; $apilist['access'] = $access; $apilist['thread'] = well_thread_safe_info($thread); $apilist['thread_data'] = $data; $apilist['forum'] = $forum; $apilist['imagelist'] = $imagelist; $apilist['filelist'] = $thread['filelist']; $apilist['threadlist'] = $threadlist; message(0, $apilist); } else { include _include(theme_load('single_page', $fid)); } break; default: message(-1, lang('data_malformation')); break; } ?>