WordPress Sitemap including pages that aren’t there
WordPress Sitemap including pages that aren’t there
WordPress Sitemap including pages that aren’t there
Custom post type + category archive page
There are a lot to choose from. I would start with wp_sitemap_init, whose documentation states Additional sitemaps should be registered on this hook. Note that you’ll have to be running WordPress 5.5.0 or up for this hook to be available. Looking at the code, it appears that this action allows you to register new items … Read more
sitemap contains weird links and does not contain my pages [closed]
How about looping all available terms, if term has description, add to to an object_ids, something like this. add_filter( ‘wp_sitemaps_taxonomies_query_args’, function( $args, $taxonomy ) { // Show in sitemap categories and topics that have a description if ( $taxonomy == ‘category’ || $taxonomy == ‘post_tag’ ) { // get the terms of the taxonomy $terms … Read more
It’s actually not an issue at all, it works just like it’s supposed to, be sure to submit the index sitemap though, not the individual ones, so submit sitemap_index.xml. See this screenshot for reference to show that it works:
Normally, if there’s a WordPress file on disk, that’ll be served first directly by Apache or Nginx, before WordPress gets involved. This is done in your virtualhost config, e.g. in Nginx you’ll typically find the following, which tells it to try actual files first before letting index.php handle the URL and generate a page on … Read more
You should call wp_nav_menu() in your footer.php template. It’s used as following : <?php wp_nav_menu( array(‘theme_location’=>’footer’) ); ?> The theme_location parameters refers to the checkboxes below the menu editor (Theme location). If your theme doesn’t have enough theme_location, you can add some by adding function register_html5_menu(){ register_nav_menus(array( ‘footer-1’ => __(‘Footer Menu 1’, ‘theme_translation_domain’), )); } … Read more
Sitemaps belong to a domain. Not sure if there is any special code that lets you extend the main site’s sitemap, but you can always use the sitemao directive in robots.txt “file” of your domain, either by editting it “manually” (probably one of the SEO plugin can help with doing it without breaking anything) or … Read more
You have to slightly modify your query on your above code as: $postsForSitemap = get_posts( array( ‘numberposts’ => -1, ‘orderby’ => ‘rand’, ‘post_type’ => array( ‘page’ ), ‘post_parent’ => 0, ‘order’ => ‘DESC’ ) ); if you want all page without parent as you have used to get parent pages only. It will generate a … Read more