$main_menu->term_id, ) ); $front_page_id = get_page_by_title( 'Home' ); $blog_page_id = get_page_by_title( 'Blogs' ); update_option( 'show_on_front', 'page' ); update_option( 'page_on_front', $front_page_id->ID ); update_option( 'page_for_posts', $blog_page_id->ID ); } add_action( 'pt-ocdi/after_import', 'book_land_after_import_setup' ); function book_land_import_files() { return array( array( 'import_file_name' => 'Book Land', 'import_file_url' => get_template_directory_uri() . ' ', 'import_widget_file_url' => get_template_directory_uri() . '', 'import_preview_image_url' => get_template_directory_uri() . '/screenshot.png', 'import_notice' => __( 'Please click on below "Import Demo Data" button to import theme contents, After you import this demo, Enjoy our Book Land theme.', 'book-land' ), 'preview_url' => ' ', ), ); } add_filter( 'pt-ocdi/import_files', 'book_land_import_files' ); /* Book Land Post Category */ function book_land_categorized_blog() { $category_count = get_transient( 'book_land_categories' ); if ( false === $category_count ) { $categories = get_categories( array( 'fields' => 'ids', 'hide_empty' => 1, 'number' => 2, ) ); $category_count = count( $categories ); set_transient( 'book_land_categories', $category_count ); } if ( is_preview() ) { return true; } return $category_count > 1; } /* Set excerpt length */ if ( ! function_exists( 'book_land_excerpt_length' ) ) : function book_land_excerpt_length( $length ) { return 35; } add_filter( 'excerpt_length', 'book_land_excerpt_length', 999 ); endif; /* Update excerpt more button */ if ( ! function_exists( 'book_land_excerpt_more' ) ) : function book_land_excerpt_more( $more ) { return ' ...'; } add_filter('excerpt_more', 'book_land_excerpt_more'); endif; /* Book Land getting all users */ function book_land_get_users(){ $users = get_users( array( 'orderby' => 'display_name', 'order' => 'ASC', 'number' => '', ) ); $option_users[0] = esc_html__( 'Select member', 'book-land' ); foreach( $users as $user ){ $option_users[ $user->ID ] = $user->display_name; } return $option_users; } /* Book Land getting all pages */ function book_land_get_pages(){ $pages = get_pages(); $option_pages = array(); $option_pages[0] = esc_html__( 'Select page', 'book-land' ); foreach( $pages as $p ){ $option_pages[ $p->ID ] = $p->post_title; } return $option_pages; } /* Book Land animation effects */ function book_land_animations(){ $effects_str = 'bounce flash pulse rubberBand shake headShake swing tada wobble jello bounceIn bounceInDown bounceInLeft bounceInRight bounceInUp fadeIn fadeInDown fadeInDownBig fadeInLeft fadeInLeftBig fadeInRight fadeInRightBig fadeInUp fadeInUpBig flipInX flipInY lightSpeedIn rotateIn rotateInDownLeft rotateInDownRight rotateInUpLeft rotateInUpRight hinge rollIn zoomIn zoomInDown zoomInLeft zoomInRight zoomInUp slideInDown slideInLeft slideInRight slideInUp'; $effects_str = explode( ' ', $effects_str ); $effect_arg = array(''=>'--select--'); foreach ( $effects_str as $val ) { $val = trim( $val ); if ( $val ){ $effect_arg[ $val ]= $val; } } return $effect_arg; } /* Book Land font size */ function book_land_fontsize(){ $font_size = array(''=>'--select--'); for( $i=9; $i<=100; $i++ ){ $font_size[$i] = $i; } return $font_size; }