I think you want:
if( get_page_by_title( 'home' ) == NULL )
create_pages_fly( 'home' );
Your original if
condition said if the page exists (does not equal NULL), then create the page. Also, the 2nd argument should be a string, though it doesn’t really matter in this case since it’ll just default to 'page'
anyway.
Related Posts:
- Editing Complex Pages in Visual Mode
- Change admin startpage to Pages-page?
- Different fields in My Profile page depending on user role
- What’s the most minimal way in which a page can be hooked into WP?
- Associate Page with User
- Static files or dynamic WP pages for “static content”?
- CMS: Making complex pages editable by the end user
- Remove specific page/post from feed
- Custom page template not working
- How to detect if is_404() or is_page() or etc…? [closed]
- Redirect page to default subpage
- How can I use “getarchives_where” to get monthly archives for static pages?
- Add a static page that links to homepage
- Create page template with some static contents
- Can I change the “Home” text in the menu?
- Get rid of “comment” field on non-blog pages [duplicate]
- How do you set the default page in WordPress?
- Pages that don’t look like blog posts?
- After creating a new page, filling the page with structure
- Problem with deleting a “Page”
- How do I make just one of my pages a Blog Page?
- pagination does not work with query_posts. Help! [duplicate]
- How to remove title (home) from static page skeleton template
- Multiple WordPress Pages
- How to create an user defined page?
- Load new Posts on Scroll on Page
- Default pages to be unpublished – possible?
- How to remove the trackback and pingback text on the bottom of my pages?
- How to display text of a page in home or custom page?
- Create a plugin to create a new page in wordpress for each time a record is added into the database
- How to set post slug when using wp_insert_post();?
- Check if is on child-page of a particular page
- Restrict admin access to certain pages for certain users
- WordPress parent select need to be removed
- Limit number of pages that use a specific template?
- How to get a feed for post type ‘page’?
- Multiple pages on a single page
- WordPress post/page pagination (page links) to go back to the first section
- Show different badge based upon the user role
- Programmatically add a custom page/path/url/route to WordPress
- Dashboard–> All Pages “How to create folders?”
- Putting footer content in a “page” – Doing it wrong?
- How to create wordpress page that shows posts with specific tags?
- Is there a better way to programmatically insert content into a page?
- How to get the order attribute of a page
- How to Add a Rewrite Rule for Only One Page?
- Are Pages the right thing to use for making sections of a single-page site?
- Allow contributors to create page (but not publish)
- How do I pass data from page content to the underlying PHP template
- add new metabox to page editor with just page parent
- How to redirect login and register pages
- I Changed the Menu Order, But the Page Order Didn’t Change on Front Page
- Combining ‘depth’ with ‘include’ in wp_list_pages()
- Page template no longer exists – metaboxes won’t save
- A static page view call every custom page templates
- Wrapping images in tags based on size
- Create custom page and add it in nav menu by code
- How to control who can view certain pages in BuddyPress? [closed]
- How to add prefix slug in static wordpress page?
- How do I reclaim either deleted pages or their permalinks?
- access control for assets in a website powered by wordpress
- How to remove only pages from Admin Bar?
- How to make a page unsearchable in blog search?
- Published pages missing
- Getting ACF Field in Page – From the Footer
- Rewrite to load homepage for a different url
- logout redirect only from admin page
- How to change the order of the Front Page so it doesn’t appear first
- Change Site Logo or Menu Logo Per Page
- What is the best way to make a custom page from a plugin?
- Static Website No Titles But Still Nav
- Embedding Password Protected (Private) “Blog Posts” BLOCK that shows Images and Excerpts on Password Protected Page (not the home page)
- How to hide a page in wordpress made for menu
- My pages are using my Index.php and not my page.php
- WordPress custom pages in a folder
- How to change default home link title?
- New Page/Post Screen Opens an Existing Post
- Return true if parent page id matches
- Recovering a page from the drafts
- Pulling images from the media folder category to display inside a page
- My Password Protected Pages Aren’t Working
- How to detect if some page template has been selected
- Why Google map can not show full size in a page?
- Page view displays not properly after update wordpress
- How do I set content in my pages so that it remains permanent while blog posts are added below?
- Permalink base only for posts
- Converting HTML to WordPress theme: integrating pages function and using its text editor, conditional enqueuing
- Display custom_post_type with current taxonmy of a page
- WordPress slow pages/post, hangs and white text
- Prevent page from displaying
- Custom Filter using meta_value in wordpress admin list not working
- Loading custom jQuery and HTML in a WordPress page
- Add feed to a custom page
- Dynamic content in pages
- How to duplicate “Pages” section in the control panel?
- Javascript will not run properly
- link a custom page into menu
- Show different number of posts on second page of category
- How can a user login on a wordpress page?
- For some reason my posts are not showing up on my front page [closed]