Skip to content

Instantly share code, notes, and snippets.

View Tabrisrp's full-sized avatar

Rémy Perona Tabrisrp

View GitHub Profile
<?php
if ( have_rows( 'repeater_field', $order_id ) ) :
while ( have_rows( 'repeater_field', $order_id ) ) : the_row();
$type = get_sub_field( 'type', $order_id );
if( $type === 'tekst' ): ?>
<div id="customerMessageTxt">
<?php the_sub_field($type, $order_id); ?>
</div>
@Tabrisrp
Tabrisrp / gist:85628f1e90880c04f3fb
Last active August 29, 2015 14:05
Get a taxonomy's terms in posts with another taxonomy's term
<?php
$base_taxonomy = 'pays';
$term_id = '1';
$required_taxonomy = 'villes';
$required_terms = array();
$required_terms_id = array();
$objects_in_tax = get_objects_in_term( $term_id, $taxonomy );
@Tabrisrp
Tabrisrp / google-sitelinks-search-box-json-ld
Last active August 29, 2015 14:06
Add JSON+LD markup for Google sitelinks search box
@Tabrisrp
Tabrisrp / microdata-markup-google-sitelink-searchbox
Last active July 22, 2018 00:30
ADD microdata markup for Google sitelinks search box in WP search form
@Tabrisrp
Tabrisrp / gist:13348dbcd2bbb0d9406f
Created April 14, 2015 14:32
WordPress customizer custom tinymce control
class Text_Editor_Custom_Control extends WP_Customize_Control
{
public $type = 'textarea';
/**
** Render the content on the theme customizer page
*/
public function render_content() { ?>
<label>
<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
<?php
@Tabrisrp
Tabrisrp / gist:8fd06872d1b9f0971296
Created April 14, 2015 14:48
WordPress customizer custom tinymce control javascript
( function( $ ) {
wp.customizerCtrlEditor = {
init: function() {
$(window).load(function(){
$('textarea.wp-editor-area').each(function(){
var tArea = $(this),
id = tArea.attr('id'),
@Tabrisrp
Tabrisrp / gist:d81457723533c5ebcbce
Created April 14, 2015 14:52
WordPress customizer_register TinyMCE control
function register_theme_customizer() {
$wp_customize->add_section( 'editor', array(
'title' => 'Editeur',
'description' => 'Editeur TinyMCE',
'priority' => 300
) );
$wp_customize->add_setting( 'theme[editor_content]', array(
'default' => '',
'transport' => 'postMessage',
@Tabrisrp
Tabrisrp / gist:e15d189bcf7cf444b413
Last active August 29, 2015 14:22
geo-mashup-custom
GeoMashup.addAction( 'loadedMap', function( properties, map ) {
var gmap = map.getMap();
var styles = [
{
"featureType": "water",
"elementType": "geometry.fill",
"stylers": [
{ "color": "#8eade4" }
]
},{
/* Maps fill the frame, makes percentage height maps a bit easier */
html, body { height: 100%; overflow: hidden; margin: 0; }
/* Info window */
.locationinfo { overflow:auto; width:600px; height:300px; }
.user-location-info { overflow:auto; width:150px; height:80px; }
.comment-location-info { overflow:auto; width:200px; height:140px; }
.info-window-max { overflow:auto; }
@Tabrisrp
Tabrisrp / gist:b6e01263e1bbcdcca7f2
Created June 3, 2015 11:35
geo-mashup-info-window.php
<?php
// A potentially heavy-handed way to remove shortcode-like content
add_filter( 'the_excerpt', array( 'GeoMashupQuery', 'strip_brackets' ) );
?>
<div class="locationinfo post-location-info">
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<section class="line entry-content">