I’ve tried many variations and can’t seem to get the syntax right. In one of my WordPress theme pages I have the following Widget code. I want to append the existing functionality to where it removes this widget if the page name is ‘event-view’ or page id is ‘640’…how do I do this?
<?php
// A third sidebar for widgets
if ( is_active_sidebar( 'third-widget-area' ) ) : ?>
<div id="third" class="widget-area" role="complementary">
<ul class="xoxo">
<?php dynamic_sidebar( 'third-widget-area' ); ?>
</ul>
</div><!-- #secondary .widget-area -->
Try this:
You can also check page by it’s name
is_page('event-view')