Adding Widgets to Draft Pages

As you note in your comment there are plugins that allow you to insert different widgets on different types of pages. If the plugin doesn’t include the possibility you need, you’ll have to build it yourself. First, you’ll have to familiarize yourself with how to add widget areas (sidebars) to your (child) theme. It isn’t … Read more

Want to make A CSS if meta key value is empty

you won’t need css for that // Create the widget output. public function widget( $args, $instance ) { $prod_image_url = get_post_meta( ‘prod_image_url’ ); if(!empty($prod_image_url)){ echo $args[‘before_widget’] . $args[‘before_title’] . $args[‘after_title’]; if( is_single() ): ?> <div id=”show”> <img class=”prodimage” src=”https://wordpress.stackexchange.com/questions/253903/<?php echo ( get_post_meta( get_the_ID(),”prod_image_url’, true ) ); ?>”/><br> </div> <?php else: echo ”; endif; } ?> … Read more