Skip to content

Instantly share code, notes, and snippets.

View luisfelipe-dev's full-sized avatar
:octocat:
👨🏻‍💻

Luís Felipe de Olivera luisfelipe-dev

:octocat:
👨🏻‍💻
View GitHub Profile
//CUSTOM POST TYPE
function custom_post_type_modalidades() {
register_post_type('modalidades', array(
'label' => 'Modalidades',
'description' => 'Modalidades',
'public' => true,
'menu_icon' => 'dashicons-shield-alt',
'show_ui' => true,
'show_in_menu' => true,
'capability_type' => 'page',
@luisfelipe-dev
luisfelipe-dev / Borda Abaixo do Titulo
Created October 9, 2017 15:45
Adicionar uma borda abaixo do titulo
&:before, &:after {
content: "";
display: block;
width: 60px;
height: 3px;
background: #fff;
margin: 14px auto 10px auto;
}
@mixin anima-slow {
-o-transition: all 0.3s linear;
-moz-transition: all 0.3s linear;
-khtml-transition: all 0.3s linear;
-webkit-transition: all 0.3s linear;
-ms-transition: all 0.3s linear;
transition: all 0.3s linear;
}
@mixin anima-normal {
@luisfelipe-dev
luisfelipe-dev / Font Awesome After CSS
Last active April 4, 2018 20:40
Colocar icone do Font Awesome antes do texto por CSS
a:before {
font-family: FontAwesome;
content: "\f095";
display: inline-block;
padding-right: 3px;
vertical-align: middle;
}
FONT AWESOME VERSÃO 5:
@luisfelipe-dev
luisfelipe-dev / CSS DIAGONAL
Created June 23, 2017 18:40
Classe para criar um efeito de corte diagonal
Classe para criar efeito diagonal no before
h2{
padding-top: 2rem;
width: 70%;
position: relative;
font-size: 1.625em;
&:before{
position: absolute;
content: '';
@luisfelipe-dev
luisfelipe-dev / Menu Wordpress
Created May 16, 2017 18:58
Funções para criar menu no Wordpress
functions.php:
//MENU
class dwf_walker extends Walker {
var $db_fields = array(
'parent' => 'menu_item_parent',
'id' => 'db_id'
);
@luisfelipe-dev
luisfelipe-dev / Limitar Resumo do POST WP
Last active October 18, 2018 17:14
Coloque no Functions.php para limitar o número de caracteres do seu resumo
// LIMITAR RESUMO DO POST
function novo_tamanho_do_resumo($length) {
return 30;
}
add_filter('excerpt_length', 'novo_tamanho_do_resumo');
function new_excerpt_more($more) {
return '...';
}
add_filter('excerpt_more', 'new_excerpt_more');
@luisfelipe-dev
luisfelipe-dev / Efeito Scroll
Last active November 2, 2017 13:29
Efeito Scroll muito fácil de fazer!
$('.heading a').click(function(e){ //COLOCAR A CLASSE DO MENU NO LUGAR DO '.heading'
e.preventDefault();
var id = $(this).attr('href'),
targetOffset = $(id).offset().top,
menuHeight = $('.heading').innerHeight(); //COLOCAR A CLASSE DO MENU NO LUGAR DO '.heading'
$('html,body').animate({
scrollTop: targetOffset - menuHeight
},500); //500 = VELOCIDADE DO SCROLL
});
@luisfelipe-dev
luisfelipe-dev / Imagem destaque WP como BG
Created March 28, 2017 14:47
Colocar a imagem de destaque do Wordpress como background.
<?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post' ); ?>
<div class="foto_blog-novo" style='background: url("<?php echo $image[0]; ?>") no-repeat center; background-size: cover;' >
</div><!-- /foto_blog-novo -->
<?php
$images = get_field('galeria1');
if( $images ): ?>
<div id="sync1" class="owl-carousel">
<?php foreach( $images as $image ): ?>
<div class="item"><h1><img src="<?php echo $image['sizes']['large']; ?>" alt="<?php echo $image['alt']; ?>" /></h1></div>