require_once get_template_directory() . '/includes/loader.php';
add_action( 'after_setup_theme', 'rinbuild_setup_theme' );
add_action( 'after_setup_theme', 'rinbuild_load_default_hooks' );
function rinbuild_setup_theme() {
load_theme_textdomain( 'rinbuild', get_template_directory() . '/languages' );
// Add default posts and comments RSS feed links to head.
/*
* Let WordPress manage the document title.
* By adding theme support, we declare that this theme does not use a
* hard-coded
tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
add_theme_support( 'custom-header' );
add_theme_support( 'custom-background' );
add_theme_support('woocommerce');
add_theme_support('wc-product-gallery-lightbox');
/*
* Enable support for Post Thumbnails on posts and pages.
*
* @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/
*/
add_theme_support( 'post-thumbnails' );
add_theme_support( 'automatic-feed-links' );
add_theme_support( 'wp-block-styles' );
add_theme_support( 'align-wide' );
add_theme_support( 'wp-block-styles' );
add_theme_support( 'editor-styles' );
// Set the default content width.
$GLOBALS['content_width'] = 525;
//Register image sizes
add_image_size( 'rinbuild_370x260', 370, 260, true ); //'rinbuild_370x260 Our Projects'
add_image_size( 'rinbuild_270x300', 270, 300, true ); //'rinbuild_270x300 Our Team'
add_image_size( 'rinbuild_70x70', 70, 70, true ); //'rinbuild_70x70 Our Testimonials V2'
add_image_size( 'rinbuild_370x240', 370, 240, true ); //'rinbuild_370x240 Latest News V2 '
add_image_size( 'rinbuild_105x100', 105, 100, true ); //'rinbuild_105x100 Feature Services '
add_image_size( 'rinbuild_270x120', 270, 120, true ); //'rinbuild_270x120 Our Industries '
add_image_size( 'rinbuild_370x383', 370, 383, true ); //'rinbuild_370x383 Our Testimonials V3'
add_image_size( 'rinbuild_330x300', 330, 300, true ); //'rinbuild_330x300 Our Services V2'
add_image_size( 'rinbuild_975x530', 975, 530, true ); //'rinbuild_975x530 Our Projects V4'
add_image_size( 'rinbuild_397x575', 397, 575, true ); //'rinbuild_397x575 Our Testimonials V4'
add_image_size( 'rinbuild_370x270', 370, 270, true ); //'rinbuild_370x270 Our Services V3'
add_image_size( 'rinbuild_270x390', 270, 390, true ); //'rinbuild_270x390 Our Projects V5'
add_image_size( 'rinbuild_270x180', 370, 270, true ); //'rinbuild_270x180 Our projects V5'
add_image_size( 'rinbuild_340x214', 340, 214, true ); //'rinbuild_340x214 Our Testimonials V6'
add_image_size( 'rinbuild_340x240', 340, 240, true ); //'rinbuild_340x240 Our Team V3'
add_image_size( 'rinbuild_270x430', 270, 430, true ); //'rinbuild_270x430 Portfolio Masonry'
add_image_size( 'rinbuild_270x230', 270, 230, true ); //'rinbuild_270x230 Portfolio Masonry'
add_image_size( 'rinbuild_400x327', 400, 327, true ); //'rinbuild_400x327 Blog List View'
add_image_size( 'rinbuild_1170x400', 1170, 400, true ); //'rinbuild_1170x400 Our Blog'
add_image_size( 'rinbuild_85x75', 85, 75, true ); //'rinbuild_85x75 Our Project Widget'
// This theme uses wp_nav_menu() in two locations.
register_nav_menus( array(
'main_menu' => esc_html__( 'Main Menu', 'rinbuild' ),
) );
/*
* Switch default core markup for search form, comment form, and comments
* to output valid HTML5.
*/
add_theme_support( 'html5', array(
'comment-form',
'comment-list',
'gallery',
'caption',
) );
// Add theme support for Custom Logo.
add_theme_support( 'custom-logo', array(
'width' => 250,
'height' => 250,
'flex-width' => true,
) );
// Add theme support for selective refresh for widgets.
add_theme_support( 'customize-selective-refresh-widgets' );
/*
* This theme styles the visual editor to resemble the theme style,
* specifically font, colors, and column width.
*/
add_editor_style();
add_action( 'admin_init', 'rinbuild_admin_init', 2000000 );
}
function rinbuild_gutenberg_editor_palette_styles() {
add_theme_support( 'editor-color-palette', array(
array(
'name' => esc_html__( 'strong yellow', 'rinbuild' ),
'slug' => 'strong-yellow',
'color' => '#f7bd00',
),
array(
'name' => esc_html__( 'strong white', 'rinbuild' ),
'slug' => 'strong-white',
'color' => '#fff',
),
array(
'name' => esc_html__( 'light black', 'rinbuild' ),
'slug' => 'light-black',
'color' => '#242424',
),
array(
'name' => esc_html__( 'very light gray', 'rinbuild' ),
'slug' => 'very-light-gray',
'color' => '#797979',
),
array(
'name' => esc_html__( 'very dark black', 'rinbuild' ),
'slug' => 'very-dark-black',
'color' => '#000000',
),
) );
add_theme_support( 'editor-font-sizes', array(
array(
'name' => esc_html__( 'Small', 'rinbuild' ),
'size' => 10,
'slug' => 'small'
),
array(
'name' => esc_html__( 'Normal', 'rinbuild' ),
'size' => 15,
'slug' => 'normal'
),
array(
'name' => esc_html__( 'Large', 'rinbuild' ),
'size' => 24,
'slug' => 'large'
),
array(
'name' => esc_html__( 'Huge', 'rinbuild' ),
'size' => 36,
'slug' => 'huge'
)
) );
}
add_action( 'after_setup_theme', 'rinbuild_gutenberg_editor_palette_styles' );
/**
* [rinbuild_widgets_init]
*
* @param array $data [description]
*
* @return [type] [description]
*/
function rinbuild_widgets_init() {
global $wp_registered_sidebars;
$theme_options = get_theme_mod( RINBUILD_NAME . '_options-mods' );
register_sidebar( array(
'name' => esc_html__( 'Default Sidebar', 'rinbuild' ),
'id' => 'default-sidebar',
'description' => esc_html__( 'Widgets in this area will be shown on the right-hand side.', 'rinbuild' ),
'before_widget' => '',
'before_title' => '',
) );
register_sidebar(array(
'name' => esc_html__('Footer Widget', 'rinbuild'),
'id' => 'footer-sidebar',
'description' => esc_html__('Widgets in this area will be shown in Footer Area.', 'rinbuild'),
'before_widget'=>'',
'before_title' => ''
));
if ( class_exists( '\Elementor\Plugin' )){
register_sidebar(array(
'name' => esc_html__('Footer Widget Two', 'rinbuild'),
'id' => 'footer-sidebar-2',
'description' => esc_html__('Widgets in this area will be shown in Footer Area.', 'rinbuild'),
'before_widget'=>'',
'before_title' => ''
));
register_sidebar(array(
'name' => esc_html__('Footer Widget Three', 'rinbuild'),
'id' => 'footer-sidebar-3',
'description' => esc_html__('Widgets in this area will be shown in Footer Area.', 'rinbuild'),
'before_widget'=>'',
'before_title' => ''
));
register_sidebar(array(
'name' => esc_html__('Footer Widget Four', 'rinbuild'),
'id' => 'footer-sidebar-4',
'description' => esc_html__('Widgets in this area will be shown in Footer Area.', 'rinbuild'),
'before_widget'=>'',
'before_title' => ''
));
register_sidebar(array(
'name' => esc_html__('Footer Widget Five', 'rinbuild'),
'id' => 'footer-sidebar-5',
'description' => esc_html__('Widgets in this area will be shown in Footer Area.', 'rinbuild'),
'before_widget'=>'',
'before_title' => ''
));
register_sidebar(array(
'name' => esc_html__('Services Widget', 'rinbuild'),
'id' => 'service-sidebar',
'description' => esc_html__('Widgets in this area will be shown in Services Area.', 'rinbuild'),
'before_widget'=>'',
'before_title' => ''
));
}
register_sidebar(array(
'name' => esc_html__( 'Blog Listing', 'rinbuild' ),
'id' => 'blog-sidebar',
'description' => esc_html__( 'Widgets in this area will be shown on the right-hand side.', 'rinbuild' ),
'before_widget'=>'',
'before_title' => ''
));
if ( ! is_object( rinbuild_WSH() ) ) {
return;
}
$sidebars = rinbuild_set( $theme_options, 'custom_sidebar_name' );
foreach ( array_filter( (array) $sidebars ) as $sidebar ) {
if ( rinbuild_set( $sidebar, 'topcopy' ) ) {
continue;
}
$name = $sidebar;
if ( ! $name ) {
continue;
}
$slug = str_replace( ' ', '_', $name );
register_sidebar( array(
'name' => $name,
'id' => sanitize_title( $slug ),
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
) );
}
update_option( 'wp_registered_sidebars', $wp_registered_sidebars );
}
add_action( 'widgets_init', 'rinbuild_widgets_init' );
/**
* [rinbuild_admin_init]
*
* @param array $data [description]
*
* @return [type] [description]
*/
function rinbuild_admin_init() {
remove_action( 'admin_notices', array( 'ReduxFramework', '_admin_notices' ), 99 );
}
/**
* [rinbuild_set description]
*
* @param array $data [description]
*
* @return [type] [description]
*/
if ( ! function_exists( 'rinbuild_set' ) ) {
function rinbuild_set( $var, $key, $def = '' ) {
//if( ! $var ) return false;
if ( is_object( $var ) && isset( $var->$key ) ) {
return $var->$key;
} elseif ( is_array( $var ) && isset( $var[ $key ] ) ) {
return $var[ $key ];
} elseif ( $def ) {
return $def;
} else {
return false;
}
}
}
function rinbuild_add_editor_styles() {
add_editor_style( 'editor-style.css' );
}
add_action( 'admin_init', 'rinbuild_add_editor_styles' );
// Add specific CSS class by filter.
$options = rinbuild_WSH()->option();
if( rinbuild_set($options, 'boxed_wrapper') ){
add_filter( 'body_class', function( $classes ) {
$classes[] = 'boxed_wrapper';
return $classes;
} );
}
function rinbuild_related_products_limit() {
global $product;
$args['posts_per_page'] = 6;
return $args;
}
add_filter( 'woocommerce_output_related_products_args', 'rinbuild_related_products_args', 20 );
function rinbuild_related_products_args( $args ) {
$args['posts_per_page'] = 3; // 4 related products
$args['columns'] = 1; // arranged in 2 columns
return $args;
}
https://www.enkaysurucukursu.com.tr/wp-sitemap-posts-post-1.xmlhttps://www.enkaysurucukursu.com.tr/wp-sitemap-posts-page-1.xmlhttps://www.enkaysurucukursu.com.tr/wp-sitemap-posts-rinbuild_team-1.xmlhttps://www.enkaysurucukursu.com.tr/wp-sitemap-taxonomies-category-1.xmlhttps://www.enkaysurucukursu.com.tr/wp-sitemap-taxonomies-team_cat-1.xmlhttps://www.enkaysurucukursu.com.tr/wp-sitemap-users-1.xml