Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. ## first in your functions.php add the following function
  2.  
  3. //Shortcode to show the module
  4. function showmodule_shortcode($moduleid) {
  5. extract( shortcode_atts( array('id' =>'*'), $moduleid ) );
  6. return do_shortcode('[et_pb_section global_module="'.$id.'"][/et_pb_section]');
  7. }
  8. add_shortcode('showmodule', 'showmodule_shortcode');
  9.  
  10. ## then create your single-customCPT.php file duplicating page.php from divi and look for line 45 :
  11. the_content();
  12.  
  13. ## and replace it for
  14. echo do_shortcode('[showmodule id="YOUR LAYOUT ID"]');
  15.  
  16. ## remember: you need to create your divi layout first.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement