-
-
Save yogoeasy/2de97886fb7f3b74a4baaaef743f600b to your computer and use it in GitHub Desktop.
限制內容-短代碼-2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. | |
限制Divi按鈕範例1 | |
[membership level="3"] | |
[button link="about" newwindow="yes"] 了解更多[/button] | |
[/membership] | |
2. | |
限制Divi按鈕範例2 | |
[membership level="3"] | |
[showmodule id="27971"] | |
[/membership] | |
方法二所用到的showmodule短代碼,需在functions.php裡頭加上下方代碼: | |
/* 將Divi Library的模組用shortcode的方式插入文章 */ | |
function showmodule_shortcode($moduleid) { | |
extract(shortcode_atts(array('id' =>'*'),$moduleid)); | |
return do_shortcode('[et_pb_section global_module="'.$id.'"][/et_pb_section]'); | |
} | |
add_shortcode('showmodule', 'showmodule_shortcode'); | |
by 優易教學網 https://www.yogoeasy.com |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment