• Resolved faunlf

    (@faunlf)


    I created a Menu in Post Dropdown menu with the placeholder “Choose a topic”. The placeholder does not show as the page is loaded; some random page shows instead. How do I get the placeholder to stay “in place”? Thanks!

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author linux4me2

    (@linux4me2)

    First, confirm that your shortcode looks something like the following:

    [menu_in_post_menu menu=3 style="dropdown" placeholder_text="Choose a topic..."]

    Where the “menu=” number is the ID of your chosen menu as created by the Menu In Post Tools, and the placeholder_text is in double quotes.

    The other thing I notice is that there is a recurring error in the HTML for the menu on your page. Every item has the “selected” attribute set to “selected.” None should be selected, allowing the placeholder to be the visible option. Since they’re all selected, it’s not surprising that you’re getting some weird, random results.

    Here’s the relevant HTML from your page showing all the options are selected:

    <option value="#">Choose a topic</option>
    <option value="https://test.mggno.com/resources-2/#agcenter" selected="selected">AgCenter Publications</option>
    <option value="https://test.mggno.com/resources-2/#Dan-Gill" selected="selected">Dan Gill</option>
    <option value="https://test.mggno.com/resources-2/#facebook" selected="selected">Facebook Pages to Follow</option>
    <option value="https://test.mggno.com/resources-2/#GNO-Gardening" selected="selected">GNO Gardening</option>
    <option value="https://test.mggno.com/resources-2/#Google-Search-Tips" selected="selected">Google Search Tips</option>
    <option value="https://test.mggno.com/resources-2/#master-gardener-favorites" selected="selected">Master Gardener Favorites</option>
    <option value="https://test.mggno.com/resources-2/#plant-societies" selected="selected">Plant Societies</option>
    <option value="https://test.mggno.com/resources-2/#inspiration" selected="selected">Sites for Inspiration</option>
    <option value="https://test.mggno.com/resources-2/#superplants" selected="selected">Superplants</option>
    <option value="https://test.mggno.com/resources-2/#youtube" selected="selected">YouTube Channels</option>
    

    I see that you’re using Elementor, which may be causing a conflict with the Menu In Post plugin, or some other plugin you’re running that handles menus could be the culprit.

    It also looks like you have the menu in a widget instead of in a post. If you’ve got it in a widget, I’d probably try moving it to the post and see if it fixes the problem before I did anything with Elementor.

    Since I’m guessing you want to keep Elementor even if it is causing the conflict, you could try the WordPress Menu Block instead of Menu In Post to see if it plays more nicely with Elementor than Menu In Post.

    Let me know what you figure out.

    Plugin Author linux4me2

    (@linux4me2)

    I have another idea for you. I’ve done some more testing, upgraded my test site to WP 6.2, and tested some more, but I can’t reproduce your problem. I’m going under the assumption that something–Elementor, or a theme/plugin that also affects menus that you’re using–is causing a conflict with Menu In Post, or causing the problem on its own.

    If you’re willing to do a quick test, we can see if disabling the code in Menu In Post that adds the selected="selected" attribute to the drop-down options for the current post/page gets it working for you.

    Use your favorite plain-text editor to edit /wp-content/plugins/menu-in-post/menu-in-post.php, and on line 157, change this:

    $attributes .= ' selected="selected"';

    to this:

    //$attributes .= ' selected="selected"';

    The two forward slashes at the beginning of the line turns the line into a comment so PHP will ignore it instead of executing the code, preventing Menu In Post from adding the “selected” attribute.

    Purge your cache if you’re using one, clear your browser cache, and visit your page again to see if it’s fixed.

    Take a look and see if all those selected="selected" still show up in your HTML.

    Plugin Author linux4me2

    (@linux4me2)

    Hi @faunlf

    Haven’t heard back from you, so I’m going to mark this as resolved.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Placeholder doesn’t remain inplace’ is closed to new replies.