How to remove traces from widget during uninstallation
How to remove traces from widget during uninstallation
How to remove traces from widget during uninstallation
WP – Genesis – How to get the content of a widget in php? [closed]
Conditional Tags Based on Previously Viewed Posts
It’s not clearly stated in your question, but I guess, you added exactly this code to the widget file: <?php echo $wp_query->current_post +1; ?> Am I right? If so, then it couldn’t work, because this code takes the counter from global $wp_query object, but… This widget doesn’t use global $wp_query and uses custom WP_Query instance. … Read more
You can change CSS as below. .widget.woocommerce.widget_product_categories ul li { display: block; margin: 0; padding: 0 0 3px; }
Display your widget only on post pages by adding if ( !is_single() or is_page()) { return;} at the start of your Widget’s function widget() public function widget( $args, $instance ) { if ( !is_single() or is_page()) { return;} // rest of code }
With @Jacob Peattie suggestion, I have recoded it & it is working perfectly fine with functions. /* Recent updated post & pages */ if ( ! function_exists( ‘iq_recent_update’ ) ) : function iq_recent_update() { $orig_post = $post; global $post; $args=array( ‘posts_per_page’ => 3, ‘orderby’ => ‘modified’, ‘order’ => ‘DESC’, ‘post_type’ => array(‘post’, ‘page’), ‘post_status’ => … Read more
I wonder if you have got it work or not? I am also trying to add some additional fields to the built-in image widget. I followed the comments above but still no luck. I even tried the cloning approach suggested by Brett Donald above. Thank you very much.
Elementor widgets – conditional controls
You can actually hide it on page load using jQuery ready() method: $(document).ready(function(){ $(‘#MY_WIDGET’).hide(); });