Last active
October 22, 2021 00:12
-
-
Save pavelrich/c7878d919178e85fffba2b93c704d439 to your computer and use it in GitHub Desktop.
Muse WordPress Theme — [muse-section section="SECTION"] Shortcode to Display the Section
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
<?php | |
if ( ! function_exists( 'muse_shortcode_section' ) ) { | |
/** | |
* [muse-section section="SECTION"] Shortcode to Display the Section | |
* | |
* @param $attrs | |
* | |
* @return false|string | |
*/ | |
function muse_shortcode_section( $attrs ) { | |
$attrs = shortcode_atts( array( | |
'section' => 'about', // about | albums | events | galleries | posts | products-featured | products-recent | |
), $attrs ); | |
ob_start(); | |
get_template_part( 'templates/section', esc_attr( $attrs['section'] ) ); | |
return ob_get_clean(); | |
} | |
add_shortcode( 'muse-section', 'muse_shortcode_section' ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment