Auto Draft in menu isn't disappearing

Hello,

I'm trying to get rid of the "Auto Draft" in the menu of our new site. I've watched your video (link below). Theme Editor isn't available, so I downloaded a plugin to put the code (below) in the Theme Functions, but "Auto Draft" is still in the menu.

Thanks. JL

https://www.youtube.com/watch?v=-qEI5ZFO3VU


/**

* Hide Draft Pages from the menu

*/

function filter_draft_pages_from_menu ($items, $args) {

 foreach ($items as $ix => $obj) {

 if (!is_user_logged_in () && 'draft' == get_post_status ($obj->object_id)) {

  unset ($items[$ix]);

 }

 }

 return $items;

}

add_filter ('wp_nav_menu_objects', 'filter_draft_pages_from_menu', 10, 2);

Comments

  • edited October 20

    Never mind the auto draft remaining on the menu; it finally disappeared. Thank you. I have another question: right now, when you hover over an item in the menu that has a submenu, the items in the submenu appear, but most of the items are below my screen. I have a MacBook Pro with a rather small screen, but I still need to fix it nevertheless. We're using the Author theme, please see attached image.

    Thanks, JL


  • Hi,

    Please always attach a link to your website so we can check it out. If the page is offline(localhost), then our help will be limited. You will have to contact us when the page is online. Also, please make sure that the page is not under maintenance before you provide us with the link.

    Thanks

  • I'm so sorry about that, here's the live website: www.rafeller.com.

    Thank you, JL

  • Hello,

    About the same URL, www.rafeller.com, I made a video about a few more things. The main image on the front page overlaps the books below; the image is repeating despite the settings changed, and the text on the front page is not where it should be. Here's the video: https://drive.google.com/file/d/1U1MNBDQFSs_vouiNHaOWnkFiGxcdy5A2/view?usp=sharing

    Blessings, JL

Sign In or Register to comment.