[Resolved] Child theme loses menu in mobile view

Home Forums Support [Resolved] Child theme loses menu in mobile view

Home Forums Support Child theme loses menu in mobile view

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #211965
    Craig

    Hi,

    I’m fairly new to WP. I’ve created a child theme of GP, but when viewed on mobile it doesn’t display the menu. When I switch back to GP it works fine. I’ve searched for the @import url(“../generatepress/style.css”); line as discussed in other answers, but it’s not used, so that’s not the problem. Any suggestion as to where to start looking?

    #211978
    Tom
    Lead Developer
    Lead Developer

    Do you have anything in your functions.php file?

    #212495
    Craig

    Yes, I have the following:

    
    <?php
    /**
     * Enqueue scripts and styles
     */
    add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
    function my_theme_enqueue_styles() 
    {
    	// Enqueue our CSS.
    	wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
    
    }
    ?>
    
    #212512
    Tom
    Lead Developer
    Lead Developer

    Ah yes, you’ll want to remove that so only this exists in the file:

    <?php

    GP adds the parent style.css file for you – so that function is doing it for a second time which is causing the issue.

    #212532
    Craig

    I tried
    <?php
    but the site doesn’t load.
    I presume you mean

    <?php
    ?>
    

    I currently have that, but the menu still doesn’t work.

    #212533
    Tom
    Lead Developer
    Lead Developer

    Hmm, that closing ?> shouldn’t be necessary.

    Maybe it just wants an extra line:

    <?php
    // PHP code below this line
    #212637
    Craig

    If I put the REM statement in, or just leave a blank line it loads the page. If I only have 1 line, opening the php statement, it fails to load the page.
    However, the menu still doesn’t display.

    #212733
    Tom
    Lead Developer
    Lead Developer

    Can you link me to the site so I can take a look?

    #213804
    Craig

    Sorry, missed your reply.
    Site is
    http://www.concordlodge.nl/

    #213885
    Tom
    Lead Developer
    Lead Developer

    This is still happening because your child style.css has all of the parent CSS in it.

    Your child theme style.css should only contain your custom CSS – nothing else.

    #214257
    Craig

    Yes, thank you. It’s obvious now you point it out. Thanks for all your help.

    #214369
    Tom
    Lead Developer
    Lead Developer

    You’re welcome 🙂

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.