how to display html in frontend for widget development


I;m still new to php and wordpress, I have HTML I want to display with someone puts in this widget but I’m not sure why its not displaying. I know I’m doing something or a lot of things wrong. Am I not suppose to the use the //output area?

     * Front-end display of widget.
     * Haseeb Asif WP_Widget::widget()
     * @param array $args     Widget arguments.
     * @param array $instance Saved values from database.
    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'];

        //the output
        echo $args['after_widget'];

Gabriel Segura 8 months 2020-11-23T13:10:36-05:00 0 Answers 7 views 0

Leave an answer