Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter traineradd

    (@traineradd)

    UPDATE: I checked through some old support posts and found an issue similar to mine. You instructed to add:

    add_filter(‘bwp_gxs_freq’, ‘my_freq’);

    function my_freq($freq, $item)
    {
    // ‘weekly’
    }

    To the theme functions.php file which I did: https://gyazo.com/575023881a56fb4ee0a9c929047b8137

    Now in the post sitemap the frequency is not showing at all? What does this mean? Is this bad? Does this solve my yearly issue because priority is set to 1.0? Did I do something wrong with the code? https://gyazo.com/6476546ab884ceca8b6a942eef9d4dd0

    Plugin Author Khang Minh

    (@oddoneout)

    Hello, thanks for using BWP Google XML Sitemaps.

    As stated in the setting page, default values are only used when valid ones can not be calculated. Using a filter is the correct way to go.

    Inside your my_freq function you must return a value, for example:

    function my_freq($freq, $item)
    {
        return 'weekly';
    }
    

    For more info, see: https://api.betterwp.net/bwp-google-xml-sitemaps/master/hooks.html#filter_bwp_gxs_freq

    Thread Starter traineradd

    (@traineradd)

    Thanks for getting back to me. So just be 100% clear, what is the exact code I need to add to change my post frequency from yearly to weekly and, were exactly need I need to add it (in which file)?

    Thread Starter traineradd

    (@traineradd)

    UPDATE: I fixed the issue, this code worked:

    add_filter(‘bwp_gxs_freq’, ‘my_freq’);

    function my_freq($freq, $item)
    {
    return ‘weekly’;
    }

    I added it to my themes function.php file

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to change post frequency from yearly to weekly?’ is closed to new replies.