WooCommerce Force Frontpage

If your front page changes in any scenario, you can use the codes below.

$homepage = get_page_by_title( 'Homepage' );

if ( $homepage )
{
update_option( 'page_on_front', $homepage->ID );
update_option( 'show_on_front', 'page' );
}

Written by Uğur

Leave a Reply

Your email address will not be published. Required fields are marked *