function wt_register_portfolio_post_type()
{
    // Rewriting Permalink Slug
    $permalink_slug = trim(wt_get_option('portfolio', 'permalink_slug'));
    if (empty($permalink_slug)) {
        $permalink_slug = 'portfolio';
    }
    register_post_type('wt_portfolio', array('labels' => array('name' => _x('Portfolio Items', 'post type general name', 'wt_admin'), 'singular_name' => _x('Portfolio Item', 'post type singular name', 'wt_admin'), 'add_new' => _x('Add New', 'wt_portfolio', 'wt_admin'), 'add_new_item' => __('Add New Portfolio Item', 'wt_admin'), 'edit_item' => __('Edit Portfolio Item', 'wt_admin'), 'new_item' => __('New Portfolio Item', 'wt_admin'), 'view_item' => __('View Portfolio Item', 'wt_admin'), 'search_items' => __('Search Portfolio Items', 'wt_admin'), 'not_found' => __('No portfolio item found', 'wt_admin'), 'not_found_in_trash' => __('No portfolio items found in Trash', 'wt_admin'), 'parent_item_colon' => '', 'menu_name' => __('Portfolio items', 'wt_admin')), 'singular_label' => __('wt_portfolio', 'wt_admin'), 'public' => true, 'publicly_queryable' => true, 'exclude_from_search' => false, 'show_ui' => true, 'show_in_menu' => true, 'capability_type' => 'post', 'hierarchical' => false, 'supports' => array('title', 'editor', 'excerpt', 'thumbnail', 'comments', 'page-attributes', 'custom-fields'), 'has_archive' => false, 'rewrite' => array('slug' => $permalink_slug, 'with_front' => true, 'pages' => true, 'feeds' => false), 'query_var' => false, 'can_export' => true, 'show_in_nav_menus' => true));
    //register taxonomy for portfolio
    register_taxonomy('wt_portfolio_category', 'wt_portfolio', array('hierarchical' => true, 'labels' => array('name' => _x('Portfolio Categories', 'taxonomy general name', 'wt_admin'), 'singular_name' => _x('Portfolio Category', 'taxonomy singular name', 'wt_admin'), 'search_items' => __('Search Categories', 'wt_admin'), 'popular_items' => __('Popular Categories', 'wt_admin'), 'all_items' => __('All Categories', 'wt_admin'), 'parent_item' => null, 'parent_item_colon' => null, 'edit_item' => __('Edit Portfolio Category', 'wt_admin'), 'update_item' => __('Update Portfolio Category', 'wt_admin'), 'add_new_item' => __('Add New Portfolio Category', 'wt_admin'), 'new_item_name' => __('New Portfolio Category Name', 'wt_admin'), 'separate_items_with_commas' => __('Separate Portfolio category with commas', 'wt_admin'), 'add_or_remove_items' => __('Add or remove portfolio category', 'wt_admin'), 'choose_from_most_used' => __('Choose from the most used portfolio category', 'wt_admin'), 'menu_name' => __('Categories', 'wt_admin')), 'public' => false, 'show_in_nav_menus' => true, 'show_ui' => true, 'show_tagcloud' => false, 'query_var' => true, 'rewrite' => false));
}
function get_sidebar_options()
{
    $sidebars = wt_get_option('sidebar', 'sidebars');
    if (!empty($sidebars)) {
        $sidebars_array = explode(',', $sidebars);
        $options = array();
        foreach ($sidebars_array as $sidebar) {
            $options[$sidebar] = $sidebar;
        }
        return $options;
    } else {
        return array();
    }
}
function jk_related_products_args($args)
{
    $layout = wt_get_option('general', 'woo_layout');
    if ($layout != 'full') {
        $args['posts_per_page'] = 3;
        // 4 related products
        $args['columns'] = 3;
        // arranged in 2 columns
    } else {
        $args['posts_per_page'] = 4;
        // 4 related products
        $args['columns'] = 4;
        // arranged in 4 columns
    }
    return $args;
}
function theme_woocommerce_output_content_wrapper_end()
{
    ?>
                    <?php 
    if (wt_get_option('general', 'woo_layout') != 'full') {
        echo '</div> <!-- End wt_mainInner -->';
        echo '</div> <!-- End wt_main -->';
    }
    ?>
                       
				   <?php 
    if (wt_get_option('general', 'woo_layout') == 'right') {
        echo '<aside id="wt_sidebar" class="col-sm-3 col-md-3 col-lg-3 col-xs-12">';
        get_sidebar();
        echo '</aside> <!-- End wt_sidebar -->';
    }
    ?>
         
                 <?php 
    if (wt_get_option('general', 'woo_layout') == 'full') {
        echo '</div>';
    }
    ?>
 
               </div> <!-- End wt_row -->
            </div> <!-- End container -->	
		</div> <!-- End wt_content -->
	</div> <!-- End wt_container -->
</div> <!-- End containerWrapper -->
</div> <!-- End containerWrapp -->
<?php 
    //get_footer();
    ?>

<?php 
}
 function wt_get_sidebar($post_id)
 {
     if (is_page()) {
         $wt_sidebar = $this->wt_sidebar_names['page'];
     }
     if (is_home() || is_front_page() || $post_id == wt_get_option('homepage', 'home_page')) {
         $home_page_id = wt_get_option('homepage', 'home_page');
         $post_id = get_object_id($home_page_id, 'page');
         $wt_sidebar = $this->wt_sidebar_names['home'];
     }
     if (is_page_template('template_blog.php')) {
         $wt_sidebar = $this->wt_sidebar_names['blog'];
     }
     if (is_singular('post')) {
         $wt_sidebar = $this->wt_sidebar_names['blog'];
     } elseif (is_singular('wt_portfolio')) {
         $wt_sidebar = $this->wt_sidebar_names['wt_portfolio'];
     }
     if (is_search() || is_archive()) {
         $wt_sidebar = $this->wt_sidebar_names['blog'];
     }
     if (wt_get_option('general', 'woocommerce')) {
         if (is_woocommerce() || is_cart() || is_checkout() || is_account_page()) {
             $wt_sidebar = dynamic_sidebar(__('Products Area', 'wt_admin'));
         }
     }
     if (!empty($post_id) && !is_archive()) {
         $wt_custom = get_post_meta($post_id, '_sidebar', true);
         if (!empty($wt_custom)) {
             $wt_sidebar = $wt_custom;
         }
     }
     if (isset($wt_sidebar)) {
         dynamic_sidebar($wt_sidebar);
     }
 }
                                            <div class="wt_clearboth"></div>
                                        </div>
                                    </div>
                                    </section>
                                    <?php 
        }
        ?>
                    
                                <?php 
        if (wt_get_option('blog', 'author') || wt_get_option('blog', 'related_popular')) {
            ?>
</footer><?php 
        }
        ?>
                                <?php 
        if (wt_get_option('blog', 'entry_navigation')) {
            ?>
                                <div class="entry_navigation">
                                    <div class="nav-previous"><?php 
            previous_post_link('%link', '<span class="meta-nav">' . _x('&larr;', 'Previous post link', 'wt_front') . '</span> %title', true);
            ?>
</div>
                                    <div class="nav-next"><?php 
            next_post_link('%link', '%title <span class="meta-nav">' . _x('&rarr;', 'Next post link', 'wt_front') . '</span>', true);
            ?>
</div>
                                </div>
                                <?php 
        }
        ?>
                            <?php 
 function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0)
 {
     global $wp_query;
     $indent = $depth ? str_repeat("\t", $depth) : '';
     $depth = $depth + 1;
     $class_names = $value = '';
     $classes = empty($item->classes) ? array() : (array) $item->classes;
     $class_names = join(' ', apply_filters('nav_menu_css_class', array_filter($classes), $item));
     $class_names = ' class="' . esc_attr($class_names) . ' level-' . $depth . '-li"';
     $output .= $indent . '<li id="menu-item-' . $item->ID . '"' . $value . $class_names . '>';
     $attributes = !empty($item->attr_title) ? ' title="' . esc_attr($item->attr_title) . '"' : '';
     $attributes .= !empty($item->target) ? ' target="' . esc_attr($item->target) . '"' : '';
     $attributes .= !empty($item->xfn) ? ' rel="' . esc_attr($item->xfn) . '"' : '';
     $attributes .= !empty($item->url) ? ' href="' . esc_attr($item->url) . '"' : '';
     if (wt_get_option('general', 'menu_icons')) {
         $icons = '<i></i>';
         $icons_class = 'menu_icon ';
     } else {
         $icons = '';
         $icons_class = '';
     }
     $item_output = $args->before;
     $item_output .= '<a' . $attributes . ' class="' . $icons_class . 'level-' . $depth . '-a">' . $icons . '<span data-hover="' . $args->link_before . apply_filters('the_title', $item->title, $item->ID) . '">';
     $item_output .= $args->link_before . apply_filters('the_title', $item->title, $item->ID);
     $item_output .= '</span></a>';
     $item_output .= $args->after;
     $output .= apply_filters('walker_nav_menu_start_el', $item_output, $item, $depth, $args);
 }
    ?>
 
                </div>
            <?php 
} else {
    ?>
                <div id="logo" class="navbar-header">
                    <a class="navbar-brand" href="<?php 
    echo home_url('/');
    ?>
"><?php 
    echo wt_get_option('general', 'plain_logo');
    ?>
</a>
                <?php 
    if (wt_get_option('general', 'display_site_desc')) {
        $site_desc = get_bloginfo('description');
        if (!empty($site_desc)) {
            ?>
                        <div id="siteDescription"><?php 
            bloginfo('description');
            ?>
</div>
                <?php 
        }
    }
    ?>
                </div>
            <?php 
}
?>
        the_title();
        ?>
</a></h2>
        <?php 
        if (!is_search()) {
            ?>
        <footer class="blogEntry_metadata">
            <?php 
            echo wt_theme_generator('wt_blog_meta');
            ?>
        </footer>
        <?php 
        }
        ?>
        <?php 
        if (wt_get_option('blog', 'display_full')) {
            global $more;
            $more = 0;
            the_content(__('Read more &raquo;', 'wt_front'), false);
        } else {
            the_excerpt();
            ?>
        <?php 
            wp_link_pages(array('before' => '<div class="wp-pagenavi post_navi"><span class="page-links-title">' . __('Pages:', 'wt_front') . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>'));
            ?>
        <a class="read_more_link" href="<?php 
            the_permalink();
            ?>
"><?php 
            echo __('Read more &raquo;', 'wt_front');
            ?>
#wt_page {
\t/*overflow: hidden;*/
}
CSS;
}
/* non responsive settings */
$non_responsive_css = '';
if (!wt_get_option('general', 'enable_responsive')) {
    $non_responsive_css .= <<<CSS
#wt_wrapper {
\tmin-width: 1000px;
}
CSS;
}
/* custom css */
$custom_css = wt_get_option('general', 'custom_css');
/* Css output */
return <<<CSS
body {
\tfont-size: {$font['content_page']}px;
\tfont-family: {$font['font_family']};
\tcolor: {$color['page_content']};\t
}
{$non_responsive_css}
{$responsive_css}\t
{$fontface_css}
{$googlefonts_css}
{$sections_css}\t
{$custom_skin}
#anything_slider_wrap,
#anything_slider_loading, 
                                        <?php 
            wt_previous_post_link_plus();
            ?>
                                    </div>
                                    <div class="nav-next">
                                        <?php 
            wt_next_post_link_plus();
            ?>
                                    </div>
                                </div>
                            <?php 
        }
        ?>
                        
                            <?php 
        if (wt_get_option('portfolio', 'enable_comment')) {
            comments_template('', true);
        }
        ?>
                        <?php 
    }
}
// end of the loop
?>
						<?php 
