Site logo

Archived topic

Secondary menu/Hooks

3 replies · Started by Joseph on March 18, 2015

Viewing posts 1–4 of 4

Going nuts, used this code to allow for mobile sizing but still pulling down the images to the middle of the secondary menu.
The code placed in the style sheet and the images are in the after header section in inline code.

@media screen and (min-width: 769px) {
.sample-class {
margin-top:-219px;
margin-bottom:130px;
margin-left:10%;
}
}

This is code in the After Header in Generate Hooks.

You can see here what is happening. provinciawebdesign.com/patronmag when you go into mmobile view.

What exactly are you wanting to achieve? The secondary menu displays beneath the "After Header" hook?

When you vie the site on a mobile device and pull down
The secondary menu, it pulls the logo
And other image to the middle of the secondary
Drop down menu. How do I keep the logo and other image in p k ace and in responsive size (smaller)

Hmm, well using negative margins and whatnot will cause weird issues like this - it's usually best to avoid them.

We can move the secondary navigation below the hook with this code:

add_action('after_setup_theme','generate_move_secondary_nav');
function generate_move_secondary_nav()
{
      remove_action( 'generate_after_header', 'generate_add_secondary_navigation_after_header', 7 );
      add_action( 'generate_after_header', 'generate_add_secondary_navigation_after_header', 11 );
}

You can add the above code using your child theme's functions.php file, or this plugin: https://wordpress.org/plugins/code-snippets/

Doing so will make it so you no longer have to use negative margins.

Let me know :)

This archived topic is closed to new replies.