Forked from cobaltapps/freelancer-custom-layout-function.php
Created
March 7, 2019 02:10
-
-
Save DalavanCloud/156ef4df91ff2e47e91a16e7d71082b2 to your computer and use it in GitHub Desktop.
An example of a custom function used to assign a custom layout to Freelancer using a conditional and the freelancer_layout filter hook.
This file contains hidden or 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
| add_action( 'wp_head', 'my_custom_layout' ); | |
| /* | |
| * This would assign a No Sidebar layout to all "Pages" | |
| * on your site, but have no effect on any other area. | |
| */ | |
| function my_custom_layout() { | |
| // If NOT a "Page" then do nothing. | |
| if ( ! is_page() ) | |
| return; | |
| // Filter in the No Sidebar layout callback function. | |
| add_filter( 'freelancer_layout', 'freelancer_return_no_sidebar' ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment