Previously I shared a post on how to Set Reading Settings Programmatically. The code below takes it a step further by first creating the required pages, if they do not exist, needed for their respective settings. Thanks to the after_setup_theme() function, the process will run on activation of the theme.
[gist id=”2f6b40a4bd57e0ddbe5da19c4e575f63″]