Example #1
0
define('PRIIMO_CONTENT_WIDTH', PRIIMO_WRAPPER_WIDTH - PRIIMO_SIDEBAR_WIDTH);
// Post Slideshow height
define('PRIIMO_SLIDER_HEIGHT', 380);
// Header height
define('PRIIMO_HEADER_HEIGHT', 120);
/**
 * Setting the content width based on theme's layout
 */
if (!isset($content_width)) {
    $content_width = PRIIMO_CONTENT_WIDTH;
}
/**
 * Calling the theme options template and retrieving the theme options
 */
require get_template_directory() . '/admin/theme-options.php';
$priimo_options = priimo_get_options();
/**
 * Telling wordpress to run priimo_setup whenever "after_setup_theme" hook is run
 */
add_action('after_setup_theme', 'priimo_setup');
if (!function_exists('priimo_setup')) {
    function priimo_setup()
    {
        /* Make Priimo available for translation.
         * Translations can be added to the /languages/ directory.
         * If you're building a theme based on Priimo, use a find and replace
         * to change 'priimo' to the name of your theme in all the template files.
         */
        load_theme_textdomain('priimo', get_template_directory() . '/languages');
        add_editor_style();
        add_theme_support('automatic-feed-links');
Example #2
0
function priimo_options_page()
{
    if (isset($_POST['settings-reset'])) {
        delete_option('priimo_options');
        add_settings_error('priimo_options', 'settings-reset-update', __('Default settings restored', 'priimo'), 'updated');
    }
    ?>

    <div class="settings-wrap"> <!-- Start of Settings Wrap -->
        <div class="settings-header">
            <table class="tablayout" style="height:100%;"><tr>
            <td class="left" style="width:50%;">
                <?php 
    $theme_name = function_exists('wp_get_theme') ? wp_get_theme() : get_current_theme();
    ?>

                <h2 class="settings-title"><?php 
    printf(__('%s Theme Options', 'priimo'), $theme_name);
    ?>
</h2>
            </td>
            </tr></table>
        </div>
        <div class="settings-menu clearfix">
            <?php 
    $count = 1;
    ?>

            <?php 
    foreach (priimo_tab_list() as $tab) {
        if ($count == 1) {
            $class = " settings-menu-tab-active";
        } else {
            $class = "";
        }
        ?>

            <a href="javascript:void(0)" id="settings-menu-tab-<?php 
        echo $tab['value'];
        ?>
" class="settings-menu-tab<?php 
        echo $class;
        ?>
">
                <img class="settings-menu-tab-icon" src="<?php 
        echo get_template_directory_uri();
        ?>
/admin/images/<?php 
        echo $tab['value'];
        ?>
_icon.png"/>
                <?php 
        echo $tab['label'];
        ?>

            </a>
            <?php 
        $count++;
    }
    ?>

        </div>
        <div class="settings-content-container">
             <?php 
    settings_errors();
    ?>

            <form class="settings-form" method="post" id="settings-form" action="options.php">
            <?php 
    settings_fields('priimo_options');
    $priimo_options = priimo_get_options();
    $priimo_default_options = priimo_get_default_options();
    ?>

            <div id="settings-content-typography" class="settings-content settings-content-active">
                <p class="lblfield"><label><?php 
    _e('Content Font', 'priimo');
    ?>
</label></label></p>
                <p class="frmfield">
                    <select name="priimo_options[content_font]">
                        <?php 
    foreach (priimo_content_fonts() as $content_font) {
        ?>

                            <option value="<?php 
        echo $content_font['value'];
        ?>
" <?php 
        selected($priimo_options['content_font'], $content_font['value']);
        ?>
><?php 
        echo $content_font['label'];
        ?>
</option>
                        <?php 
    }
    ?>

                    </select>
                </p>
                <p class="lblfield"><label><?php 
    _e('Content Font Size', 'priimo');
    ?>
</label></label></p>
                <p class="frmfield">
                    <input class="roundbtn" type="button" value=" - " id="font_size_decr_btn"/>
                    <input type="text" readonly="readonly" name="priimo_options[font_size]" id="font_size" value="<?php 
    echo esc_attr($priimo_options['font_size']);
    ?>
"/> %
                    <input class="roundbtn" type="button" value=" + " id="font_size_incr_btn"/>
                </p>
                <p class="lblfield"><label><?php 
    _e('Font color', 'priimo');
    ?>
</label></p>
                <p class="frmfield">
                    <input type="text" name="priimo_options[font_color]" class="color" value="<?php 
    echo esc_attr($priimo_options['font_color']);
    ?>
"/>
                </p>
                <p class="lblfield"><?php 
    _e('Link color', 'priimo');
    ?>
</p>
                <p class="frmfield">
                    <input type="text" name="priimo_options[link_color]" class="color" value="<?php 
    echo esc_attr($priimo_options['link_color']);
    ?>
"/>
                </p>
                <p class="lblfield"><label><?php 
    _e('Button color', 'priimo');
    ?>
</label></p>
                <p class="frmfield">
                    <input type="text" name="priimo_options[button_color]" class="color" value="<?php 
    echo esc_attr($priimo_options['button_color']);
    ?>
"/>
                </p>
            </div>
            <div id="settings-content-logo" class="settings-content">
                <p class="lblfield"><label><?php 
    _e('Custom Favicon', 'priimo');
    ?>
</label></p>
                <p class="frmfield">
                    <input type="text" name="priimo_options[custom_favicon]" id="custom_favicon" size="36" value="<?php 
    echo esc_attr($priimo_options['custom_favicon']);
    ?>
"/>
                    <input id="custom_favicon_upload" type="button" class="image_upload" value="<?php 
    _e('Upload Favicon Image', 'priimo');
    ?>
" />
                </p>
            </div>
            <div id="settings-content-layout" class="settings-content">
                <p class="lblfield"><label><?php 
    _e('Sidebar Layout', 'priimo');
    ?>
</label></p>
                <p class="frmfield">
                    <?php 
    foreach (priimo_sidebar_layout() as $sidebar_layout) {
        ?>

                        <?php 
        if ($priimo_options['sidebar_layout'] == $sidebar_layout['value']) {
            $current = ' selected-sidebar-layout';
        } else {
            $current = '';
        }
        ?>

                        <img title="<?php 
        echo $sidebar_layout['label'];
        ?>
" class="sidebar-layout-image<?php 
        echo $current;
        ?>
" id="<?php 
        echo $sidebar_layout['value'];
        ?>
" src="<?php 
        echo get_template_directory_uri();
        ?>
/admin/images/<?php 
        echo $sidebar_layout['value'];
        ?>
.png"/>
                    <?php 
    }
    ?>

                    <input type="hidden" name="priimo_options[sidebar_layout]" id="sidebar_layout" value="<?php 
    echo esc_attr($priimo_options['sidebar_layout']);
    ?>
"/>
                </p>
            </div>
            <div id="settings-content-slideshow" class="settings-content">
                <p class="lblfield"><label><?php 
    _e('Enable slideshow', 'priimo');
    ?>
</label></p>
                <p class="frmfield">
                    <input type="checkbox" name="priimo_options[enable_slideshow]" value="true" <?php 
    checked(true, $priimo_options['enable_slideshow']);
    ?>
 />
                    <span class="field-meta"><?php 
    _e('Display post slideshow on front page', 'priimo');
    ?>
</span>
                </p>
                <p class="lblfield"><label><?php 
    _e('Number of slides', 'priimo');
    ?>
</label></p>
                <p class="frmfield">
                    <input type="text" id="slideshow-count" name="priimo_options[slideshow_count]" value="<?php 
    echo esc_attr($priimo_options['slideshow_count']);
    ?>
"/>
                </p>
                <p class="lblfield"><label><?php 
    _e('Slideshow interval', 'priimo');
    ?>
</label></p>
                <p class="frmfield">
                    <input type="text" id="slideshow-interval" name="priimo_options[slideshow_interval]" value="<?php 
    echo esc_attr($priimo_options['slideshow_interval']);
    ?>
"/>
                    <span class="field-meta"><?php 
    _e('Seconds', 'priimo');
    ?>
</span>
                </p>
            </div>
            <div id="settings-content-portfolio" class="settings-content">
                <p class="lblfield"><label><?php 
    _e('Number of portfolio columns', 'priimo');
    ?>
</label></p>
                <p class="frmfield">
                    <select name="priimo_options[portfolio_columns]">
                        <?php 
    foreach (priimo_portfolio_columns() as $portfolio_cols) {
        ?>

                            <option value="<?php 
        echo $portfolio_cols['value'];
        ?>
" <?php 
        selected($priimo_options['portfolio_columns'], $portfolio_cols['value']);
        ?>
><?php 
        echo $portfolio_cols['label'];
        ?>
</option>
                        <?php 
    }
    ?>

                    </select>
                </p>
            </div>
            <div id="settings-content-blog" class="settings-content">
                <p class="lblfield"><label><?php 
    _e('Blog Layout Style', 'priimo');
    ?>
</label></p>
                <p class="frmfield">
                    <select name="priimo_options[blog_style]">
                        <?php 
    foreach (priimo_blog_style() as $blog_style) {
        ?>

                            <option value="<?php 
        echo $blog_style['value'];
        ?>
" <?php 
        selected($priimo_options['blog_style'], $blog_style['value']);
        ?>
><?php 
        echo $blog_style['label'];
        ?>
</option>
                        <?php 
    }
    ?>

                    </select>
                </p>
                <p class="lblfield"><label><?php 
    _e('Default Search Box', 'priimo');
    ?>
</label></p>
                <p class="frmfield">
                    <input type="checkbox" name="priimo_options[show_search]" value="true" <?php 
    checked(true, $priimo_options['show_search']);
    ?>
 />
                    <span class="field-meta"><?php 
    _e('Display default search box in header', 'priimo');
    ?>
</span>
                </p>
                <p class="lblfield"><label><?php 
    _e('Categories and Tags', 'priimo');
    ?>
</label></p>
                <p class="frmfield">
                    <input type="checkbox" name="priimo_options[show_single_utility]" value="true" <?php 
    checked(true, $priimo_options['show_single_utility']);
    ?>
 />
                    <span class="field-meta"><?php 
    _e('Show tags and categories for single entries', 'priimo');
    ?>
</span>
                </p>
                <p class="lblfield"><label><?php 
    _e('Page Meta', 'priimo');
    ?>
</label></p>
                <p class="frmfield">
                    <input type="checkbox" name="priimo_options[show_page_meta]" value="true" <?php 
    checked(true, $priimo_options['show_page_meta']);
    ?>
 />
                    <span class="field-meta"><?php 
    _e('Show meta information for pages', 'priimo');
    ?>
</span>
                </p>
                <p class="lblfield"><label><?php 
    _e('Post bookmarking', 'priimo');
    ?>
</label></p>
                <p class="frmfield">
                    <input type="checkbox" name="priimo_options[show_bookmark_buttons]" value="true" <?php 
    checked(true, $priimo_options['show_bookmark_buttons']);
    ?>
 />
                    <span class="field-meta"><?php 
    _e('Show post bookmarking buttons for single templates', 'priimo');
    ?>
</span>
                </p>
            </div>
            <div id="settings-content-social" class="settings-content">
                <p class="lblfield"><label><img class="social-lbl" src="<?php 
    echo get_template_directory_uri();
    ?>
/admin/images/facebook.png"/><?php 
    _e('Facebook', 'priimo');
    ?>
</label></p>
                <p class="frmfield">
                    <input type="text" class="social-field" id="facebook-user" name="priimo_options[facebook_user]" value="<?php 
    echo esc_attr($priimo_options['facebook_user']);
    ?>
"/>
                    <span class="field-meta"><?php 
    _e('Enter your facebook user id', 'priimo');
    ?>
</span>
                </p>
                <p class="lblfield"><label><img class="social-lbl" src="<?php 
    echo get_template_directory_uri();
    ?>
/admin/images/twitter.png"/><?php 
    _e('Twitter', 'priimo');
    ?>
</label></p>
                <p class="frmfield">
                    <input type="text" class="social-field" id="twitter-user" name="priimo_options[twitter_user]" value="<?php 
    echo esc_attr($priimo_options['twitter_user']);
    ?>
"/>
                    <span class="field-meta"><?php 
    _e('Enter your twitter user id', 'priimo');
    ?>
</span>
                </p>
                <p class="lblfield"><label><img class="social-lbl" src="<?php 
    echo get_template_directory_uri();
    ?>
/admin/images/rss.png"/><?php 
    _e('RSS', 'priimo');
    ?>
</label></p>
                <p class="frmfield">
                    <input type="checkbox" name="priimo_options[enable_rss]" value="true" <?php 
    checked(true, $priimo_options['enable_rss']);
    ?>
 />
                    <span class="field-meta"><?php 
    _e('Show RSS icon', 'priimo');
    ?>
</span>
                </p>
            </div>
            <div class="settings-content-container-footer">
                <?php 
    submit_button('Save Settings', 'primary', 'settings-submit', false);
    ?>

            </div>
            </form>            
        </div>
        <div class="settings-footer">
            <table class="tablayout"><tr>
            <td class="left" style="width:50%;">
                <form class="settings-form" method="post" id="reset-form" onsubmit="return confirmAction()">
                    <input type="submit" name="settings-reset" id="settings-reset" value="<?php 
    _e('Reset Settings', 'priimo');
    ?>
" />
                </form>
            </td>
            <td class="right" style="width:50%;">
                <?php 
    _e('Theme designed and developed by ', 'priimo');
    ?>
<a href="http://www.dezineappz.com"><?php 
    _e('DezineAppz', 'priimo');
    ?>
</a>
            </td>
            </tr></table>
        </div>
    </div>  <!-- End of Settings Wrap -->  
    <?php 
}