Example #1
0
function my_box_post_layout($post)
{
    /* SIDEBARS AND LAYOUTS */
    $sidebars = array_merge(myThemes::cfg('sidebars-list'), (array) myThemes::get('sidebars-list'));
    $layouts = array('right' => get_template_directory_uri() . '/media/admin/images/left.layout.png', 'left' => get_template_directory_uri() . '/media/admin/images/right.layout.png', 'full' => get_template_directory_uri() . '/media/admin/images/full.layout.png');
    /* LAYOUT */
    echo ahtml::template(array('type' => array('template' => 'inline', 'input' => 'logic'), 'label' => __('Use custom layout', 'myThemes'), 'fieldName' => 'use-post-layout', 'action' => "{'t' : '.mythemes-post-layout' , 'f' : '-' }", 'value' => meta::get($post->ID, 'use-post-layout')));
    $use_post_layout = meta::get($post->ID, 'use-post-layout');
    if (strlen($use_post_layout) == 0 || $use_post_layout === "0") {
        $classes = 'mythemes-post-layout hidden';
    } else {
        $classes = 'mythemes-post-layout';
    }
    if ($post->post_type == 'post') {
        $type = 'single';
    } else {
        $type = $post->post_type;
    }
    $layout = meta::dget($post->ID, 'post-layout', myThemes::get($type . '-layout'));
    $rett = ahtml::template(array('type' => array('template' => 'inline', 'input' => 'imageSelect'), 'values' => $layouts, 'coll' => 2, 'label' => __('Select Layout', 'myThemes'), 'fieldName' => 'post-layout', 'value' => $layout, 'action' => "[ 'hs' , { 'full' : '.mythemes-layout-sidebar' } ]"));
    if ($layout == 'full') {
        $sidebarClass = 'mythemes-layout-sidebar hidden';
    } else {
        $sidebarClass = 'mythemes-layout-sidebar';
    }
    $rett .= ahtml::template(array('type' => array('template' => 'inline', 'input' => 'select'), 'values' => $sidebars, 'label' => __('Select sidebar', 'myThemes'), 'fieldName' => 'post-sidebar', 'templateClass' => $sidebarClass, 'value' => meta::dget($post->ID, 'post-sidebar', myThemes::get($type . '-sidebar'))));
    echo ahtml::template(array('type' => array('template' => 'code'), 'content' => $rett, 'templateClass' => $classes));
}
Example #2
0
$sett['show-second-button'] = array('type' => array('template' => 'inline', 'input' => 'logic'), 'action' => "{'t' : '.mythemes-show-second-button' , 'f' : '-' }", 'label' => __('Show second button in header', 'myThemes'));
$showSecondButtonClass = 'mythemes-show-second-button hidden';
if (myThemes::pget('show-second-button')) {
    $showSecondButtonClass = 'mythemes-show-second-button';
}
$sett['second-button-label'] = array('type' => array('template' => 'inline', 'input' => 'text'), 'templateClass' => $showSecondButtonClass, 'label' => __('Second button label', 'myThemes'));
$sett['second-button-desc'] = array('type' => array('template' => 'inline', 'input' => 'textarea'), 'templateClass' => $showSecondButtonClass, 'label' => __('Second button description', 'myThemes'), 'hint' => __('This is link description used for attribute title', 'myThemes'));
$sett['second-button-url'] = array('type' => array('template' => 'inline', 'input' => 'text'), 'templateClass' => $showSecondButtonClass, 'label' => __('Second button URL', 'myThemes'));
/* END OPTIONS WRAPPER */
$sett['options-wrapper-end'] = array('type' => array('template' => 'none'), 'content' => '</div>');
/////////////////////////////////////////
/* LAYOUT SETTINGS */
$sett['front-page-settings-title'] = array('type' => array('template' => 'none'), 'content' => '<div style="padding-top: 80px;" class="title"><h2>' . __('Layout and Templates', 'myThemes') . '</h2></div>');
$layouts = array('right' => get_template_directory_uri() . '/media/admin/images/left.layout.png', 'left' => get_template_directory_uri() . '/media/admin/images/right.layout.png', 'full' => get_template_directory_uri() . '/media/admin/images/full.layout.png');
/* DEFAULT */
$values = myThemes::cfg('sidebars-list');
$sett['layout'] = array('type' => array('template' => 'inline', 'input' => 'imageSelect'), 'values' => $layouts, 'coll' => 3, 'label' => __('Default layout', 'myThemes'), 'hint' => __('If not is set custom layout, will be used default layout.', 'myThemes'), 'action' => "[ 'hs' , { 'full' : '.sidebar' } ]");
if (myThemes::pget('layout') == 'full') {
    $sidebarClass = 'sidebar hidden';
} else {
    $sidebarClass = 'sidebar';
}
$sett['sidebar'] = array('type' => array('template' => 'inline', 'input' => 'select'), 'templateClass' => $sidebarClass, 'values' => $values, 'label' => __('Default sidebar', 'myThemes'));
/* FRONT PAGE */
$sett['front-page-title'] = array('type' => array('template' => 'code'), 'title' => __('Front Page Layout', 'myThemes'));
$sett['front-page-layout'] = array('type' => array('template' => 'inline', 'input' => 'imageSelect'), 'values' => $layouts, 'coll' => 3, 'label' => __('Front page layout', 'myThemes'), 'hint' => __('If not is set custom layout, will be used default layout.', 'myThemes'), 'action' => "[ 'hs' , { 'full' : '.front-page-sidebar' } ]");
if (myThemes::pget('front-page-layout') == 'full') {
    $sidebarClass = 'front-page-sidebar hidden';
} else {
    $sidebarClass = 'front-page-sidebar';
}
                            }

                            the_content();
                        }
                        else{ /* SHOW DEFAULT CONTENT ON FRONT PAGE */ 
                            echo do_shortcode( myThemes::get( 'under-construction-default-text' , true ) );
                        }
                        echo '<div class="clear"></div>';    
                        echo '</div>';
                    ?>
                </div>
            </div>
        </div>	
        <div id="home-footer">
            <div class="menu">
                <nav class="inline linet">
                    <?php
                        $location = get_nav_menu_locations();
                        if( isset( $location[ 'under-construction-menu' ] ) && $location[ 'under-construction-menu' ] > 0 ) {
                            wp_nav_menu( array( 'theme_location' => 'under-construction-menu' ) );
                        }
                    ?>
                </nav>
            </div>    
            <p class="home-footer"> 
                <?php echo myThemes::cfg( 'copyright' ); ?>
            </p>
            <?php wp_footer(); ?>
        </div>
    </body>
</html>