Skip to content

Instantly share code, notes, and snippets.

@thecodepoetry
Last active December 22, 2018 00:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thecodepoetry/22463be7cbeda46bbaf00f6641d1ce26 to your computer and use it in GitHub Desktop.
Save thecodepoetry/22463be7cbeda46bbaf00f6641d1ce26 to your computer and use it in GitHub Desktop.
Sidebar, footer in 404page
add_action( 'get_header', 'dt_404_widget', 10 );
function dt_404_widget() {
$config = Presscore_Config::get_instance();
if( is_404() ) {
$config->set( 'sidebar_position', 'right' );
$config->set( 'sidebar_widgetarea_id', 'sidebar_1' );
$config->set( 'footer_show', '1' );
$config->set( 'footer_widgetarea_id', 'sidebar_2' );
}
}
@thecodepoetry
Copy link
Author

thecodepoetry commented Apr 24, 2017

Try this code in your child theme functions.php

@hborrelli1
Copy link

add_action( 'get_header', 'dt_404_widget', 10 );

function dt_404_widget() {
$config = Presscore_Config::get_instance();

if( get_post_type() == 'dspe_gallery' ) {
	// $config->set( 'sidebar_position', 'right'  ); 
	// $config->set( 'sidebar_widgetarea_id', 'sidebar_1' ); 
$config->set( 'footer_show', '1' ); 
	$config->set( 'footer_widgetarea_id', 'sidebar_2' );
}

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment