Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
  • #1423689

    on some customer pages i got (top-level) menu-items that shows f.e. blog-post of a given category.
    is it possible to dynamically hide those menu-items if there is no post inside. The page shows in this case that message of no_criteria_matched : “Sorry, no posts matched your criteria”
    It would be nice if the corresponding Menu-Items are then removed ( or hidden ) dynamically.


    Hey Guenter,

    Thank you for the inquiry.

    You might be able to use the wp_ajax_{$action} function to create a script that queries a certain category and hides a specific menu item if the query returns nothing.


    Best regards,


    next special question :
    there is on github a wp-core snippet:
    btw. on your docu there is a dead link concerning to this.
    It is for duplicate post/pages without plugin. It works – but portfolios are excluded from that trick.
    how to include portfolios there ( or better to include a CPT )

    here is the pastbin page from my edited php:
    But : this is only a file that is translated inside to english where there are in original spanish terms. On those lines that are visible to users i only had insertet the option to translate strings with avia_framework



    Thanks for the heads up. I fixed the broken link :)




    This snippet was proposed by a user and we added it to our library 1:1 in case the original post would become offline – and we did not even test it.

    But I will add it to the dev repo to extend it for any post type.

    Best regards,


    it is working nice – but did not involve the portfolio – and i could not find out why. Portfolio are at least posts so – where is the crux?



    The code is limited to pages and posts. For next release I will add this to core also for any CPT.

    Best regards,

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