__( 'Aspire Smart FAQ Widget for Single FAQ', 'text_domain' ), ) // Args ); } /** * Front-end display of widget. * * @see WP_Widget::widget() * * @param array $args Widget arguments. * @param array $instance Saved values from database. */ public function widget( $args, $instance ) { // outputs the content of the widget // One variable is coming in INSTANCE ARRAY , title $title = apply_filters( 'widget_title', $instance['title'] ); $atts['id'] = $title; echo $args['before_widget'].'

FAQs


'; if ( ! empty( $title ) ){ // Pre define short function is used for widget, for customization please see shortcodes file single_aspfaq_shortcode($atts); } echo $args['after_widget']; } /** * Back-end widget form. * * @see WP_Widget::form() * * @param array $instance Previously saved values from database. */ public function form( $instance ) { // outputs the options form on admin if ( isset( $instance[ 'title' ] ) ) { $title = $instance[ 'title' ]; } else { $title = __( '', 'text_domain' ); } // Printing Form for backend with one fields FAQ ID ?>

Enter FAQ id to display that specific FAQ