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
@luisfelipe-dev
luisfelipe-dev / Php Init WP
Created November 25, 2016 17:46
Loop para adicionar uma classe ao primeiro elemento.
<?php $firstMarked = false; ?>
<?php if ( have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<dt class="collapsible-title <?php echo !$firstMarked ? "is-active":"";?>">
<h1><?php the_field('titulo1_video'); ?></h1>
<h2><?php the_field('titulo2_video'); ?></h2>
</dt>
<dd class="collapsible-content">
$('a[href*=#]').each(function () {
if (filterPath(location.pathname) == filterPath(this.pathname)
&& location.hostname == this.hostname
&& this.hash.replace(/#/, '')) {
var $targetId = $(this.hash), $targetAnchor = $('[name=' + this.hash.slice(1) + ']');
var $target = $targetId.length ? $targetId : $targetAnchor.length ? $targetAnchor : false;
if ($target) {
var targetOffset = $target.offset().top;
$(this).click(function () {
if($(window).width() > 200){
@luisfelipe-dev
luisfelipe-dev / Wordpress Shortcodes
Created November 9, 2016 12:02
Shortcodes , Wordpress
// Definimos o gatilho 'youtube' para a função 'shortcode_youtube'
add_shortcode('caixa', 'short_code');
// Função que retorna o HTML pelo Shotcode
function short_code($atts, $content=null)
{
extract(
shortcode_atts(
array(
<!-- A ideia é essa , colocar como uma div fora da seção e adicionar os espaço para quando rolar o menu, ficar certinho
em cima da seção! :D -->
#o-espaco{
height: 140px;
width: 100%;
margin-top: -140px;
}
href="javascript: history.go(-1)"
$(document).ready(function() {
$('a[href^="#"]').on('click',function (e) {
e.preventDefault (); var target = this.hash,
$target = $(target); $('html, body').stop().animate ({
'scrollTop': $target.offset().top
}, 1000, 'swing', function () {
window.location.hash = target;
});
});
});
@luisfelipe-dev
luisfelipe-dev / Barra de Rolagem Personalizada
Last active January 22, 2023 14:31
barra de rolagem, scroll
::-webkit-scrollbar {
width: 8px;
}
::-webkit-scrollbar-track {
background-color: #eaeaea;
}
::-webkit-scrollbar-thumb {
background-color: #b0b0b0;
border-radius: 6px;
cursor: pointer;