function poloray_options() { // VARIABLES $themename = 'Poloray Theme'; $shortname = "of"; // Populate OptionsFramework option in array for use in theme global $of_options; $of_options = poloray_get_option('of_options'); //Front page on/off $file_rename = array("on" => "On", "off" => "Off"); // Background Defaults $background_defaults = array('color' => '', 'image' => '', 'repeat' => 'repeat', 'position' => 'top center', 'attachment' => 'scroll'); // Pull all the categories into an array $options_categories = array(); $options_categories_obj = get_categories(); foreach ($options_categories_obj as $category) { $options_categories[$category->cat_ID] = $category->cat_name; } // Populate OptionsFramework option in array for use in theme $contact_option = array("on" => "On", "off" => "Off"); // Pull all the pages into an array $options_pages = array(); $options_pages_obj = get_pages('sort_column=post_parent,menu_order'); $options_pages[''] = 'Select a page:'; foreach ($options_pages_obj as $page) { $options_pages[$page->ID] = $page->post_title; } // If using image radio buttons, define a directory path $imagepath = get_template_directory_uri() . '/images/'; $options = array(array("name" => "General Settings", "type" => "heading"), array("name" => "Custom Logo", "desc" => "Choose your own logo. Optimal Size: 300px Wide by 90px Height.", "id" => "poloray_logo", "type" => "upload"), array("name" => "Custom Favicon", "desc" => "Specify a 16px x 16px image that will represent your website's favicon.", "id" => "poloray_favicon", "type" => "upload"), array("name" => "Front Page On/Off", "desc" => "Check on for enabling front page or check off for enabling blog page in front page", "id" => "re_nm", "std" => "on", "type" => "radio", "options" => $file_rename), array("name" => "Top Feature Settings", "type" => "heading"), array("name" => "Top Feature Heading", "desc" => "Enter your text for Top Feature.", "id" => "poloray_slider_heading", "std" => "", "type" => "textarea"), array("name" => "Top Feature Description", "desc" => "Enter your text for Top Feature Description.", "id" => "poloray_slider_description", "std" => "", "type" => "textarea"), array("name" => "Top Feature Image", "desc" => "Choose your image or video. Optimal size is 422px wide and height 224px", "id" => "poloray_slideimage1", "std" => "", "type" => "upload"), array("name" => "Top Feature Link", "desc" => "Enter your text for Top Feature Link.", "id" => "poloray_slider_link", "std" => "", "type" => "text"), array("name" => "Home Page Feature Settings", "type" => "heading"), array("name" => "Home Page Tagline", "desc" => "Enter your text for home page tagline", "id" => "poloray_mainheading", "std" => "", "type" => "textarea"), array("name" => "Home Page Button Text", "desc" => "Enter your text for home page button", "id" => "poloray_homepage_button", "std" => "", "type" => "text"), array("name" => "Home Page Button Link", "desc" => "Enter your text for home page button link", "id" => "poloray_homepage_button_link", "std" => "", "type" => "text"), array("name" => "Home Page Feature Section Starts From Here.", "type" => "saperate", "class" => "saperator"), array("name" => "First Feature Image", "desc" => "Choose image for your first Feature area. Optimal size 170px x 170px", "id" => "poloray_wimg1", "std" => "", "type" => "upload"), array("name" => "First Feature Heading", "desc" => "Enter your text for first col heading.", "id" => "poloray_firsthead", "std" => "", "type" => "textarea"), array("name" => "First Feature Description", "desc" => "Enter your text for first col description.", "id" => "poloray_firstdesc", "std" => "", "type" => "textarea"), array("name" => "First feature Link", "desc" => "Enter your text for First feature Link.", "id" => "poloray_feature_link1", "std" => "", "type" => "text"), array("name" => "Second Feature Starts From Here.", "type" => "saperate", "class" => "saperator"), array("name" => "Second Feature Image", "desc" => "Choose image for your second Feature area. Optimal size 170px x 170px", "id" => "poloray_fimg2", "std" => "", "type" => "upload"), array("name" => "Second Feature Heading", "desc" => "Enter your heading for second Feature area", "id" => "poloray_headline2", "std" => "", "type" => "textarea"), array("name" => "Second Col Description", "desc" => "Enter your text for second col description.", "id" => "poloray_seconddesc", "std" => "", "type" => "textarea"), array("name" => "Second feature Link", "desc" => "Enter your text for Second feature Link.", "id" => "poloray_feature_link2", "std" => "", "type" => "text"), array("name" => "Third Feature Starts From Here.", "type" => "saperate", "class" => "saperator"), array("name" => "Third Feature Image", "desc" => "Choose image for your thrid Feature. Optimal size 170px x 170px", "id" => "poloray_fimg3", "std" => "", "type" => "upload"), array("name" => "Third Feature Heading", "desc" => "Enter your heading for third Feature area", "id" => "poloray_headline3", "std" => "", "type" => "textarea"), array("name" => "Third Feature Description", "desc" => "Enter your text for Third Feature description.", "id" => "poloray_thirddesc", "std" => "", "type" => "textarea"), array("name" => "Third feature Link", "desc" => "Enter your text for Second feature Link.", "id" => "poloray_feature_link3", "std" => "", "type" => "text"), array("name" => "Fourth Feature Starts From Here.", "type" => "saperate", "class" => "saperator"), array("name" => "Fourth Feature Image", "desc" => "Choose image for your Fourth Feature. Optimal size 170px x 170px", "id" => "poloray_fimg4", "std" => "", "type" => "upload"), array("name" => "Fourth Feature Heading", "desc" => "Enter your heading for Fourth Feature area", "id" => "poloray_headline4", "std" => "", "type" => "textarea"), array("name" => "Fourth Feature Description", "desc" => "Enter your text for Fourth Feature description.", "id" => "poloray_fourthdesc", "std" => "", "type" => "textarea"), array("name" => "Fourth feature Link", "desc" => "Enter your text for Fourth feature Link.", "id" => "poloray_feature_link4", "std" => "", "type" => "text"), array("name" => "Styling Options", "type" => "heading"), array("name" => "Custom CSS", "desc" => "Quickly add some CSS to your theme by adding it to this block.", "id" => "poloray_customcss", "std" => "", "type" => "textarea"), array("name" => "Social Logos", "type" => "heading"), array("name" => "Facebook URL", "desc" => "Enter your Facebook URL if you have one", "id" => "poloray_facebook", "std" => "#", "type" => "text"), array("name" => "Twitter URL", "desc" => "Enter your Twitter URL if you have one", "id" => "poloray_twitter", "std" => "#", "type" => "text"), array("name" => "Yahoo URL", "desc" => "Enter your Yahoo Feed URL if you have one", "id" => "poloray_yahoo", "std" => "#", "type" => "text"), array("name" => "Rss URL", "desc" => "Enter your Rss URL if you have one", "id" => "poloray_rss", "std" => "#", "type" => "text"), array("name" => "Digg URL", "desc" => "Enter your Digg URL if you have one", "id" => "poloray_digg", "std" => "#", "type" => "text"), array("name" => "Pinterest URL", "desc" => "Enter your Pinterest Feed URL if you have one", "id" => "poloray_pinterest", "std" => "#", "type" => "text")); poloray_update_option('of_template', $options); poloray_update_option('of_themename', $themename); poloray_update_option('of_shortname', $shortname); }
function poloray_option_setup() { //Update EMPTY options $of_array = array(); add_option('of_options', $of_array); $template = poloray_get_option('of_template'); $saved_options = poloray_get_option('of_options'); $std = ''; foreach ($template as $option) { if ($option['type'] != 'heading') { if (isset($option['id'])) { $id = $option['id']; } if (isset($option['std'])) { $std = $option['std']; } $db_option = poloray_get_option($id); if (empty($db_option)) { if (is_array($option['type'])) { foreach ($option['type'] as $child) { $c_id = $child['id']; $c_std = $child['std']; poloray_update_option($c_id, $c_std); $of_array[$c_id] = $c_std; } } else { poloray_update_option($id, $std); $of_array[$id] = $std; } } else { //So just store the old values over again. $of_array[$id] = $db_option; } } } poloray_update_option('of_options', $of_array); }
?> > <div class="wrapper"> <div class="container_24"> <div class="grid_24"> <div class="header"> <div class="grid_8 alpha"> <div class="logo"> <?php if (poloray_get_option('poloray_logo') != '') { ?> <a href="<?php echo esc_url(home_url()); ?> "><img src="<?php echo poloray_get_option('poloray_logo'); ?> " alt="<?php bloginfo('name'); ?> " alt="logo"/></a> <?php } else { ?> <hgroup> <h1 class="site-title"><a href="<?php echo esc_url(home_url('/')); ?> " title="<?php echo esc_attr(get_bloginfo('name', 'display')); ?>
echo get_template_directory_uri(); ?> /images/pinterest.png" alt="Pinterest icon" /></a></li> <?php } ?> </ul> </div> </div> <div class="grid_8 omega"> <div class="copyrightinfo"> <?php if (poloray_get_option('poloray_footertext') != '') { ?> <p class="copyright"><?php echo poloray_get_option('poloray_footertext'); ?> </p> <?php } else { ?> <p class="copyright"><a href="<?php echo esc_url('http://www.inkthemes.com'); ?> ">Poloray Theme</a> Powered By <a href="<?php echo esc_url('http://www.wordpress.org'); ?> ">WordPress</a></p> <?php } ?>
function poloray_optionsframework_uploader_function($id, $std, $mod) { //$uploader .= '<input type="file" id="attachement_'.$id.'" name="attachement_'.$id.'" class="upload_input"></input>'; //$uploader .= '<span class="submit"><input name="save" type="submit" value="Upload" class="button upload_save" /></span>'; $uploader = ''; $upload = poloray_get_option($id); if ($mod != 'min') { $val = $std; if (poloray_get_option($id) != "") { $val = poloray_get_option($id); } $uploader .= '<input class=\'of-input\' name=\'' . $id . '\' id=\'' . $id . '_upload\' type=\'text\' value=\'' . str_replace("'", "", $val) . '\' />'; } $uploader .= '<div class="upload_button_div"><span class="button image_upload_button" id="' . $id . '">Upload Image</span>'; if (!empty($upload)) { $hide = ''; } else { $hide = 'hide'; } $uploader .= '<span class="button image_reset_button ' . $hide . '" id="reset_' . $id . '" title="' . $id . '">Remove</span>'; $uploader .= '</div>' . "\n"; $uploader .= '<div class="clear"></div>' . "\n"; $findme = 'wp-content/uploads'; $imgvideocheck = strpos($upload, $findme); if (!empty($upload) && $imgvideocheck === true) { $uploader .= '<a class="of-uploaded-image" href="' . $upload . '">'; $uploader .= '<img class="of-option-image" id="image_' . $id . '" src="' . $upload . '" alt="" />'; $uploader .= '</a>'; } $uploader .= '<div class="clear"></div>' . "\n"; return $uploader; }
echo stripslashes(poloray_get_option('poloray_fourthdesc')); ?> </p> <?php } else { ?> <p><?php _e('Poloray Theme is SEO Friendly WordPress Theme, rank your site easily with Poloray.', 'poloray'); ?> </p> <?php } ?> <div class="readmore-btn"> <a class="readmore" href="<?php if (poloray_get_option('poloray_feature_link4') != '') { echo poloray_get_option('poloray_feature_link4'); } ?> "><?php _e('Read More', 'poloray'); ?> </a></div> </div> </div> </div> </div> <div class="clear"></div> </div> </div> <?php get_footer();
if (!is_admin()) { wp_enqueue_script('poloray-ddsmoothmenu', get_template_directory_uri() . '/js/ddsmoothmenu.js', array('jquery')); wp_enqueue_script('poloray-cunfon-yui', get_template_directory_uri() . '/js/cufon-yui.js', array('jquery')); wp_enqueue_script('poloray-Champagne-font', get_template_directory_uri() . '/js/Champagne.font.js', array('jquery')); wp_enqueue_script('flex-slider', get_template_directory_uri() . '/js/jquery-flexslider-min.js', array('jquery')); wp_enqueue_script('poloray-validate', get_template_directory_uri() . '/js/jquery.validate.min.js', array('jquery')); wp_enqueue_script('poloray-custom', get_template_directory_uri() . '/js/custom.js', array('jquery')); if (is_singular() and get_site_option('thread_comments')) { wp_print_scripts('comment-reply'); } wp_enqueue_script('mobile-menu', get_template_directory_uri() . "/js/mobile-menu.js", array('jquery'), '', true); } } add_action('wp_enqueue_scripts', 'poloray_wp_enqueue_scripts'); //Front Page Rename $get_status = poloray_get_option('re_nm'); $get_file_ac = get_template_directory() . '/front-page.php'; $get_file_dl = get_template_directory() . '/front-page-hold.php'; //True Part if ($get_status === 'off' && file_exists($get_file_ac)) { rename("{$get_file_ac}", "{$get_file_dl}"); } //False Part if ($get_status === 'on' && file_exists($get_file_dl)) { rename("{$get_file_dl}", "{$get_file_ac}"); } // function poloray_get_option($name) { $options = get_option('poloray_options'); if (isset($options[$name])) {
function poloray_of_head_css() { $output = ''; $custom_css = poloray_get_option('poloray_customcss'); if ($custom_css != '') { $output .= $custom_css . "\n"; } // Output styles if ($output != '') { $output = "<!-- Custom Styling -->\n<style type=\"text/css\">\n" . $output . "</style>\n"; echo $output; } }