Skip to content

Instantly share code, notes, and snippets.

View daveloodts's full-sized avatar

Dave Loodts daveloodts

View GitHub Profile
<?php if( have_rows('verhuur_item') ): ?>
<?php while( have_rows('verhuur_item') ): the_row();
// vars
$hoofdfotoverhuuritemID = get_sub_field('hoofdafbeelding');
$titelverhuur = get_sub_field('naam_van_verhuur_item');
$contentverhuur = get_sub_field('tekst_verhuuritem');
$imagevh = wp_get_attachment_image_src( $hoofdfotoverhuuritemID, 'thumbnail' );
@daveloodts
daveloodts / gist:7145ded04ca86a9fd4e2e21e28a451c2
Created August 23, 2016 06:33
Display latest posts of active category (except active post) / user in sidebar
<?php
// get the custom post type's taxonomy terms
$custom_taxterms = wp_get_object_terms( $post->ID, 'faq_category', array('fields' => 'ids') );
// arguments
$args = array(
'post_type' => 'qa_faqs',
'post_status' => 'publish',
'posts_per_page' => 10, // you may edit this number
/* shortcode voor homeberichten */
add_shortcode( 'homeposts', 'list_homeposts' );
function list_homeposts( $atts ) {
ob_start();
wp_reset_postdata();
extract( shortcode_atts( array (
'type' => 'post',
'posts' => -1,
'category' => '',
// check if the repeater field has rows of data
if( have_rows('erkenningen') ):
// loop through the rows of data
while ( have_rows('erkenningen') ) : the_row(); ?>
<div class="ersegment row">
<div class="small-12 large-12 medium-6 columns">
<h3><?php the_sub_field('titel_erkenningen'); ?></h3>
<?php while ( have_rows('soorten_erkenning_categorie') ) : the_row(); ?>
<ul class='erkenninglist'>
<?php
$query_args = array( 'post_type' => 'post', 'paged' => $paged );
query_posts( $query_args );
?>
<h1>Nieuws</h1>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div id="post-<?php the_ID(); ?>" class="row archivenewsitem" role="article">
<div class="small-2 large-2 columns">
<a href="<?php the_permalink() ?>"><?php the_post_thumbnail(); ?></a>
<?php
setlocale (LC_ALL, 'nld_nld');
setlocale (LC_ALL, 'nl_NL');
?>
add_shortcode( 'kalenderlijst', 'list_kalender' );
function list_kalender( $atts ) {
ob_start();
wp_reset_postdata();
$today = date('Ymd');
extract( shortcode_atts( array (
'type' => 'kalender',
'posts' => 3,
'category' => '',
<?php if( have_rows('leden') ): ?>
<div class="bestuur col-md-6 col-sm-12 col-xs-12">
<?php while( have_rows('leden') ): the_row(); ?>
<div class="row lid">
<div class="col-lg-4 col-md-5 col-sm-3"><img class="proffot" src="<?php echo the_sub_field('foto'); ?>" /></div>
<div class="col-lg-8 col-md-7 col-sm-9">
<h4><?php echo the_sub_field('naam'); ?></h4>
<table>
<?php if( get_sub_field('functie') ): ?><tr><td class='str'>Functie</td><td><?php echo the_sub_field('functie'); ?></td></tr><?php endif; ?>
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
add_filter('xmlrpc_enabled', '__return_false');
@daveloodts
daveloodts / gist:fbf855b9945a16a7892c7191d942df8d
Created September 12, 2016 09:55
remove comments fields in wordpress
/* remove comments fields in wordpress */
function disable_comment_url($fields) {
unset($fields['url']);
return $fields;
}
add_filter('comment_form_default_fields','disable_comment_url');