Both exclude the sidebar if the page ID is one, however the first has a set of braces where you could do something else!
Example switch the sidebar (version 3 with a template part)
<?php if (is_page('1')) {
/* get new sidebar in template part /*
get_template_part( 'sidebar', 2 );
} else {
/* get the normal sidebar one */
get_sidebar();
}?>
This one will leave a space where the sidebar should be on page ID one!
<?php if (!is_page('1')) { ?>
<?php get_sidebar(); ?>
<?php } ?>
HTH
David
Thread Starter
Seijun
(@seijun)
So basically one just deletes the sidebar and the other also deletes the sidebar but also gives the option to replace it with something else..
Not delete,just not load it!
So basically both will not load the sidebar if the page ID is 1 and the the first code block is an ‘if then else endif’ statement where you can load something ‘else’ only if the page ID is 1 ..
David