How to add a code for lastpostdate after/inside a specific menu link?

So, I have a news website. The designers want me to have a link in the menu that says “Latest News – [time of the last post]”.

I know I can get the datetime of the latest post with get_lastpostdate().

But how can I put this php code inside the menu? This specific link is not the first one nor the last. It’s inside the menu structure. Menus in this website are made trough the usual custom menu tools of wp.

Any ideas?

Read more here: How to add a code for lastpostdate after/inside a specific menu link?

Leave a Reply

Your email address will not be published. Required fields are marked *