Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to select front page in multiple style.? #165

Open
monparaashvin opened this issue May 4, 2019 · 0 comments
Open

how to select front page in multiple style.? #165

monparaashvin opened this issue May 4, 2019 · 0 comments

Comments

@monparaashvin
Copy link

monparaashvin commented May 4, 2019

different file & directory different FrontPage select.

function prefix_after_import_setup($selected_import_index) {
	/* Grab the selected import file. */
	$selected_import_file = $GLOBALS['wizard']->import_files[ $selected_import_index ];
	/* You may access the currently selected import file like so: */
	if ( 'style1' === $selected_import_file['import_file_name'] ) {
		$front_page_id = get_page_by_title('Home');
		update_option( 'show_on_front', 'page' );
		update_option( 'page_on_front', $front_page_id->ID );
	}
	if ( 'style2' === $selected_import_file['import_file_name'] ) {
		$front_page_id = get_page_by_title('Home2');
		update_option( 'show_on_front', 'page' );
		update_option( 'page_on_front', $front_page_id->ID );
	}
	if ( 'style3' === $selected_import_file['import_file_name'] ) {
		$front_page_id = get_page_by_title('Home3');
		update_option( 'show_on_front', 'page' );
		update_option( 'page_on_front', $front_page_id->ID );
	}
	if ( 'style4' === $selected_import_file['import_file_name'] ) {
		$front_page_id = get_page_by_title('Home4');
		update_option( 'show_on_front', 'page' );
		update_option( 'page_on_front', $front_page_id->ID );
	}
}
add_action( 'merlin_after_all_import', 'prefix_after_import_setup' );

this code not working..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant