how to display html in frontend for widget development

Question

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.
     *
     * Faisal Naseer WP_Widget::widget()
     *
     * @param array $args     Widget arguments.
     * @param array $instance Saved values from database.
     */
    public function widget( $args, $instance ) {
        //<div>
        echo $args['before_widget'];
        if ( ! empty( $instance['title'] ) ) {
            echo $args['before_title'] . apply_filters( 'widget_title', $instance['title'] ) . $args['after_title'];
        }
        ?>

        //the output
        <p>
            hidf
        </p>
        
        <?php   
        //</div>
        echo $args['after_widget'];
        

    }
0
Gabriel Segura 2 months 0 Answers 7 views 0

Leave an answer