2017-06-20 71 views
1

我有一个用于wordpress的usersultra插件的问题。如何在wordoress中使用带页面模板的userultra插件

I have created a template page for search, but i only want to display it for the client who is logged in, how can i use usersultra for this case. 

Secondly when i check 'Only Logged in Users' checkbox in page settings it displays the content of my page and form of registration at the same time. 

Please how can i resolve this problem. 

编辑:

这就是我想,但它不工作

<?php echo do_shortcode("[usersultra_protect_content display_rule='logged_in_based' custom_message_loggedin='Only Logged in users can see the content'] 

    <b>myfield :</b><?php the_field('myfield');?> 

[/usersultra_protect_content]"); ?> 

只显示文本不是值。

编辑2:

它与艾哈迈德提供

<?php echo do_shortcode("[usersultra_protect_content display_rule='logged_in_based' custom_message_loggedin='Only Logged in users can see the content'] 

     <b>myfield :</b>".the_field('myfield')." 

    [/usersultra_protect_content]"); ?> 

回答

1

你可以做到这一点通过这个短码,

<?php echo do_shortcode("[usersultra_protect_content display_rule='logged_in_based' custom_message_loggedin='Only Logged in users can see the content']Your private content here [/usersultra_protect_content]"); ?> 

短码是列在这里的文档页面上的代码工作:https://usersultra.com/userultra/

+0

我如何在.php页面中使用这个简码。因为我正在使用我创建的自定义模板。 – Asomuth

+0

更新了代码以运行在php文件 –

+0

它工作。我真的很感激它,阿拉真主祝福你。 – Asomuth

相关问题