WordPress.org

Ready to get started?Download WordPress

Forums

Advanced Menu Widget
[resolved] diff to only show the widget when there are pages to show. (7 posts)

  1. tmuka
    Member
    Posted 2 years ago #

    I made this small patch to fit my use case where I only want to show the widget on pages when it will show child pages. I didn't like the default behavior where there would be an empty widget ul when there were no pages to list.

    Feel free to use/adapt/modify this code... Thanks for writing this great plugin so i didn't have to!

    [Code moderated as per the Forum Rules. Please use the pastebin]

  2. tmuka
    Member
    Posted 2 years ago #

    oops. here's the pastebin link... http://pastebin.com/auQyLyZy

    please let me know if you have any questions :)

  3. Sebastian Cork
    Member
    Posted 2 years ago #

    Thanks for sharing. I hope to see this included in a future update of the plugin.

  4. mashasauer
    Member
    Posted 1 year ago #

    Hi tmuka,
    I need to do the same thing and not show the widget if it's empty. Can you please resend the code as this link above is not working any more.
    Thank you.

  5. tmuka
    Member
    Posted 1 year ago #

    Hey mashasauer,

    Sorry, seems pastebin automatically expires old content or something. I don't even remember which site i did this for anymore. I'll have to dig around and see if i can find my code.

  6. mashasauer
    Member
    Posted 1 year ago #

    Hi tmuka, thank you for your quick response.

    it would be great if you could find it, as I really need to do this and I haven't found much on this topic.

    Thanks anyway for trying.

  7. MWB
    Member
    Posted 1 year ago #

    hi tmuka!
    just found this thread because i am running into the same problem - would you be able to share the code again? many thanks in advance!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic