<?php

$themename = "Sgswpt";
$themefolder = "sgswpt";

define ('theme_name', $themename );
define ('theme_ver' , 1 );

// Notifier Info
$notifier_name = $themename;
$notifier_url = "http://orionthemes.com/theme-updates/".$themefolder.".xml";

//Docs Url
$docs_url = "http://orionthemes.com/theme-documentation/".$themefolder;

// Constants for the theme name, folder and remote theme-updates url
define( 'MTHEME_NOTIFIER_THEME_NAME', $themename );
define( 'MTHEME_NOTIFIER_THEME_FOLDER_NAME', $themefolder );
define( 'MTHEME_NOTIFIER_XML_FILE', $notifier_url );
define( 'MTHEME_NOTIFIER_CACHE_INTERVAL', 43200 );
?>
<?php
//odd and even loop
function oddeven_post_class ( $classes ) {
   global $current_class;
   $classes[] = $current_class;
   $current_class = ($current_class == 'odd') ? 'even' : 'odd';
   return $classes;
}
add_filter ( 'post_class' , 'oddeven_post_class' );
global $current_class;
$current_class = 'odd';

// Custom Functions 
include (TEMPLATEPATH . '/custom-functions.php');

// Get Functions
include (TEMPLATEPATH . '/inc/functions/theme-functions.php');
include (TEMPLATEPATH . '/inc/head-styles-scripts.php');
include (TEMPLATEPATH . '/inc/functions/banners.php');
include (TEMPLATEPATH . '/inc/functions/widgetize-theme.php');
include (TEMPLATEPATH . '/theme-options/settings-default-options.php');
include (TEMPLATEPATH . '/inc/functions/updates.php');

// oriont-Panel
include (TEMPLATEPATH . '/theme-options/settings-front-end.php');
include (TEMPLATEPATH . '/theme-options/settings-back-end.php');
include (TEMPLATEPATH . '/theme-options/notifier/update-notifier.php');

// 
include (TEMPLATEPATH . '/inc/pagenavi.php');
include (TEMPLATEPATH . '/inc/breadcrumbs.php');
include (TEMPLATEPATH . '/inc/wp_list_comments.php');
include (TEMPLATEPATH . '/inc/widgets.php');



if ( ! isset( $content_width ) ) $content_width = 618;


// with activate istall option
if ( is_admin() && isset($_GET['activated'] ) && $pagenow == 'themes.php' ) {

	if( !get_option('oriont_active') ){
		oriont_save_settings( $default_data );
		update_option( 'oriont_active' , theme_ver );
	}
   //header("Location: admin.php?page=theme_options");
   
}
?>
<?php
//QUANT POSTS HOME
function quant_posts_on_homepage( $query ) {
    if ( $query->is_home() && $query->is_main_query() ) {
        $query->set( 'posts_per_page', oriont_get_option('home_number_posts_per_page') );
    }
}
add_action( 'pre_get_posts', 'quant_posts_on_homepage' );

//QUANT POSTS CATEGORY
function quant_posts_on_category( $query ) {
    if ( $query->is_category() && $query->is_main_query() ) {
        $query->set( 'posts_per_page', oriont_get_option('archive_number_posts_per_page') );
    }
}
add_action( 'pre_get_posts', 'quant_posts_on_category' );

?>
<?php
function bm_dont_display_it($content) {
  if (!empty($content)) {
    $content = str_ireplace('<li>' .__( "No categories" ). '</li>', "", $content);
  }
  return $content;
}
add_filter('wp_list_categories','bm_dont_display_it');
?>