Skip to content

Instantly share code, notes, and snippets.

View frankriezebos's full-sized avatar

Frank frankriezebos

View GitHub Profile
@frankriezebos
frankriezebos / accordion.html
Last active March 17, 2022 16:00
Dynamic Bootstrap Accordion
<div class="accordion" id="faqAccordion">
<div class="accordion-item">
<h2 class="accordion-header">
<button class="accordion-button collapsed" data-bs-toggle="collapse" type="button" aria-expanded="false">
<?=$item['naam']?>
</button>
</h2>
<div class="accordion-collapse collapse">
<div class="accordion-body">
<?=$item['omschrijving']?>
@frankriezebos
frankriezebos / Reviews.vue
Created January 27, 2022 09:07
Limiet voor aantal items meegeven aan component
<!-- components/Reviews.vue -->
<div
class="col-12 col-lg-3"
v-for="(review, index) in reviews"
:key="index"
>
<div
class="card"
v-if="
@frankriezebos
frankriezebos / index.vue
Created January 26, 2022 16:02
LocalStorage aanmaken binnen een loop
<div
@click="setLocalStorage(item.name)"
v-for="(
item, itemIndex
) in items"
:key="itemIndex"
>
</div>
<script>
@frankriezebos
frankriezebos / component.Vue
Last active January 25, 2022 21:25
[localstorage gebruiken in Vue/Nuxt] #vue #nuxt #localstorage
<template>
<h2 class="pt-2 pl-2">Welkom<span v-if="Name"> {{Name}}</span>!</h2>
<div class="col-12 single-field">
<input type="text" v-model="changedName" @input="updateName" :placeholder="Name ? Name : 'Naam'" class="w-100" />
</div>
</template>
<script>
@frankriezebos
frankriezebos / page.php
Created February 5, 2021 10:44
[WP Taxonomy output incl. custom ACF fields] #wp #php #acf
<?php
$loop = new WP_Query( array(
'post_type' => 'locations',
'posts_per_page' => '-1'
) );
if ( $loop->have_posts() ) :
while ( $loop->have_posts() ) : $loop->the_post();
$terms = get_the_terms( $post->ID, 'locations_categories' );
$title = get_the_title($post->ID);
@frankriezebos
frankriezebos / timeout.js
Created November 22, 2020 22:29
[timeout] #jquery
setTimeout(function() {
$(this).val('Submit');
}, 2000); //2000ms = 2 seconds
@frankriezebos
frankriezebos / php.php
Created October 15, 2020 09:01
[WP template directory uri] #php
<?php echo get_template_directory_uri(); ?>
/*
<img src="<?php echo get_template_directory_uri(); ?>/dist/img/image.svg" />
*/
@frankriezebos
frankriezebos / hithere.php
Created August 31, 2020 09:21
[Truncate variable] #php
$short_description = mb_strimwidth($short_description, 0, 100, "..."); //100 characters max
@frankriezebos
frankriezebos / bleep
Created August 26, 2020 15:17
[Hard refresh IE11 in Browserstack] refresh + clear cache
Mac:
Command+Shift+F5
Windows:
CTRL+Shift+F5
@frankriezebos
frankriezebos / style.css
Created July 27, 2020 17:25
Flexbox items under each other instead of next to each other
display: flex;
flex-direction: column;