Esempio n. 1
0
/**
 * @package Themolio
 */
?>
<?php
/**
 * Setting the content width based on theme's layout
 */
if(!isset($content_width))
    $content_width = 740;

/**
 * Calling the theme options template and retrieving the theme options
 */
require(get_template_directory().'/admin/theme-options.php');
$themolio_options = themolio_get_options();
$themolio_is_mobile = themolio_is_mobile();
/**
 * Telling wordpress to run themolio_setup whenever "after_setup_theme" hook is run
 */
add_action('after_setup_theme', 'themolio_setup');
if (!function_exists('themolio_setup')):
function themolio_setup() {

    /* Make Themolio available for translation.
      * Translations can be added to the /languages/ directory.
      * If you're building a theme based on Themolio, use a find and replace
      * to change 'themolio' to the name of your theme in all the template files.
    */
    load_theme_textdomain('themolio', get_template_directory().'/languages' );
    add_editor_style();
Esempio n. 2
0
function themolio_options_page() {
    if(isset($_POST['settings-reset'])) {
        delete_option('themolio_options');
        add_settings_error('themolio_options','settings-reset-update',__('Default settings restored','themolio'),'updated');
    }
    ?>
    <div class="wrap"> <!-- Start of wrap -->
        <?php screen_icon(); ?>
        <?php $theme_name = function_exists('wp_get_theme') ? wp_get_theme() : get_current_theme(); ?>
        <h2><?php printf(__('%s Theme Options', 'themolio'), $theme_name); ?></h2>
        <?php settings_errors(); ?>

        <!-- Tabs -->
        <?php $count = 1; ?>
        <h2 class="nav-tab-wrapper">
            <?php foreach (themolio_tab_list() as $tab) { if($count == 1) $class = " nav-tab-active"; else $class = ""; ?>
            <a href="javascript:void(0)" id="nav-tab-<?php echo $tab['value']; ?>" class="nav-tab<?php echo $class; ?>">
                <?php echo $tab['label']; ?>
            </a>
            <?php $count++; } ?>
        </h2>
        <div class="clear"></div>

        <form class="settings-form" method="post" id="settings-form" action="options.php">
            <?php
                settings_fields('themolio_options');
                $themolio_options = themolio_get_options();
                $themolio_default_options = themolio_get_default_options();
            ?>
            <div class="settings-section current-section" id="settings-typography">
                <p>
                    <label><?php _e('Content Font','themolio'); ?>:</label>
                    <select name="themolio_options[content_font]">
                        <?php foreach (themolio_content_fonts() as $content_font) { ?>
                            <option value="<?php echo $content_font['value']; ?>" <?php selected($themolio_options['content_font'], $content_font['value']); ?>><?php echo $content_font['label']; ?></option>
                        <?php } ?>
                    </select>
                </p>
                <p>
                    <label><?php _e('Content Font Size','themolio'); ?>:</label>
                    <input style="font-weight: 700;font-size:15px;" type="button" value=" - " id="font_size_decr_btn"/>
                    <input type="text" readonly="readonly" name="themolio_options[font_size]" id="font_size" value="<?php echo esc_attr($themolio_options['font_size']); ?>"/> %
                    <input style="font-weight: 700;font-size:15px;" type="button" value=" + " id="font_size_incr_btn"/>
                </p>
                <p>
                    <label><?php _e('Font color','themolio'); ?>:</label>
                    <input type="text" name="themolio_options[font_color]" class="color" value="<?php echo esc_attr($themolio_options['font_color']); ?>"/>
                </p>
                <p>
                    <label><?php _e('Link color','themolio'); ?>:</label>
                    <input type="text" name="themolio_options[link_color]" class="color" value="<?php echo esc_attr($themolio_options['link_color']); ?>"/>
                </p>
                <p>
                    <label><?php _e('Button color','themolio'); ?>:</label>
                    <input type="text" name="themolio_options[button_color]" class="color" value="<?php echo esc_attr($themolio_options['button_color']); ?>"/>
                </p>
            </div>
            <div class="settings-section" id="settings-logo">
                <p>
                    <label><?php _e('Custom Logo','themolio'); ?></label>
                    <input type="text" name="themolio_options[custom_logo]" id="custom_logo" size="36" value="<?php echo esc_attr($themolio_options['custom_logo']); ?>"/>
                    <input id="custom_logo_upload" type="button" class="image_upload button-secondary" value="<?php _e('Upload Logo','themolio'); ?>" />
                </p>
                <p>
                    <label><?php _e('Custom Favicon','themolio'); ?></label>
                    <input type="text" name="themolio_options[custom_favicon]" id="custom_favicon" size="36" value="<?php echo esc_attr($themolio_options['custom_favicon']); ?>"/>
                    <input id="custom_favicon_upload" type="button" class="image_upload button-secondary" value="<?php _e('Upload Favicon Image','themolio'); ?>" />
                </p>
            </div>
            <div class="settings-section" id="settings-layout">
                <p>
                    <label><?php _e('Layout Style','themolio'); ?>:</label>
                    <select name="themolio_options[blog_style]">
                        <?php foreach (themolio_blog_style() as $blog_style) { ?>
                            <option value="<?php echo $blog_style['value']; ?>" <?php selected($themolio_options['blog_style'], $blog_style['value']); ?>><?php echo $blog_style['label']; ?></option>
                        <?php } ?>
                    </select>
                </p>
                <p>
                    <label><?php _e('Number of columns for Grid','themolio'); ?>:</label>
                    <select name="themolio_options[grid_columns]">
                        <?php foreach (themolio_grid_columns() as $grid_columns) { ?>
                            <option value="<?php echo $grid_columns['value']; ?>" <?php selected($themolio_options['grid_columns'], $grid_columns['value']); ?>><?php echo $grid_columns['label']; ?></option>
                        <?php } ?>
                    </select>
                </p>
                <p>
                    <label><?php _e('Layout for grid','themolio'); ?>:</label>
                    <select name="themolio_options[grid_layout]">
                        <?php foreach (themolio_grid_layout() as $grid_layout) { ?>
                            <option value="<?php echo $grid_layout['value']; ?>" <?php selected($themolio_options['grid_layout'], $grid_layout['value']); ?>><?php echo $grid_layout['label']; ?></option>
                        <?php } ?>
                    </select>
                    <span class="field-meta"><?php _e('<strong>Top to bottom</strong>: Posts in the grid will be arranged starting from top moving downwards. <strong>Left to right</strong>: Posts in the grid will be arranged from left to right','themolio'); ?></span>
                </p>
                <p>
                    <label><?php _e('Sidebar for Grid page','themolio'); ?></label>
                    <input type="checkbox" name="themolio_options[show_sidebar_grid]" value="true" <?php checked(true,$themolio_options['show_sidebar_grid']); ?> />
                    <span class="field-meta"><?php _e('Show sidebar on the grid page ?','themolio'); ?></span>
                </p>
            </div>
            <div class="settings-section" id="settings-blog">
                <p>
                    <label><?php _e('Front page excerpts','themolio'); ?></label>
                    <input type="checkbox" name="themolio_options[show_excerpt]" value="true" <?php checked(true,$themolio_options['show_excerpt']); ?> />
                    <span class="field-meta"><?php _e('Display excerpts on front page for standard layout blog ?','themolio'); ?></span>
                </p>
                <p>
                    <label><?php _e('Featured Image','themolio'); ?></label>
                    <input type="checkbox" name="themolio_options[show_featured]" value="true" <?php checked(true,$themolio_options['show_featured']); ?> />
                    <span class="field-meta"><?php _e('Display featured images on front page (for both grid and standard layout) ?','themolio'); ?></span>
                </p>
                <p>
                    <label><?php _e('Default Search Box','themolio'); ?></label>
                    <input type="checkbox" name="themolio_options[show_search]" value="true" <?php checked(true,$themolio_options['show_search']); ?> />
                    <span class="field-meta"><?php _e('Display default search box in header','themolio'); ?></span>
                </p>
                <p>
                    <label><?php _e('Categories and Tags','themolio'); ?>:</label>
                    <input type="checkbox" name="themolio_options[show_single_utility]" value="true" <?php checked(true,$themolio_options['show_single_utility']); ?> />
                    <span class="field-meta"><?php _e('Show tags and categories for single entries','themolio'); ?></span>
                </p>
                <p>
                    <label><?php _e('Page Meta','themolio'); ?>:</label>
                    <input type="checkbox" name="themolio_options[show_page_meta]" value="true" <?php checked(true,$themolio_options['show_page_meta']); ?> />
                    <span class="field-meta"><?php _e('Show meta information for pages','themolio'); ?></span>
                </p>
            </div>
            <div class="settings-section" id="settings-social">
                <p>
                    <label><?php _e('Facebook','themolio'); ?>:</label>
                    <input type="text" class="social-field" id="facebook-user" name="themolio_options[facebook_user]" value="<?php echo esc_attr($themolio_options['facebook_user']); ?>"/>
                    <span class="field-meta"><?php _e('Enter your facebook user id','themolio'); ?></span>
                </p>
                <p>
                    <label><?php _e('Twitter','themolio'); ?>:</label>
                    <input type="text" class="social-field" id="twitter-user" name="themolio_options[twitter_user]" value="<?php echo esc_attr($themolio_options['twitter_user']); ?>"/>
                    <span class="field-meta"><?php _e('Enter your twitter user id','themolio'); ?></span>
                </p>
                <p>
                    <label><?php _e('RSS','themolio'); ?>:</label>
                    <input type="checkbox" name="themolio_options[enable_rss]" value="true" <?php checked(true,$themolio_options['enable_rss']); ?> />
                    <span class="field-meta"><?php _e('Show RSS icon','themolio'); ?></span>
                </p>
            </div>
            <?php submit_button('Save Settings','primary','settings-submit',false); ?>
        </form>

        <form class="form" method="post" id="reset-form" style="text-align: right; margin-top: 10px;" onsubmit="return confirmAction()">
            <input type="submit" class="button-secondary" name="settings-reset" id="settings-reset" value="<?php _e('Reset Settings','themolio'); ?>" />
        </form>

        <form action="https://www.paypal.com/cgi-bin/webscr" method="post" style="text-align: right; margin-top: 10px;">
            <input type="hidden" name="cmd" value="_s-xclick">
            <input type="hidden" name="hosted_button_id" value="43VU78ENDDKSU">
            <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
            <img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
        </form>
        <p style="text-align: right; margin-top: 10px; padding-top: 10px; border-top: 1px #ccc solid;">
            <?php _e('Theme designed and developed by <a href="http://www.nischalmaniar.com">Nischal Maniar</a>','themolio'); ?>
        </p>
    </div> <!-- End of settings wrap -->
    <?php
}