Skip to content

Instantly share code, notes, and snippets.

View WebTarantul's full-sized avatar

Taras Kapusta WebTarantul

View GitHub Profile
@WebTarantul
WebTarantul / SublimeText-settings
Created January 19, 2018 17:05
настройка SublimeText
{
"show_definitions": false,
"auto_complete": false,
"bold_folder_labels": true,
"color_scheme": "Packages/One Dark Material - Theme/schemes/OneDark.tmTheme",
"fold_buttons": false,
"font_size": 13,
"highlight_line": true,
"indent_guide_options":
[
@WebTarantul
WebTarantul / Default (Windows).sublime-keymap
Created January 19, 2018 17:08
Настройка Key Bindings
[
{ "keys": ["alt+shift+f"], "command": "reindent" },
]
@WebTarantul
WebTarantul / jQuery Page Preload
Last active January 22, 2018 17:36
jQuery Page Preload
.loader
background: none repeat scroll 0 0 #ffffff
bottom: 0
height: 100%
left: 0
position: fixed
right: 0
top: 0
width: 100%
z-index: 9999
@WebTarantul
WebTarantul / jQuery Resize Height
Last active January 30, 2018 15:55
jQuery Resize Height
$(document).ready(function() {
function windowResize() {
$("header").css("min-height", $(window).height());
}
windowResize();
$(window).resize(function() {
windowResize();
});
});
@WebTarantul
WebTarantul / WorPress query_posts
Created January 27, 2018 14:03
WorPress query_posts
<?php if ( have_posts() ) : query_posts('p=1');
while (have_posts()) : the_post(); ?>
<?php the_title(); ?>
<?php the_content(); ?>
<?php the_post_thumbnail(array(100, 100)); ?>
<?php endwhile; endif; wp_reset_query(); ?>
@WebTarantul
WebTarantul / gist:fd4d7ff654d4ee21eb1f18fd88940117
Created January 27, 2018 15:58
Адрес к дополнительному полю WP
<?php echo get_post_meta($post->ID, 'название доп-поля', true) ; ?>
@WebTarantul
WebTarantul / WP имя и описание рубрики
Last active January 29, 2018 17:21
WP имя и описание рубрики
<?php
$idObj = get_category_by_slug('название ярлыка рубрики');
$id = $idObj->term_id;
echo get_cat_name($id);
?> /*Добавить имя рубрики*/
<?php echo category_description($id); ?> /*Добавить описание рубрики*/
<?php
$tags = get_tags();
if ($tags) {
foreach ($tags as $tag) {
echo '<p>Tag: <a href="' . get_tag_link( $tag->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $tag->name ) . '" ' . '>' . $tag->name.'</a> </p> ';
}
}
?>
<?php
$tags = wp_get_post_tags($post->ID);
//In Template
<?php
$options = get_option('sample_theme_options');
echo $options['phone1'];
?>
//in functions.php
require_once ( get_stylesheet_directory() . '/theme-options.php' );
//theme-options.php file:
<?php
$idObj = get_category_by_slug('s_about');
$id = $idObj->term_id;
echo get_cat_name($id);
?>