Skip to content

Instantly share code, notes, and snippets.

@doitonlinemedia
doitonlinemedia / Gravityforms background-color all field e-mail template.php
Created April 11, 2019 07:12
Gravityforms background-color all field e-mail template
/**
* Gravityforms background-color all field
*/
add_filter("gform_email_background_color_label", "set_email_label_color", 10, 3);
function set_email_label_color($color, $field, $lead){
return "#eeeeee";
}
add_filter("gform_email_background_color_data", "set_email_data_color", 10, 3);
function set_email_data_color($color, $field, $lead){
@doitonlinemedia
doitonlinemedia / change_search_url.php
Created March 29, 2019 08:24
change search base url
function change_search_url() {
$GLOBALS['wp_rewrite']->search_base = 'zoeken';
}
add_action( 'init', 'change_search_url' );
@doitonlinemedia
doitonlinemedia / get wordpress categorie taxonomy acf advanced custom field.php
Created March 25, 2019 18:13
Get wordpress categorie taxonomy acf advanced custom field
$image = get_field('banner_image', $term->taxonomy . '_' . $term->term_id);
@doitonlinemedia
doitonlinemedia / get_queried_object().php
Created March 21, 2019 10:44
get_queried_object().php
get_queried_object()
@doitonlinemedia
doitonlinemedia / Ie fix sage roots custom event polyfill.txt
Created March 14, 2019 14:48
Ie fix sage roots custom event polyfill
https://www.npmjs.com/package/custom-event-polyfill
@doitonlinemedia
doitonlinemedia / get_post_type_archive_link.php
Created March 13, 2019 18:56
get_post_type_archive_link
<a href="{{ get_post_type_archive_link('diensten') }}" class="btn btn-primary btn-back" title="{{ __('Terug naar overzicht', 'sage') }}"><i class="fas fa-angle-left"></i> {{ __('Terug naar overzicht', 'sage') }}</a>
@doitonlinemedia
doitonlinemedia / Redirect CTP single to CPT archive, Add noindex, nofollow to CPT single.php
Created February 21, 2019 08:47
Redirect CTP single to CPT archive, Add noindex, nofollow to CPT single.
/**
* Redirect CTP single to CPT archive.
*/
function dom_single_redirect_post() {
$queried_post_type = get_query_var('post_type');
if (
is_single() && 'team' == $queried_post_type ||
is_single() && 'kranten' == $queried_post_type ||
is_single() && 'klanten' == $queried_post_type ||
is_single() && 'geschiedenis' == $queried_post_type
@doitonlinemedia
doitonlinemedia / Small tinymce wusiwyg.php
Created February 19, 2019 12:22
Small tinymce wusiwyg.php
/**
* Small tinymce
*/
function dom_small_tinymce() {
echo '<style>
.small .acf-editor-wrap iframe {
height: 150px !important;
min-height: 150px;
}
</style>';
@doitonlinemedia
doitonlinemedia / Adjust query by menu order.php
Created February 19, 2019 11:31
Adjust query by menu order.php
/**
* Adjust gebouwen querie
*/
function gebouwen_adjust_queries($query) {
if (!is_admin() && is_post_type_archive('gebouwen') && $query->is_main_query()) {
$query->set('orderby', 'menu_order');
$query->set('order', 'ASC');
}
}
add_action('pre_get_posts', 'gebouwen_adjust_queries');
@doitonlinemedia
doitonlinemedia / Remove editor from front-page.php
Created February 19, 2019 10:00
Remove editor from front-page.php
/**
* Remove editor from front-page
*/
function dom_remove_support_front_end(){
if((int) get_option('page_on_front')==get_the_ID()) {
remove_post_type_support('page', 'editor');
}
}
add_action('admin_head', 'dom_remove_support_front_end',100);