This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 ) ); ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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_'; | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function($){ | |
var breakpoint = 600; | |
var sf = $('ul.nav-menu'); | |
if($(document).width() >= breakpoint){ | |
sf.superfish({ | |
delay: 200, | |
speed: 'fast' | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@media #{$large-up} { | |
.valign-middle { | |
display: table; | |
.columns { | |
display: table-cell; | |
vertical-align: middle; | |
&.columns, | |
[class*="column"] + [class*="column"]:last-child { | |
float:none; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@media #{$large-up} { | |
.valign-middle { | |
display: table; | |
.columns { | |
display: table-cell; | |
vertical-align: middle; | |
&.columns, | |
[class*="column"] + [class*="column"]:last-child { | |
float:none; |
OlderNewer