Skip to content

Instantly share code, notes, and snippets.

@doitonlinemedia
doitonlinemedia / WordPress custom crop.php
Created January 18, 2019 16:39
WordPress custom crop.php
function domCustomCropBtn() {
?>
<script>
jQuery(document).ready(function($) {
//add a button right beside the add media button - adjust if you want the button somewhere else
let counter = 0;
$('.acf-field').each(function(){
@doitonlinemedia
doitonlinemedia / Stylelint disable, css disable.scss
Created February 8, 2019 13:43
Stylelint disable, css disable
/* stylelint-disable */
a {}
/* stylelint-enable */
@doitonlinemedia
doitonlinemedia / Wordpress add only height or with size, soft crop.php
Last active February 21, 2019 10:16
Wordpress add only height or with size, soft crop.
add_image_size('gebouw_galerij', 9999, 500, false);
@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);
@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 / 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 / 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 / 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 / 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_queried_object().php
Created March 21, 2019 10:44
get_queried_object().php
get_queried_object()