Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save DalavanCloud/156ef4df91ff2e47e91a16e7d71082b2 to your computer and use it in GitHub Desktop.
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.
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