Skip to content

Instantly share code, notes, and snippets.

View renanlara's full-sized avatar

Renan Lara renanlara

View GitHub Profile
@renanlara
renanlara / main.js
Created July 3, 2018 12:38
Accordion Bootstrap - Add icon open and close
$('.panel-collapse').on('show.bs.collapse', function () {
$(this).siblings('.panel-heading').addClass('active');
});
$('.panel-collapse').on('hide.bs.collapse', function () {
$(this).siblings('.panel-heading').removeClass('active');
});
@renanlara
renanlara / plugins.md
Last active June 15, 2017 15:57
All the plugins I use - Of A to Z

Plugins

  • ACF Pro
  • Contact Form 7
  • Custom Post Type UI
  • Google Analytics Dashboar for WP
  • Nested Pages
  • Snazzy Maps
  • Yoast SEO
  • WP Smushit
  • WP Super Cache
@renanlara
renanlara / .gitignore
Last active June 8, 2017 14:41
Example .gitignore of WordPress with Odin Framework
# Global
._*
*.log
.AppleDouble
.DS_Store
.localized
.LSOverride
.Spotlight-V100
.Trashes
Icon
@renanlara
renanlara / close-on-click-out.js
Created April 28, 2016 12:57
Depois eu explico.
$(document).ready(function(){
// Event Click in whatever tag HTML
$( '#section' ).click(function(event){
event.stopPropagation();
$( '.button' ).toggleClass('open');
});
// Function click out and close function up
$( document ).click( function() {
var btn = $( '.button' );
@renanlara
renanlara / page.php
Last active February 19, 2016 14:32
Especifique qual arquivo usar para páginas filhas.
<?php
/**
* Espeficicar por padrão.
*/
if( $post->post_parent !== 0 ) {
get_template_part('page', 'child');
} else {
get_template_part('page', 'default');
}
?>
@renanlara
renanlara / navbar.scss
Created January 21, 2016 16:45
Show in hover navbar dropdown-menu bootstrap
.dropdown {
&:hover {
.dropdown-menu{
display: initial;
visibility: visible;
opacity: 1;
@include transition(0.1s ease-in-out);
}
}
}
@renanlara
renanlara / contact-form7.scss
Last active December 22, 2022 10:43
Checkbox and Radio Button Custom - Contact Form 7
.wpcf7-checkbox, .radio {
display: block;
margin: 10px 0 0;
.wpcf7-list-item {
display: block;
input[type=checkbox], input[type=radio] {
display: none;
@renanlara
renanlara / contact-form7.css
Last active February 29, 2016 17:25
Contact Form 7 - Customizar mensagens de erros
body input[type=text].wpcf7-not-valid,
body input[type=email].wpcf7-not-valid,
body input[type=tel].wpcf7-not-valid,
body textarea.wpcf7-not-valid {
border: 1px solid #ec3c06;
}
body span.wpcf7-not-valid-tip {
background: none;
border: none;
@renanlara
renanlara / functions.php
Last active November 19, 2015 18:25
Agendamento de Popup no Plugin Popup Maker
<?php
// Popup Maker - https://wordpress.org/plugins/popup-maker/
function mycustom_popup_is_loadable( $is_loadable, $popup_id) {
if( $popup_id == 80 ) { // ID do Post
$start = strtotime( '2015-11-23 14:00:00' ); // Data de Início
$end = strtotime( '2015-11-26 23:59:00' ); // Data do Término
$now = strtotime( 'now' );
if( $now >= $start && $now <= $end ) {
@renanlara
renanlara / Deploy com Git
Created October 30, 2015 19:00 — forked from alanyoshida/Deploy com Git
Fazendo Deploy de um projeto direto para o servidor via ssh usando o git.
# Primeiro crie um repositorio Local.
$ git init
Initialized empty Git repository in C:\Projetos\site\.git
$ cat ' ' > index.html
$ git add index.html
$ git commit -q -m "Iniciando o repositório"
# No Servidor
# Crie Repositorio Vazio
$ mkdir site.git && cd site.git