Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Jupitercow

    (@jcow)

    This is actually built in as a filter:

    /**
     * Change sitemap frequency in XML, default is "monthly"
     *
     * always, hourly, daily, weekly, monthly, yearly, never
     */
    apply_filters( 'sewn/sitemap/frequency', 'custom_sitemap_frequency' );
    function custom_sitemap_frequency( $frequency, $post )
    {
    	if ( 'news' == get_post_type($post) ) {
    		$frequency = 'daily';
    	}
    	return $frequency;
    }
    Plugin Author Jupitercow

    (@jcow)

    Dumb mistakes in that function. Here it is fixed:

    /**
     * Change sitemap frequency in XML, default is "monthly"
     *
     * always, hourly, daily, weekly, monthly, yearly, never
     */
    add_filter( 'sewn/sitemap/frequency', 'custom_sitemap_frequency', 10, 2 );
    function custom_sitemap_frequency( $frequency, $post )
    {
    	if ( 'unit' == get_post_type($post) ) {
    		$frequency = 'daily';
    	}
    	return $frequency;
    }
    Thread Starter Creative Slice

    (@creativeslice)

    Thank you, this works perfectly!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Change ?’ is closed to new replies.