Forum Replies Created

Viewing 2 replies - 16 through 17 (of 17 total)
  • ShdMstr

    (@shdmstr)

    Few thing, first do not know what browser are using, already tried mozilla 3.6.12 chrome 0.9 and internet explorer 8 and I can not see the line that you mention…

    just two ideas that probably help you, first try that page in another computer… can be your monitor that is wrong or it’s going wrong soon?…

    the other that occurs to me it’s if you have mozilla firefox and install the firebug addon that can help you to pin point the exact element that it’s causing problems, and if it’s that you can create a css rule with that element and just put display:none and that should help…

    Hope this helps….

    I was trying to do the same to develop my theme and stumble this article and really help me to learn about this. Needless to say “Thank You All” for sharing your knowledge with others that may have this problem(like me…).

    I did a little modification to it(again). what I did was to add a class for the title to be able to style it with css. with this method you can style both the title and the description, using different classes in the css. Other thing I did was to include both, the title and the description in the same link so both of them are clickable not just the title (they are now in the same block LI with different classes)… here is the code

    just one comment before the code, you can change name of the class of the title or the name of the class sub if those cause a conflict in your page…

    <?php
        class My_Walker extends Walker_Nav_Menu
    {
        function start_el(&$output, $item, $depth, $args) {
            global $wp_query;
            $indent = ( $depth ) ? str_repeat( "\t", $depth ) : '';
    
            $class_names = $value = '';
    
            $classes = empty( $item->classes ) ? array() : (array) $item->classes;
    
            $class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) );
            $class_names = ' class="' . esc_attr( $class_names ) . '"';
    
            $output .= $indent . '<li id="menu-item-'. $item->ID . '"' . $value . $class_names .'>';
    
            $attributes  = ! empty( $item->attr_title ) ? ' title="'  . esc_attr( $item->attr_title ) .'"' : '';
            $attributes .= ! empty( $item->target )     ? ' target="' . esc_attr( $item->target     ) .'"' : '';
            $attributes .= ! empty( $item->xfn )        ? ' rel="'    . esc_attr( $item->xfn        ) .'"' : '';
            $attributes .= ! empty( $item->url )        ? ' href="'   . esc_attr( $item->url        ) .'"' : '';
    
            $item_output = $args->before;
            $item_output .= '<a'. $attributes .'>';
            $item_output .= '<span class="title">' . $args->link_before . apply_filters( 'the_title', $item->title, $item->ID ) . '</span>' . $args->link_after;
            $item_output .= '<span class="sub">' . $item->attr_title. '</span></a>'; /* This is where I changed things. */
            $item_output .= $args->after;
    
            $output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );
        }
    }
    ?>

    By the way this is my first contribution to www.remarpro.com and I am still learning, I’m a beginner, and still developing my first theme.

    I hope this help you people

    PD. my English it’s not that good because it’s not my first language so, please forgive the inconsistencies in the text-form / spelling etc.

Viewing 2 replies - 16 through 17 (of 17 total)