Can’t edit front page of website [closed]

From my experience, some themes have their own setting with options to display additional information on the homepage. To find out what’s being used for the front page, do the following: Navigate to Settings > Reading Under Front page displays it will show which page is being used It’s hard to determine what your set … Read more

Custom background for the index page only?

You can check in your callback function if you are an the front page. Sample code for the theme’s functions.php: add_action( ‘after_setup_theme’, ‘wpse_67480_theme_setup’ ); function wpse_67480_theme_setup() { $bg_options = array ( ‘wp-head-callback’ => ‘wpse_67480_background_frontend’, ‘default-color’ => ‘f0f0f0’, ‘default-image’ => ”, ); add_theme_support( ‘custom-background’, $bg_options ); add_theme_support( ‘custom-header’, array ( ‘width’ => 960, ‘height’ => 200, … Read more

How do I set the front page programmatically?

If you manually enter the admin URL wp-admin/options.php you’ll see a list of all options and their values. show_on_front is page when a page is selected to show on front. page_on_front and page_for_posts are 0 when no pages are chosen. You can use update_option to change these values, there is no set_option function.

Programmatically set page_on_front

get_page_by_title() returns an object. Use $homepage->ID. You should also check if you really got a usable return value: $homepage = get_page_by_title( ‘Front Page’ ); if ( $homepage ) { update_option( ‘page_on_front’, $homepage->ID ); update_option( ‘show_on_front’, ‘page’ ); }