tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
add_editor_style( 'css/editor-style.css' );
/*
* Enable support for Post Thumbnails on posts and pages.
*
* @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
*/
add_theme_support( 'post-thumbnails' );
// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'primary' => __( 'Primary Menu', 'uniq' ),
) );
/*
* Switch default core markup for search form, comment form, and comments
* to output valid HTML5.
*/
add_theme_support( 'html5', array(
'search-form', 'comment-form', 'comment-list', 'gallery', 'caption',
) );
/*
* Enable support for Post Formats.
* See http://codex.wordpress.org/Post_Formats
*/
add_theme_support( 'post-formats', array(
'aside', 'image', 'video', 'quote', 'link',
) );
add_theme_support( 'custom-background' );
add_theme_support( 'custom-logo' );
}
// Set up the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( 'uniq_custom_background_args', array(
'default-color' => 'ffffff',
'default-image' => '',
) ) );
/*
* Add Additional image sizes
*
*/
add_theme_support( 'post-thumbnails' );
add_image_size( 'uniq-recent-post-img', 220, 220, true);
add_image_size( 'uniq_home_page_img', 130, 130, true );
add_image_size( 'uniq-blog-full-width', 1200,350, true );
add_image_size( 'uniq-small-featured-image-width', 450,300, true );
add_image_size( 'uniq-blog-large-width', 800,300, true );
// Define and register starter content to showcase the theme on new sites.
$starter_content = array(
'widgets' => array(
'top-left' => array(
// Widget ID
'my_text' => array(
// Widget $id -> set when creating a Widget Class
'text' ,
// Widget $instance -> settings
array(
'text' => '
You haven\'t created any slider yet. Create a post, set your slider image as Post\'s featured image ( Recommended image size 1280*450 ) ). Go to Customizer and click uniq Options => Home and select Slider Post Category and No.of Sliders.
You haven\'t created any slider yet. Create a post, set your slider image as Post\'s featured image ( Recommended image size 1280*450 ) ). Go to Customizer and click uniq Options => Home and select Slider Post Category and No.of Sliders.
';
}
remove_action('woocommerce_before_main_content', 'woocommerce_output_content_wrapper');
add_action('woocommerce_before_main_content', 'uniq_output_content_wrapper');
function uniq_output_content_wrapper_end () {
echo "
";
}
add_action( 'init', 'uniq_remove_wc_breadcrumbs' );
function uniq_remove_wc_breadcrumbs() {
remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0 );
}
include_once( get_template_directory() . '/admin/theme-options.php' );
add_action('after_setup_theme', 'uniq_rename_template');
if( !function_exists('uniq_rename_template') ) {
function uniq_rename_template() {
$args = array(
'post_type' => 'page',
'posts_per_page' => -1
);
$template_query = new WP_Query($args);
if( $template_query->have_posts() ) {
while ( $template_query->have_posts() ) :
$template_query->the_post();
$old_template_name = get_post_meta( get_the_ID(), '_wp_page_template', true );
// echo $old_template_name .'';
switch ( $old_template_name ) {
case 'page-full-width.php':
$new_template_name = 'template-full-width.php';
break;
case 'page-leftsidebar.php':
$new_template_name = 'template-leftsidebar.php';
break;
case 'page-rightsidebar.php':
$new_template_name = 'template-rightsidebar.php';
break;
default:
$new_template_name = $old_template_name;
}
if( $old_template_name != $new_template_name) {
update_post_meta( get_the_ID(), '_wp_page_template' ,$new_template_name ,$old_template_name );
}
endwhile; // end of the loop.
}
$template_query = null;
wp_reset_postdata();
}
}