• Hi,

    I am running WordPress on my own server and have made a number of modifications and am fairly well versed in HTML and CSS,but am getting a little stuck when it comes to solving this particular issue.

    Basically,I want to have the Menu Toggle Button which is native to to the Twenty Sixteem theme so it displays at all times at all screen resolutions and the menu is permanently collapsable,rather than just at certain screen sizes.

    I assume this is something to do with the media queries involved in calling the button.

    As ever,any help would be greatly appreciated.

Viewing 15 replies - 61 through 75 (of 89 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    In your Child Theme functions.php* file, try replacing this:

    wp_enqueue_script( 'twentysixteen-child-script', get_stylesheet_directory_uri() . '/functions.js', array('jquery'), '20151204', true );
    
        wp_localize_script( 'twentysixteen-script', 'screenReaderText', array(
            'expand'   => __( 'expand child menu', 'twentysixteen' ),
            'collapse' => __( 'collapse child menu', 'twentysixteen' )
        ) );

    With this:

    wp_enqueue_script( 'twentysixteen-child-script', get_stylesheet_directory_uri() . '/functions.js', array('jquery'), '20151204', true );
    
        wp_localize_script( 'twentysixteen-child-script', 'screenReaderText', array(
            'expand'   => __( 'expand child menu', 'twentysixteen' ),
            'collapse' => __( 'collapse child menu', 'twentysixteen' )
        ) );

    Thread Starter Wolfman1000

    (@wolfman1000)

    still not playing ball

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    It’s really baffling why the parent theme’s functions.js file is still loading.

    Thread Starter Wolfman1000

    (@wolfman1000)

    Is that whats happening then?

    Thread Starter Wolfman1000

    (@wolfman1000)

    Could it be something to di with this in the footer?

    <?php if ( has_nav_menu( 'social' ) ) : ?>
    				<nav class="social-navigation" role="navigation" aria-label="<?php esc_attr_e( 'Footer Social Links Menu', 'twentysixteen' ); ?>">
    					<?php
    						wp_nav_menu( array(
    							'theme_location' => 'social',
    							'menu_class'     => 'social-links-menu',
    							'depth'          => 1,
    							'link_before'    => '<span class="screen-reader-text">',
    							'link_after'     => '</span>',
    						) );
    					?>
    				</nav><!-- .social-navigation -->
    			<?php endif; ?>
    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Is that whats happening then?

    Yes and I think it’s causing the main issue with the menu not toggling.

    Thread Starter Wolfman1000

    (@wolfman1000)

    I think that may only be to do with the ‘social links’,but maybe theres something in there..

    Thread Starter Wolfman1000

    (@wolfman1000)

    I see,if I recall I did edit the footer also,as by default on twenty sixteen the toggled menu also appears in the footer….

    let me pull in the original footer file

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Hang on

    Thread Starter Wolfman1000

    (@wolfman1000)

    I have now pulled in the original untouched footer.php,still the toggle isn’t working.

    Would you like me to put the footer code in a pastebin?

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Okay, try this… In your Child Theme functions.php file, try replacing this line:

    add_action( 'wp_enqueue_scripts', 'wpdocs_theme_name_scripts' );

    with this:

    add_action( 'wp_enqueue_scripts', 'wpdocs_theme_name_scripts', 100 );

    Thread Starter Wolfman1000

    (@wolfman1000)

    ok now the toggle is ‘toggling’ again..but still no nav menu

    Thread Starter Wolfman1000

    (@wolfman1000)

    this is with the original footer.php there now though

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Now try replacing this code at the bottom of your Child Theme style.css file:

    .toggled-on .main-navigation ul {
        display: block;
    }

    With this:

    .main-navigation ul {
        display: none;
    }
    
    .toggled-on .main-navigation ul {
        display: block;
    }

    Thread Starter Wolfman1000

    (@wolfman1000)

    We’re in business my man!!!!!

Viewing 15 replies - 61 through 75 (of 89 total)
  • The topic ‘Twenty Sixteen Theme- Having Menu button Permanent’ is closed to new replies.