Skip to content

Instantly share code, notes, and snippets.

View lenivene's full-sized avatar
🖖
Full-stack dev

Lenivene Bezerra lenivene

🖖
Full-stack dev
View GitHub Profile
@lenivene
lenivene / .gitconfig
Created November 15, 2019 19:02 — forked from diego3g/.gitconfig
[alias]
ci = commit
co = checkout
cm = checkout master
cb = checkout -b
st = status -sb
sf = show --name-only
lg = log --pretty=format:'%Cred%h%Creset %C(bold)%cr%Creset %Cgreen<%an>%Creset %s' --max-count=30
incoming = !(git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' ..@{u})
outgoing = !(git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' @{u}..)
@lenivene
lenivene / limit_number_posts_for_mobile.php
Last active May 13, 2016 09:54
Limite number of posts for mobile WordPress
<?php
add_action( 'pre_get_posts', 'change_limit_mobile' );
function change_limit_mobile( $query ){
$limit = 4;
if ( wp_is_mobile() && $query->is_main_query() ){
set_query_var( 'posts_per_page', $limit );
}
}
@lenivene
lenivene / insert-likes-custom-field.php
Last active February 8, 2016 14:22
Adiciona informações do facebook a campos personalizados WordPress
<?php
/**
* Author: Rhuan Carlos
*/
function insert_likes_custom_field( $post_ID ) {
global $wpdb;
if ( !wp_is_post_revision( $post_ID ) ){
add_post_meta( $post_ID, 'likes_count', '0', true );
}