Skip to content

Instantly share code, notes, and snippets.

View kaweski's full-sized avatar

Natasha Kaweski kaweski

View GitHub Profile
@kaweski
kaweski / _personalizado.php
Last active January 11, 2017 19:39
Slider::POO
<?php
$args = array(
'post_id' => 2,
'query_results' => $posts_data,
// 'component' => 'component-clients-01',
'component' => get_template_directory() . '/component-clients-01.php',
'external_component' => true,
'show_link_buttom' => 'Ver mais',
'slick_slider_to_show' => 3,
'slick_slider_to_scroll' => 1,
@kaweski
kaweski / .gitignore
Created November 11, 2016 11:10
.gitignore com Dist
**/node_modules/
*.DS_Store
local-config.php
assets/components
assets/dist/*.css
assets/dist/*.js
page-tester.php
@kaweski
kaweski / functions.php
Created November 7, 2016 12:40
Troca o país padrão da página de checkout
/**
* Manipulate default country
*/
add_filter( 'default_checkout_country', 'change_default_checkout_country' );
function change_default_checkout_country() {
return 'BR'; // country code
}
@kaweski
kaweski / custom_image.php
Last active January 11, 2017 19:40
Informações do autor
$author_image = get_user_meta( $author_id, 'qd_user_image', true );
// Pega a imagem inserida para o custom field
if ( $author_image ) {
echo '<img src="'. $author_image .'" />';
// Pega a imagem do Gravatar
} else {
echo get_avatar( $author_id, 128 );
}
@kaweski
kaweski / head.html
Created November 4, 2016 16:28
Redirect from an HTML page? Is it possible to set up a basic HTML page to redirect to another page on load?
<meta http-equiv="refresh" content="0; url=http://example.com/" />
@kaweski
kaweski / html.php
Created November 3, 2016 17:05
Pega categoria pelo nome e depois pega o ID dessa categoria buscada pelo slug.
<?php
$exclude_category = get_term_by( 'name', 'NOME DA CATEGORIA', 'qewp_category_events' );
$exclude_category_id = $exclude_category->term_id;
?>
@kaweski
kaweski / functions.php
Created November 1, 2016 19:27
Adiciona CSS adicional no painel do Wordpress
/*
* Remove o preview de fotos da página de edição de usuário
*/
function aditionalCSS(){
echo '<style type="text/css">#qd_user_image_id-status { display: none !important; }</style>';
}
add_action('admin_footer', 'aditionalCSS');
@kaweski
kaweski / author.php
Created October 27, 2016 19:42
Verifica o post type
$post_type = $_GET['qd_type'];
if ( $post_type == 'qd_opportunity' ) {
global $wp_query;
$args = array_merge( $wp_query->query_vars, array( 'post_type' => $post_type ) );
query_posts( $args );
}
@kaweski
kaweski / style.less
Created October 25, 2016 13:20
Efeitinho
.qwp-thumbnail {
border-radius: @border-radius-xs;
position: relative;
overflow: hidden;
z-index: 1;
}
.qvp-video-thumb {
.qwp-thumbnail;
margin-top: 0 0 @margin-sm 0;
@kaweski
kaweski / functions.js
Created October 24, 2016 20:13
Números animados
/*========================================
= Números Animados =
========================================*/
$.fn.countTo = function(options) {
// merge the default plugin settings with the custom options
options = $.extend({}, $.fn.countTo.defaults, options || {});
// how many times to update the value, and how much to increment the value on each update
var loops = Math.ceil(options.speed / options.refreshInterval),