seo – Embed sitemap in a page

Question

I’ve seen that many sites have a dedicated page for a sitemap, not just an .xml file.

For example, https://www.casinos.de/sitemap/ They’re using Yoast SEO and sitemap.xml is also available, but how can you embed the whole sitemap in a page like this?

Is there a function or just a file_get_contents()?

in progress 0
HenrijsS 7 months 2022-01-06T04:58:24-05:00 0 Answer 0 views 0

Answer ( 1 )

    0
    2022-01-07T01:37:32-05:00

    You can fetch all the different post_types you have by using get_post_types(). Then you can loop through all posts of each post_types and echo all these posts (title + link). That way you have the freedom of formatting your sitemap the way you want.

Leave an answer

Browse
Browse