Skip to content

Instantly share code, notes, and snippets.

View codigoconjuan's full-sized avatar

Juan Pablo De la torre Valdez codigoconjuan

View GitHub Profile
# WordPress_Code_Snippets
Useful Code Snippets for my Daily Workflow in WordPress
#Print all Custom Fields Data / Imprimir toda la información de un Custom Field
<?php printf( '<pre>%s</pre>', var_export( get_post_custom( get_the_ID() ), true ) ); ?>
add_action( 'cmb2_init', 'yourprefix_register_about_page_metabox' );
/**
* Hook in and add a metabox that only appears on the 'About' page
*/
function yourprefix_register_about_page_metabox() {
// Start with an underscore to hide fields from custom fields list
$prefix = '_yourprefix_about_';
/**
add_action( 'cmb2_init', 'show_on_page_template' );
/**
* Hook in and add a metabox to demonstrate repeatable grouped fields
*/
function show_on_page_template() {
$cmb = new_cmb2_box( array(
'id' => 'contact-information',
'title' => 'Contact Information',
function dinamarca_scripts() {
wp_enqueue_style( 'dinamarca-style', get_stylesheet_uri() );
wp_register_style('lightbox', get_template_directory_uri() . '/css/lightbox.css', array(), '1.0', 'all');
wp_enqueue_style('lightbox'); // Enqueue it!
wp_register_style('flexslider', get_template_directory_uri() . '/css/flexslider.css', array(), '1.0', 'all');
wp_enqueue_style('flexslider'); // Enqueue it!
wp_enqueue_script('jquery', get_template_directory_uri() . 'js/jquery-1.11.3.min.js');
wp_enqueue_script( 'dinamarca-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20120206', true );
wp_enqueue_script( 'dinamarca-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20130115', true );
wp_enqueue_script( 'slicknav', get_template_directory_uri() . '/js/jquery.slicknav.min.js', array('jquery'), '20130115', true );
<?php
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['messageField'];
$header = 'From: ' . $email . " \r\n";
$header .= "X-Mailer: PHP/" . phpversion() . " \r\n";
$header .= "Mime-Version: 1.0 \r\n";
$header .= "Content-Type: text/plain";
<section id="screenshots">
<h1 class="text-center">Screenshots</h1>
<div class="separator"></div>
<div class="container">
<div class="row">
<div class="col-xs-4">
<a href="#modal" data-toggle="modal" data-image-url="img/tickets.png">
<img src="img/tickets.png" class="img-responsive anima1">
</a>
jQuery(document).ready(function($){
var breakpoint = 600;
var sf = $('ul.nav-menu');
if($(document).width() >= breakpoint){
sf.superfish({
delay: 200,
speed: 'fast'
});
}
@codigoconjuan
codigoconjuan / index.html
Created August 26, 2015 15:47
Gist for Derek Lee
<section id="slider" class="carousel slide" data-ride="carousel">
<div class="carousel-inner">
<div class="item active">
<img src="img/slider_1.png">
</div>
<div class="item">
<img src="img/slider_1.png">
</div>
@codigoconjuan
codigoconjuan / custom.scss
Created August 29, 2015 18:10
Gist for Deborah Mott
@media #{$large-up} {
.valign-middle {
display: table;
.columns {
display: table-cell;
vertical-align: middle;
&.columns,
[class*="column"] + [class*="column"]:last-child {
float:none;
}
@codigoconjuan
codigoconjuan / custom.scss
Created August 29, 2015 18:11
Gist for Deborah Mott
@media #{$large-up} {
.valign-middle {
display: table;
.columns {
display: table-cell;
vertical-align: middle;
&.columns,
[class*="column"] + [class*="column"]:last-child {
float:none;