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' );
}
Related Posts:
- How to make my front page display only the most recent sticky post, plus usual widgets?
- How do I set the front page programmatically?
- Custom background for the index page only?
- Load front-page.php from subfolder
- Can you select a post as the front page or only pages?
- Can’t edit front page of website [closed]
- How to block access to blog-page for users not logged in?
- Pagination not Working on only Front page on latest verson of WordPress
- Do I need an empty page for a different blog page?
- Showing option when page is frontpage
- Is it possible for homepage in Twentyseventeen theme to look like a standard page?
- WordPress site front page fails to load in IE
- Home/front page won’t display content after a form is submitted
- how to create a static front page for my blog in wordpress
- Home link in the homepage of my wordpress does not show my blog posts
- WordPress, how to figure out how to edit front page
- How to set a static html front page
- NON Static-Front Page
- Front Page Settings
- What code controls the animation for the front-page header in TwentySeventeen
- Setting index.php as a static home page without posts?
- Implement a slideshow-like frontpage with text overlays
- Showing “best posts” in front page
- Pull in content from page defined as static front page
- Excluding front_page from is page condition
- Why does my site show the correct front-page when you arrive at the site, but not when you click ‘home’?
- Change Front Page Word Press 4.1
- custom change in front page [closed]
- Remove edit post link from static front page
- WordPress certain directories not connected
- Different front page for logged in and logged out user but the same URL in WordPress
- Homepage not working after setting as frontpage
- Hiding New Posts on Front Page
- change header height on 2017 theme for logged in users
- How to connect front-page.php to page in admin panel?
- Can I have two websites with one front page
- I created a new home page and set it as the home page in the reading section, but I get an error when typing in the home page url
- Categories with post from child categories on front page
- Static front page – going against the grain
- When Front page and Posts page are specified is it possible to just have front-page.php as the home page?
- Custom background for the index page only?
- No posts on front page
- How to display only sticky posts on my automatically generated front page?
- Front page welcome message area
- Static front page as parent of with child pages?
- How did WordPress link an empty page at dashboard to an actual php file?
- When to use is_home() vs is_front_page()?
- What is the correct method for determining ‘is_front_page’ when using filters such as ‘pre_get_posts’ and ‘posts_where’?
- How to prevent the default home rewrite to a static page
- How to display 3 different loops in 3 columns on homepage
- `post_type` => `any` not giving me my custom post
- Pagination is somewhat working on frontpage, doesn’t update when “prev” is clicked
- Setting a static home page and blog page without using the settings
- Shortcode not working on static front page
- Create static front-page with 3-5 recent posts
- What does choosing a Post Page do?
- Loop first six posts in carousel, next eight in grid
- Detect if current page is front page within custom query
- Customizer Settings in Arrays
- Pagination w/Static Front Page
- White screen on front page only
- Can I have both front-page.php and index.php?
- Conditional menu display
- Prevent other versions of jquery from loading on static front page
- Why: sticky front page code, shows latest non-sticky on logged-in front page
- dynamic sidebar in front page
- Best Practice for Displaying Categorized Posts on Front Page
- Using front-page.php need new blog page
- How to conditionally add Custom Post Type to Front Page
- How to change “Call To +1800090098” in TopStore pro theme [closed]
- How do I activate a certain block template only when editing the front page?
- plugin content on front-page only. Nowhere else
- How to test if a specific page is the front page?
- How to show only the name of one category above each posts in frontpage?
- WordPress loop not working on static front page
- Frontpage pagination by week
- Problem with Front-Page.php loading recent posts
- 1 post per category on homepage and counting those posts
- Why can’t I gain access to my homepage images?
- How to make transition slider load before home page
- ‘Nothing found’ on home page after custom CSS edit
- Image is missing on site homepage
- After update Woocommerce shop page not showing products
- List posts of custom post type under category name
- How to echo site url if not on index.php while using anchor based nav
- Front page showing ACF only once, is that solvable to show the ACF per post? [closed]
- Category and Posts in front page
- Letting wordpress decide what template and page to use based on condition
- How to add dynamic content in title and meta description in wordpress theme for homepage, post page, category, tag and pages
- When I select a page for frontpage, it is blank
- Wonderflux Framework Static Homepage
- Edit a template while still keeping a Landing Page on the main address
- URL of blog when using index.php as blog and front-page.php as homepage
- Problem with custom page template and permalink
- How to make my homepage automatically redirect to an external website?
- plugin: ‘init’ hook, check if we’re not in admin
- front page won’t change templates
- wp_head not injecting css
- Show custom category archive as front page and remove taxonomy slug from urls
- Post page appears without images + formatting