Skip to main content
added 48 characters in body
Source Link
1.21 gigawatts
  • 1k
  • 3
  • 13
  • 34

I need to allow my users to set the default page of the blog. So when someone visits, "www.example.com/blog/" the page they see is either the blog posts list or a specific page.

It looks like I can tell which page is already set using:

get_option( 'page_on_front' ): returns the ID of the static page assigned to the front page. 

source

Can I change that by using:

set_option( 'page_on_front', 10 );

How would I remove a specific front page that has already been set? Do I set it to null?

UPDATE:

I found this call to check if showing blog posts:

get_option( 'show_on_front' ) == 'posts';

source

BTW This is on a network site (Wordpress MU).

I need to allow my users to set the default page of the blog. So when someone visits, "www.example.com/blog/" the page they see is either the blog posts list or a specific page.

It looks like I can tell which page is already set using:

get_option( 'page_on_front' ): returns the ID of the static page assigned to the front page. 

source

Can I change that by using:

set_option( 'page_on_front', 10 );

How would I remove a specific front page that has already been set? Do I set it to null?

UPDATE:

I found this call to check if showing blog posts:

get_option( 'show_on_front' ) == 'posts';

source

I need to allow my users to set the default page of the blog. So when someone visits, "www.example.com/blog/" the page they see is either the blog posts list or a specific page.

It looks like I can tell which page is already set using:

get_option( 'page_on_front' ): returns the ID of the static page assigned to the front page. 

source

Can I change that by using:

set_option( 'page_on_front', 10 );

How would I remove a specific front page that has already been set? Do I set it to null?

UPDATE:

I found this call to check if showing blog posts:

get_option( 'show_on_front' ) == 'posts';

source

BTW This is on a network site (Wordpress MU).

added 4 characters in body
Source Link
1.21 gigawatts
  • 1k
  • 3
  • 13
  • 34

I need to allow my users to set the default page of the blog. So when someone visits, "www.example.com/blog/" the page they see is either the blog posts list or a specific page.

It looks like I can tell which page is already set using:

get_option( 'page_on_front' ): returns the ID of the static page assigned to the front page. [source][1]

source

Can I change that by using:

set_option( 'page_on_front', 10 );

How would I remove a specific front page that has already been set? Do I set it to null?

UPDATE:

I found this call to check if showing blog posts:

'posts' == get_option( 'show_on_front' ); == 'posts';

source

I need to allow my users to set the default page of the blog. So when someone visits, "www.example.com/blog/" the page they see is either the blog posts list or a specific page.

It looks like I can tell which page is already set using:

get_option( 'page_on_front' ): returns the ID of the static page assigned to the front page. [source][1]

Can I change that by using:

set_option( 'page_on_front', 10 );

How would I remove a specific front page that has already been set? Do I set it to null?

UPDATE:

I found this call to check if showing blog posts:

'posts' == get_option( 'show_on_front' );

source

I need to allow my users to set the default page of the blog. So when someone visits, "www.example.com/blog/" the page they see is either the blog posts list or a specific page.

It looks like I can tell which page is already set using:

get_option( 'page_on_front' ): returns the ID of the static page assigned to the front page. 

source

Can I change that by using:

set_option( 'page_on_front', 10 );

How would I remove a specific front page that has already been set? Do I set it to null?

UPDATE:

I found this call to check if showing blog posts:

get_option( 'show_on_front' ) == 'posts';

source

added 138 characters in body
Source Link
1.21 gigawatts
  • 1k
  • 3
  • 13
  • 34

I need to allow my users to set the default page of the blog. So when someone visits, "www.example.com/blog/" the page they see is either the blog posts list or a specific page.

It looks like I can tell which page is already set using:

get_option( 'page_on_front' ): returns the ID of the static page assigned to the front page. [source][1]

Can I change that by using:

set_option( 'page_on_front', 10 );

How would I remove a specific front page that has already been set? Do I set it to null?

UPDATE:

I found this call to check if showing blog posts:

'posts' == get_option( 'show_on_front' );

source

I need to allow my users to set the default page of the blog. So when someone visits, "www.example.com/blog/" the page they see is either the blog posts list or a specific page.

It looks like I can tell which page is already set using:

get_option( 'page_on_front' ): returns the ID of the static page assigned to the front page. [source][1]

Can I change that by using:

set_option( 'page_on_front', 10 );

How would I remove a specific front page that has already been set? Do I set it to null?

I need to allow my users to set the default page of the blog. So when someone visits, "www.example.com/blog/" the page they see is either the blog posts list or a specific page.

It looks like I can tell which page is already set using:

get_option( 'page_on_front' ): returns the ID of the static page assigned to the front page. [source][1]

Can I change that by using:

set_option( 'page_on_front', 10 );

How would I remove a specific front page that has already been set? Do I set it to null?

UPDATE:

I found this call to check if showing blog posts:

'posts' == get_option( 'show_on_front' );

source

Source Link
1.21 gigawatts
  • 1k
  • 3
  • 13
  • 34
Loading