For example, when using wp_nav_menu function, WP automatically generates menus with the following structure of elements and classes

    <li class="menu-item current-item"><a href="#">Item</a></li>
    <li class="menu-item"><a href="#">Item</a></li>
    <li class="menu-item"><a href="#">Item</a></li>

Is there a documentation where I can find all default HTML structure, elements and classes generated by WordPress functions, so I can instruct better the Front-End Developer about how to code better when constructing the HTML of a WordPress theme?

1 Answer 1


As for a function like wp_nav_menu, it is very well documented in the codex as you can see from the link. Some functions are very well documented, others not that well. You can do the following

  • Start at the codex. You'll find (almost) every native function that Wordpress uses in the codex. Like I said, some well documented, some not, and one or two non existent

  • You should also dig around in the core files for a specific function. The functions in the codex have a link (via core.trac.wordpress.org) to the specific file in Wordpress where the function is registered

  • If you can't find any documentation in the codex, do a few online searches. There are some good tutorials out there that might answer your question

  • Lastly, get yourself a proper browser, like google chrome. I have been using google chrome ever since, and I love their Inspect element feature. If you need to know the HTML structure of a specific element, simply right click on the element, select Inspect element and a small window at the bottom opens with the HTML structure.

Apart from all the above, there is no specific documentation out there specifically designed to showcase the HTML structure of functions within Wordpress

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.