What is the right way to close "if function_exist"?
-
Hello,
I’m trying to find an answer what is the best way to close “if function_exist” with
endif;
beforeadd_action
or after? I saw many examples were closing can be in both places. Is there any difference?eg:
if ( ! function_exists( 'tinyforge_content_width' ) ) : function tinyforge_content_width() { if ( is_page_template( 'page-templates/full-width.php' ) || is_attachment() || ! is_active_sidebar( 'sidebar-1' ) ) { global $content_width; $content_width = 960; } } add_action( 'template_redirect', 'tinyforge_content_width' ); endif;
Thank you!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘What is the right way to close "if function_exist"?’ is closed to new replies.