homepage = "Homepage"; $this->shorthomepage = ""; $value_of_std[1]=get_theme_mod($this->shorthomepage."_top_post_cat_name",'Our Location'); $value_of_std[2]=get_theme_mod($this->shorthomepage."_hide_top_posts",'on'); $value_of_std[3]=get_theme_mod($this->shorthomepage."_top_post_categories",''); $value_of_std[4]=get_theme_mod($this->shorthomepage."_hide_horizontal_tab_posts",'on'); $value_of_std[5]=get_theme_mod($this->shorthomepage."_horizontal_tab_categories",''); $value_of_std[9]=get_theme_mod($this->shorthomepage."_content_post_cat_name",''); $value_of_std[10]=get_theme_mod($this->shorthomepage."_hide_content_posts",'on'); $value_of_std[11]=get_theme_mod($this->shorthomepage."_content_post_categories",''); $value_of_std[13]=get_theme_mod($this->shorthomepage."_hide_about_us",''); $value_of_std[14]=get_theme_mod($this->shorthomepage."_home_abaut_us_post",''); $value_of_std[15]=get_theme_mod($this->shorthomepage."_top_post_desc",'Pellentesque habitant morbi tristique senectus et netus et malesuada fames.'); $this->options_homepage = array( "top_post_cat_name" => array( "name" => "", "description" => "Name of top post category", "var_name" => "top_post_cat_name", "id" => $this->shorthomepage."_top_post_cat_name", "std" => $value_of_std[1] ), "hide_top_posts" => array( "name" => "Top Posts", "description" => "Check the box to display the top posts from the homepage.", "var_name" => "hide_top_posts", "id" => $this->shorthomepage."_hide_top_posts", "std" => $value_of_std[2] ), "top_post_categories" => array( "name" => "Top Posts", "description" => "Select the categories from which you want the homepage top posts to be selected (the posts are selected automatically).", "var_name" => "top_post_categories", "id" => $this->shorthomepage."_top_post_categories", "std" => $value_of_std[3] ), "hide_horizontal_tab_posts" => array( "name" => "Horizontal Tab", "description" => "Check the box to display the horizontal tabs from the homepage.", "var_name" => "hide_horizontal_tab_posts", "id" => $this->shorthomepage."_hide_horizontal_tab_posts", "std" => $value_of_std[4] ), "horizontal_tab_categories" => array( "name" => "Hide Horizontal Tab", "description" => "Check the box to select the categories from which top posts will be displayed.", "var_name" => "horizontal_tab_categories", "id" => $this->shorthomepage."_horizontal_tab_categories", "std" => $value_of_std[5] ), "content_post_cat_name" => array( "name" => "", "description" => "Name of top post category", "var_name" => "content_post_cat_name", "id" => $this->shorthomepage."_content_post_cat_name", "std" => $value_of_std[9] ), "hide_content_posts" => array( "name" => "Content Top Posts", "description" => "Check the box to select the categories from which top posts will be displayed.", "var_name" => "hide_content_posts", "id" => $this->shorthomepage."_hide_content_posts", "std" => $value_of_std[10] ), "content_post_categories" => array( "name" => "", "description" => "Select the categories.", "var_name" => "content_post_categories", "id" => $this->shorthomepage."_content_post_categories", "std" => $value_of_std[11] ), "hide_about_us" => array( "name" => "Featured Post", "description" => "Using this option, you can show the Featured Post", "var_name" => "hide_about_us", "id" => $this->shorthomepage."_hide_about_us", "std" => $value_of_std[13] ), "home_abaut_us_post" => array( "name" => "Featured Post", "all_values" => $this->get_all_posts_in_select(), "description" => "Select Featured Post", "var_name" => "home_abaut_us_post", "id" => $this->shorthomepage."_home_abaut_us_post", "std" => $value_of_std[14] ), "top_post_desc" => array( "name" => "", "all_values" => $this->get_all_posts_in_select(), "description" => "Top Posts Description", "var_name" => "top_post_desc", "id" => $this->shorthomepage."_top_post_desc", "std" => $value_of_std[15] ) ); } /// save changes or reset options public function web_dorado_theme_update_and_get_options_home(){ if (isset($_GET['page']) && $_GET['page'] == "web_dorado_theme" && isset($_GET['controller']) && $_GET['controller'] == "home_page") { if (isset($_REQUEST['action']) && $_REQUEST['action']=='save' ) { foreach ($this->options_homepage as $value) { if(isset($_REQUEST[$value['var_name']])) set_theme_mod($value['id'], stripslashes($_REQUEST[$value['var_name']])); } foreach ($this->options_homepage as $value) { if (isset($_REQUEST[$value['var_name']])) { set_theme_mod($value['id'], stripslashes($_REQUEST[$value['var_name']])); } else { remove_theme_mod($value['id']); } } header("Location: themes.php?page=web_dorado_theme&controller=home_page&saved=true"); die; } else { if (isset($_REQUEST['action']) && $_REQUEST['action']=='reset') { foreach ($this->options_homepage as $value) { remove_theme_mod($value['id']); } header("Location: themes.php?page=web_dorado_theme&controller=home_page&reset=true"); die; } } } } public function web_dorado_home_page_admin_scripts(){ wp_enqueue_style('home_page_main_style',get_template_directory_uri().'/admin/css/home_page.css'); } public function update_parametr($param_name,$value){ set_theme_mod($this->options_homepage[$param_name]['id'],$value); } private function get_all_posts_in_select(){ $args= array( 'posts_per_page' => 3000, 'orderby' => 'post_date', 'order' => 'DESC', 'post_type' => 'post', 'post_status' => 'publish', ); $posts_array_custom=array(); $posts_array = get_posts( $args ); foreach($posts_array as $post){ $posts_array_custom[$post->ID]=$post->post_title; } return $posts_array_custom; } public function dorado_theme_admin_home(){ if (isset($_REQUEST['saved']) && $_REQUEST['saved'] && isset($_GET['controller']) && $_GET['controller'] == "layout_page" ) echo '

Home settings are saved.

'; if (isset($_REQUEST['reset']) && $_REQUEST['reset'] && isset($_GET['controller']) && $_GET['controller'] == "layout_page") echo '

Home settings are reset.

'; global $business_world_admin_helepr_functions,$business_world_web_dor; ?>
User Manual
This section allows you to customize the homepage. More...

Home

checkbox_with_select($this->options_homepage['hide_about_us'],$this->options_homepage['home_abaut_us_post']); $business_world_admin_helepr_functions->checkbox_category_checkboxses($this->options_homepage['hide_top_posts'],$this->options_homepage['top_post_categories'],array($this->options_homepage['top_post_cat_name'],$this->options_homepage['top_post_desc'])); /// Home Top posts $business_world_admin_helepr_functions->checkbox_category_checkboxses($this->options_homepage['hide_horizontal_tab_posts'],$this->options_homepage['horizontal_tab_categories']); /// Home horizontal Tab posts $business_world_admin_helepr_functions->checkbox_category_checkboxses($this->options_homepage['hide_content_posts'],$this->options_homepage['content_post_categories'],$this->options_homepage['content_post_cat_name']); /// Home Content posts ?>