if ($layout == 'full') {
    echo '</div> <!-- End col-12 -->';
}
?>
 
                    </div> <!-- End row -->
                        <li><?php 
_e('Try using the serch box or our sitemap below.', 'wt_front');
?>
</li>
                    </ol>
                       <?php 
get_search_form();
?>
                      <div class="error_page">
                          <a href="" target="_self" class="wt_button small"><span>Back to Home</span></a>
                      </div>
    
                     </div>
                   <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12 text-center">
                  <?php 
$skin = wt_get_option('general', 'skin');
?>
                       <img src="<?php 
echo get_template_directory_uri();
?>
/css/skins/<?php 
echo $skin;
?>
/404.png" alt="" />
                   </div>
                </div> <!-- End container -->
            </div> <!-- End wt_content -->
        </div> <!-- End wt_container -->
    </div> <!-- End wt_containerWrapp -->
</div> <!-- End wt_containerWrapper -->
<?php 
} elseif (is_page_template('template_blog.php') || is_tag()) {
    $layout = wt_get_option('blog', 'layout');
} elseif (is_single()) {
    $layout = get_post_meta($post->ID, '_sidebar_alignment', true);
    if (empty($layout) || $layout == 'default') {
        $layout = wt_get_option('blog', 'single_layout');
    }
} elseif (is_archive()) {
    if (is_tax('wt_portfolio')) {
        $layout = wt_get_option('portfolio', 'layout');
    } elseif (wt_get_option('general', 'woocommerce') && (is_woocommerce() || is_cart() || is_checkout() || is_account_page())) {
        //$layout = wt_get_option('general', 'sidebar_alignment');
        $layout = 'right';
    } else {
        //$layout = wt_get_option('general', 'sidebar_alignment');
        $layout = 'right';
    }
} elseif (is_search()) {
    $layout = wt_get_option('blog', 'layout');
} elseif (is_page_template('template_left_sidebar.php')) {
    $layout = 'left';
} elseif (is_page_template('template_right_sidebar.php')) {
    $layout = 'right';
} elseif (is_page_template('gallery-2-columns.php') || is_page_template('gallery-3-columns.php') || is_page_template('gallery-4-columns.php') || is_page_template('gallery-responsive.php')) {
    $layout = get_post_meta($post->ID, '_gallery_alignment', true);
} elseif (is_page_template('template_fullwidth.php') || is_404()) {
    $layout = 'full';
} else {
    //$layout = wt_get_option('general', 'sidebar_alignment');
    $layout = 'full';
}
 function theme_add_cufon_script()
 {
     $fonts = wt_get_option('fonts', 'cufonfonts');
     if (is_array($fonts)) {
         foreach ($fonts as $font) {
             wp_register_script($font, THEME_FONT_URI . '/' . $font, array('cufon-yui'));
             wp_enqueue_script($font);
         }
     }
     wp_enqueue_script('cufon-yui');
 }
		<?php 
    dynamic_sidebar(__('Footer Bottom Area', 'wt_admin'));
    ?>
      
	</div> <!-- End container -->
