WordPress.org

Ready to get started?Download WordPress

Forums

WP Custom Menu Widget not showing headers? (1 post)

  1. acknowledged74
    Member
    Posted 1 year ago #

    Hi

    I've just installed a new version of WP and when I've gone to add a custom menu for some reason the header is only showing as completely normal text rather than the <h> tag that it should?

    I have checkout in the code and it just not there. I've looking in default-widgets.php at the relevant bit, I think atleast which I've included below,

    class WP_Nav_Menu_Widget extends WP_Widget {

    function __construct() {
    $widget_ops = array( 'description' => __('Use this widget to add one of your custom menus as a widget.') );
    parent::__construct( 'nav_menu', __('Custom Menu'), $widget_ops );
    }

    function widget($args, $instance) {
    // Get menu
    $nav_menu = ! empty( $instance['nav_menu'] ) ? wp_get_nav_menu_object( $instance['nav_menu'] ) : false;

    if ( !$nav_menu )
    return;

    $instance['title'] = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base );

    echo $args['before_widget'];

    if ( !empty($instance['title']) )
    echo $args['before_title'] . $instance['title'] . $args['after_title'];

    I would really appreciate some guidance here.

    :0)

Topic Closed

This topic has been closed to new replies.

About this Topic