Skip to content

Instantly share code, notes, and snippets.

<style>
body { margin: 0; }
.vimeo-container {
padding: 0;
width: 100%;
height: 100vh;
overflow: hidden;
position: relative;
}
iframe {
@codeway
codeway / gist:6115533
Created July 30, 2013 18:33
php : json sample
<?
$return = array(
'var1' => 4,
'error' => $error,
);
wp_send_json($return);
?>
<?php
/* Stop WordPress from adding those annoying paragraph tags */
remove_filter( 'the_content', 'wpautop' );
remove_filter( 'the_excerpt', 'wpautop' );
?>
@codeway
codeway / functions.php
Created July 30, 2013 18:08
Wordpress : functions.php : Shortcode form
add_shortcode( 'MY_SHORTCODE', 'my_shortcode' );
function my_shortcode( $attr ) {
$contents = '';
ob_start();
require_once('myfolder/show.php');
$contents = ob_get_contents();
ob_end_clean();
return '[raw]'.$contents.'[/raw]';
// Raw could be usefull to disable wordpress formatting (add <p>)
// Voir http://www.catswhocode.com/blog/10-incredibly-cool-wordpress-shortcodes => POINT 9