CSS not Working in Custom Widget title ,without title works everywhere properly
-
I made a wordpress widget there everything is ok but css not working for widget title.Everything is okay in CSS file and title class also> CSS working for widget content but not working for widget title.Dont know whats going wrong.Please help.Here is my code:
/** * Adds Footer_One widget. */ class Footer_One extends WP_Widget { /** * Register widget with WordPress. */ function __construct() { parent::__construct( 'footer_one', // Base ID esc_html__( 'Footer Logo Text', 'solutioncat' ), // Name array( 'description' => esc_html__( 'A Footer Widget', 'solutioncat' ), ) // Args ); } /** * Front-end display of widget. * * @see WP_Widget::widget() * * @param array $args Widget arguments. * @param array $instance Saved values from database. */ public $args = array( 'before_widget' => '<div class="footer-widget wow animated fadeInUp" data-wow-duration="2s">', 'after_widget' => '<div>', 'before_title' => '<h2 class="footer-heading">', 'after_title' => '</h2>', ); public function widget( $args, $instance ) { echo $args['before_widget']; if ( ! empty( $instance['title'] ) ) { echo $args['before_title'] . apply_filters( 'widget_title', $instance['title'] ) . $args['after_title']; } ?> <div class="footer-logo"> <a href="<?php echo esc_url(home_url('/'));?>"><img src="<?php echo get_theme_mod('logo-footer');?>" alt="logo Footer" /></a> </div> <div class="footer-content"> <p> <?php echo get_theme_mod('footer_text'); ?> </p> </div> <div class="store-button"> <ul> <li> <a href="<?php echo get_theme_mod('ios_footer_link');?>" target="_blank"><img src="<?php echo get_template_directory_uri(); ?>/assets/img/slider/app_store.png" alt="store-button" /></a> </li> <li> <a href="<?php echo get_theme_mod('android_footer_link');?>" target="_blank"><img src="<?php echo get_template_directory_uri(); ?>/assets/img/slider/play_store.png" alt="store-button" /></a> </li> </ul> </div> <?php echo $args['after_widget']; } /** * Back-end widget form. * * @see WP_Widget::form() * * @param array $instance Previously saved values from database. */ public function form( $instance ) { $title = ! empty( $instance['title'] ) ? $instance['title'] : esc_html__( 'New title', 'solutioncat' ); ?> <p> <label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php esc_attr_e( 'Title:', 'solutioncat' ); ?></label> <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>"> </p> <?php } /** * Sanitize widget form values as they are saved. * * @see WP_Widget::update() * * @param array $new_instance Values just sent to be saved. * @param array $old_instance Previously saved values from database. * * @return array Updated safe values to be saved. */ public function update( $new_instance, $old_instance ) { $instance = array(); $instance['title'] = ( ! empty( $new_instance['title'] ) ) ? sanitize_text_field( $new_instance['title'] ) : ''; return $instance; } } // class Footer_One // register Footer_One widget function Footer_One_widget() { register_widget( 'Footer_One' ); } add_action( 'widgets_init', 'Footer_One_widget' );
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘CSS not Working in Custom Widget title ,without title works everywhere properly’ is closed to new replies.