• Resolved toddlevy

    (@toddlevy)


    Hey there –

    Trying to figure out the best way to set a custom news sitemap URL.

    This used to be possible via the “xmlsf_sitemaps” option…

    Array
    (
        [sitemap-news] => my-custom-url.xml
    )

    Now, however, that value isn’t used and instead, the rewrite rule is hardcoded…

    if( isset($sitemaps['sitemap-news']) ) {
      add_rewrite_rule('sitemap-news\.xml$', $wp_rewrite->index . '?feed=sitemap-news', 'top');
    }

    Curious what the recommended approach would be to customize this without hacking that line in the plugin?

    Thanks,
    TL

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Rolf Allard van Hagen

    (@ravanh)

    Hmmm, you did that in the database before? You might do this instead (in a custom/child theme) now:

    
    add_rewrite_rule('my-custom-url\.xml$', $wp_rewrite->index . '?feed=sitemap-news', 'top');
    

    … or set up permanent redirect in your .htaccess file maybe?

    Thread Starter toddlevy

    (@toddlevy)

    All set with this solution.

    Thank you for the prompt, helpful reply.

    Plugin Author Rolf Allard van Hagen

    (@ravanh)

    Which solution did you choose?

    Thread Starter toddlevy

    (@toddlevy)

    Dropped a rewrite rule in the functions file and flushed the permalinks.

    Plugin Author Rolf Allard van Hagen

    (@ravanh)

    Excellent, thanks for sharing ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Ability to set news sitemap URL’ is closed to new replies.