Skip to content

Instantly share code, notes, and snippets.

View walterjaworski's full-sized avatar
🏠
Working from home

Walter Jaworski walterjaworski

🏠
Working from home
View GitHub Profile
@MrDys
MrDys / gist:3512455
Created August 29, 2012 13:26
Link directly to an open modal window in Bootstrap
/* If you've ever had the need to link directly to an open modal window with Bootstrap, here's a quick and easy way to do it:
Make sure your modal has an id:
<div class="modal" id="myModal" ... >
Then stick this bit of Javascript at at the end of your document:
*/
$(document).ready(function() {
@ramseyp
ramseyp / hide-editor.php
Created November 12, 2012 15:48
Hide the content editor for certain pages in WordPress
<?php
/**
* Hide editor on specific pages.
*
*/
add_action( 'admin_init', 'hide_editor' );
function hide_editor() {
// Get the Post ID.
@fdaciuk
fdaciuk / functions.php
Created May 4, 2013 14:33
Adicionar jQuery UI do WordPress para usar no tema.
<?php
function enqueue_scripts() {
wp_enqueue_script( 'jquery-ui-core' );
}
add_action( 'wp_enqueue_scripts', 'enqueue_scripts' );
@fdaciuk
fdaciuk / functions.php
Created May 4, 2013 22:46
Funções para minimizar o caminho das pedras no WP :P (Na real, só pra não ficar chamando as funções gigantes do WP pra pegar o caminho dos arquivos)
<?php
/*
Use para chamar qualquer arquivo dentro do tema.
Ex: echo theme_url( 'assets/images/logo.png' );
*/
function theme_url( $path = null ) {
return get_template_directory_uri() . '/' . $path;
}
@leocomelli
leocomelli / git.md
Last active June 27, 2024 20:12
Lista de comandos úteis do GIT

GIT

Estados

  • Modificado (modified);
  • Preparado (staged/index)
  • Consolidado (comitted);

Ajuda

@gugaalves
gugaalves / functions.php
Created July 17, 2014 23:30
Vendo qual arquivo do tema está rodando!
add_action('admin_bar_menu', 'show_template');
function show_template() {
global $template;
print_r($template);
}
<?php
$args = array(
'post_type' => "eventos",
'posts_per_page' => -1,
'meta_key' => 'data',
'orderby' => 'data',
'order' => 'ASC'
);
setlocale( LC_ALL, 'pt_BR', 'pt_BR.iso-8859-1', 'pt_BR.utf-8', 'portuguese' );
date_default_timezone_set( 'America/Sao_Paulo' );
@theRemix
theRemix / README.md
Last active February 28, 2023 14:37
The Holy Grail - Gulp + Sass + LiveReload + Foundation

Gulp + Sass + LiveReload + Foundation

Goals

To have a gulp workflow that with a single process,

  1. watches for any sass changes, then compiles sass source into css
  2. watches for any changes in the public directory, triggers live-reload
  3. serves your static content in public/
@leobaiano
leobaiano / filter_search_WordPress_per_taxonomy.php
Created July 22, 2015 04:34
Filotro de busca WordPress com taxonomys
<?php
function filter_search( $query ) {
if ( !is_admin() && $query->is_main_query() && $query->is_search ) {
$tax_query = array(
array(
'taxonomy' => 'frutas',
'field' => 'slug',
'terms' => 'laranja'
),
array(
@ditikos
ditikos / functions.php
Created July 22, 2015 11:52
Wordpress admin add Google Maps Metabox
<?php
// ... include at the end of functions.php
// 1. Add google maps -- REQUIRED GOOGLE MAPS API KEY
function wp_google_scripts() {
$API_KEY = "AIzaSyAj1hqhXwaUnJDZzisebduqKg2QFsCYCS4";
wp_enqueue_script( 'google-maps-native', "http://maps.googleapis.com/maps/api/js?key=".$API_KEY);
}
add_action( 'admin_enqueue_scripts', 'wp_google_scripts' );