</footer> <!-- End footerBottom -->
<?php 
}
?>
</div> <!-- End footerWrapper -->

</div> <!-- End wt_page -->
</div> <!-- End wrapper -->
<script type="text/javascript">
/* <![CDATA[ */
var theme_uri="<?php 
echo THEME_URI;
?>
";
/* ]]> */
</script>
<?php 
wt_scripts();
wt_add_cufon_code_footer();
if (wt_get_option('general', 'analytics')) {
    echo stripslashes(wt_get_option('general', 'analytics'));
}
wp_footer();
?>
</body>
</html>
 /**
  * Loads the core theme functions.
  */
 function wt_functions()
 {
     require_once THEME_FUNCTIONS . '/theme-functions.php';
     /* Load theme's options. */
     $this->wt_options();
     require_once THEME_FUNCTIONS . '/custom_scripts.php';
     require_once THEME_FILES . '/theme-features.php';
     require_once THEME_FILES . '/sidebar.php';
     if (wt_get_option('general', 'woocommerce')) {
         require_once THEME_FUNCTIONS . '/woocommerce.php';
         require_once THEME_FUNCTIONS . '/woocommerce_config.php';
     }
 }
    function wt_staticImage($type)
    {
        if (has_post_thumbnail()) {
            $image_src_array = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full', true);
            $featured_image = wt_get_image_src($image_src_array[0]);
        }
        if (!empty($featured_image) && $type == 'static_image') {
            $staticImg = $featured_image;
        } else {
            $staticImg = wt_get_option('introheader', 'static_image');
        }
        $width = 980;
        $static_adaptive_height = wt_get_option('introheader', 'static_adaptive_height');
        if ($static_adaptive_height) {
            $height = floor($width * ($image_src_array[2] / $image_src_array[1]));
        } else {
            $height = wt_get_option('introheader', 'static_image_height');
        }
        $lightbox = '<a href="' . $staticImg . '" data-rel="lightbox" title="' . get_the_title() . '">';
        $image_src = aq_resize($staticImg, $width, $height, true);
        //resize & crop img
        ?>
	<header id="wt_intro">
		<div class="container">
        	<div class="intro_staticImage">
                <?php 
        echo wt_get_option('introheader', 'static_image_lightbox') ? $lightbox : '';
        ?>
				<img src="<?php 
        echo $image_src;
        ?>
" alt="<?php 
        the_title();
        ?>
" />
                <?php 
        echo wt_get_option('introheader', 'static_image_lightbox') ? '</a>' : '';
        ?>
			</div>
		</div>
	</header>
<?php 
    }