• Resolved jeroenm77

    (@jeroenm77)


    I’ve installed the responsive menu and tried both with the shortcode option disabled as with a shortcode call in my header.php. For now I have “Use Shortcode?” in the Advanced tab in the settings disabled. I have tested the menu for desktop screen sizes and mobile. This works great for almost every page except for one page. This particular page, called detail.php gets loaded through a rewrite rule in my themes function.php. On this page the normal menu shows, but on smaller displays the responsive menu doesn’t show.

    Everything seems to load correctly except that the menu doesn’t show but instead it keeps showing the original non-responsive menu. Further searching points me to believe the shortcode doesnt get processed. In my details.php page I do call get_header and get_footer and in the header.php the body_class gets called. If I add a class name in the the call to body_class it shows up in the source in my browser, which makes me think that it has to do with the order of the calls to processing the shortcode and the rewrite rule, but that’s about where my knowledge fails me and I dont know how to check or fix this. Any thoughts please?

    • This topic was modified 7 years, 7 months ago by jeroenm77.
    • This topic was modified 7 years, 7 months ago by jeroenm77.
    • This topic was modified 7 years, 7 months ago by jeroenm77.
    • This topic was modified 7 years, 7 months ago by jeroenm77.

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Peter Featherstone

    (@peterfeatherstone-1)

    Hey there,

    I can’t see the shortcode text or output of the shortcode in the page anywhere so it seems the shortcode is not even being attempted to be loaded on that page.

    How are you trying to place the shortcode on the page and in which file? You say you call get_header and get_footer, can you confirm that wp_head() and wp_footer() are always called as part of that?

    Does the menu load on that page without the shortcode option turned on?

    Please let me know

    Peter

    Thread Starter jeroenm77

    (@jeroenm77)

    I can’t see the shortcode text or output of the shortcode in the page anywhere so it seems the shortcode is not even being attempted to be loaded on that page.

    I had the shortcode switched off, since loading with the shortcode in the headers seems to give a small glitch while loading. I have enabled it again now.

    How are you trying to place the shortcode on the page and in which file?

    I added this call: echo do_shortcode('[responsive_menu]'); in my header.php file, just before the line wp_head();.

    You say you call get_header and get_footer, can you confirm that wp_head() and wp_footer() are always called as part of that?

    I’m not 100% sure, what would be a sure way of telling?

    Does the menu load on that page without the shortcode option turned on?

    No, that gives the same result, the menu not showing.

    Peter Featherstone

    (@peterfeatherstone-1)

    I added this call: echo do_shortcode(‘[responsive_menu]’); in my header.php file, just before the line wp_head();

    This might be your issue. The shortcode should not go in the <head> section of your site. It needs to be somewhere between the opening and closing <body> tags.

    Peter Featherstone

    (@peterfeatherstone-1)

    Hi again,

    After your last comment I can see that the HTML for this page is completely incorrect with lots of lots of errors as you can see below:

    https://validator.w3.org/nu/?doc=https%3A%2F%2Fwww.nedcars.nl%2Fdetail%2F60-a-promo-auto-e-g-opel-karl%2F%3Fcats%3D1

    You will need to correct these fundamental errors at least to have this page working correctly.

    All the best

    Peter

    Thread Starter jeroenm77

    (@jeroenm77)

    echo do_shortcode(‘[responsive_menu]’); //enable this when “Use shortcode” is enabled in the “Responsive Menu” Advanced settings page.

    I have changed this, but not with the desired effect.

    You will need to correct these fundamental errors at least to have this page working correctly.

    ok, will give that a try first. Thanks for you input Peter!

    Peter Featherstone

    (@peterfeatherstone-1)

    Hey there,

    No problem. Please let me know what you find 🙂

    Peter

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Menu not showing on page loaded through a rewrite rule’ is closed to new replies.