Skip to content

Instantly share code, notes, and snippets.

View AlexandrKutsenko's full-sized avatar

Alexandr AlexandrKutsenko

View GitHub Profile
HTML:
<div class="wrapper">
<div class="tabs">
<span class="tab">Вкладка 1</span>
<span class="tab">Вкладка 2</span>
<span class="tab">Вкладка 3</span>
</div>
<div class="tab_content">
<div class="tab_item">Содержимое 1</div>
<div class="tab_item">Содержимое 2</div>
@AlexandrKutsenko
AlexandrKutsenko / functions.php
Created May 21, 2018 17:58
Add theme options on wordpress
<?php
// Load up our awesome theme options
require_once ( get_stylesheet_directory() . '/theme-options.php' );
@AlexandrKutsenko
AlexandrKutsenko / Register theme scripts
Created May 21, 2018 09:13
Register theme scripts
/*
* Register theme scripts
*/
function register_scripts() {
wp_enqueue_script('main-theme-js-scripts', get_template_directory_uri() . '/assets/js/home.js', array('jquery'), null, true);
}
add_filter('wp_enqueue_scripts', 'register_scripts');
@AlexandrKutsenko
AlexandrKutsenko / Register theme styles
Created May 21, 2018 09:08
Register theme styles
/*
* Register theme styles
*/
function register_styles() {
wp_enqueue_style('main-theme-style-css', get_template_directory_uri() . '/assets/css/style.css');
}
add_filter('wp_enqueue_scripts', 'register_styles');
@AlexandrKutsenko
AlexandrKutsenko / Register portfolio fields post type
Created May 21, 2018 09:07
Register portfolio fields post type
/*
* Register portfolio fields post type
*/
function add_portfolio_img_post_type() {
register_post_type('add_portfolio_img', array(
'public' => true,
'labels' => array(
'name' => __('Картинки портфолио')
)
));
@AlexandrKutsenko
AlexandrKutsenko / Hide Admin bar of wordpress
Created May 21, 2018 08:59
Hide Admin bar of wordpress
/*
* Hide Admin bar of wordpress
*/
function hide_admin_bar() {
show_admin_bar(false);
}
add_action('init', 'hide_admin_bar');
body {
background-color: #333;
}
#sandwich {
width: 100px;
height: 100px;
position: absolute;
top: 0;
bottom: 0;
left: 0;
$(window).load(function() {
$(".loader_inner").delay(600).fadeOut();
$(".loader").delay(600).fadeOut("slow");
});
function heightDetect() {
$(".main_head").css("height", $(window).height());
};
heightDetect();
$(window).resize(function() {
heightDetect();
});