Advertisement
min_m3

Call custom portfolio in functions.php

Jul 28th, 2020 (edited)
1,083
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.71 KB | None | 0 0
  1. //Add to functions.php
  2.  
  3. //======================================================================
  4. // CALL UP THE CUSTOM PORTFOLIO WITH EXCERPT FILE - custom_portfolio
  5. //======================================================================
  6. function custom_portfolio_excerpt() {
  7.     if ( ! class_exists('ET_Builder_Module') ) {
  8.         return;
  9.     }
  10.     get_template_part( '/custom_portfolio' ); //location of your portfolio module in child theme
  11.     $custom_portfolio = new Custom_ET_Builder_Module_Portfolio();
  12.     remove_shortcode( 'et_pb_portfolio' );
  13.     add_shortcode( 'et_pb_portfolio', array($custom_portfolio, '_shortcode_callback') );
  14. }
  15. add_action( 'et_builder_ready', 'custom_portfolio_excerpt', 9999 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement