Skip to content

Instantly share code, notes, and snippets.

@mkwebworker
mkwebworker / disable_elementor_widgets.php
Created September 12, 2019 14:36
disable elementor widgets for editors
/*
* disable elementor widgets for editors
*/
add_filter( 'elementor/editor/localize_settings', function( $settings ) {
$elementor_widget_blacklist = [
'common',
'heading',
'image',
'text-editor',
'video',
@mkwebworker
mkwebworker / fix-build-error.txt
Created March 8, 2019 08:29
[fix build error] #pw-starterkit
1. copy .vscode to / and config
2. copy config/ant
3. copy build.xml
4. cd htdocs/site/templates
5. npm install natives
6. npm install
(if this doesn't work: npm install natives in root)
<!--[if lt IE 9]>
<script>
document.createElement('header');
document.createElement('nav');
document.createElement('section');
document.createElement('article');
document.createElement('aside');
document.createElement('footer');
document.createElement('hgroup');
</script>
////// FIX CHROME BG FLICKERING BUG ////////////
if(navigator.userAgent.toLowerCase().indexOf('chrome') > -1) {
// set background-attachment back to the default of 'scroll'
jQuery('.parallax-1').css('background-attachment', 'scroll');
// move the background-position according to the div's y position
jQuery(window).scroll(function(){
scrollTop = jQuery(window).scrollTop();
photoTop = jQuery('.parallax-1').offset().top;
/* ********************** */
/* ** IE 10 Detection *** */
/* ********************** */
var doc = document.documentElement;
doc.setAttribute('data-useragent', navigator.userAgent);
// example: html[data-useragent*='MSIE 10.0'] .site-content { background: #f00 }
@mkwebworker
mkwebworker / css-resets.css
Last active October 26, 2016 09:22
CSS Resets
a,abbr,acronym,address,applet,big,blockquote,body,caption,cite,code,dd,del,dfn,div,dl,dt,em,fieldset,font,form,h1,h2,h3,h4,h5,h6,html,iframe,ins,kbd,label,legend,li,object,ol,p,pre,q,s,samp,small,span,strike,strong,sub,sup,table,tbody,td,tfoot,th,thead,tr,tt,ul,var{border:0;font-family:inherit;font-size:100%;font-style:inherit;font-weight:inherit;margin:0;outline:0;padding:0;vertical-align:baseline}html{font-size:62.5%;overflow-y:scroll;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{background:#fff}article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}ol,ul{list-style:none}table{border-collapse:separate;border-spacing:0}caption,td,th{font-weight:400;text-align:left}blockquote:after,blockquote:before,q:after,q:before{content:""}blockquote,q{quotes:"" ""}a:focus{outline:dotted thin}a:active,a:hover{outline:0}a img{border:0}
@mkwebworker
mkwebworker / count_categorie_items.php
Created October 16, 2013 12:38
count items of a category
/**
* count_categorie_items :: count all items of a category :: returns false or the number of items
* @param string $category_slug :: slug of the category
* @param bool return :: return or echo
**/
function count_categorie_items( $category_slug, $return = false){
if( ! empty ($category_slug) ):
///// get category id & count their items /////
$cat = get_category_by_slug($category_slug);
@mkwebworker
mkwebworker / the_slideshow.php
Created October 16, 2013 08:31
basic function for slideshow - actually not ready
if( ! function_exists ( 'the_slideshow' )):
/*
* the_slideshow() - get slides from cpt 'slide' and echo or return them
@param array $args - contains serval options
*/
function the_slideshow( $args ) {
///// get arguments /////
// default arguments
@mkwebworker
mkwebworker / add_post_thumb_column.php
Created October 10, 2013 11:28
Add a custom column with post thumbnail to the post overview
/* Add the post thumbnail to admin panel - marcokuemmel.de*/
function my_custom_column_content($column)
{
if ($column == 'featuredimage')
{
global $post;
echo (has_post_thumbnail($post->ID)) ? the_post_thumbnail(array(80,80)) : '<p>kein Bild festgelegt</p>' ;
}
}
// for cpt use manage_{$post_type}_posts_custom_column
@mkwebworker
mkwebworker / bx-slider-scripts
Created October 4, 2013 11:53
enque bxslider scripts
// bxslider
wp_enqueue_script( 'bxslider-js', get_template_directory_uri() . '/js/bxslider/jquery.bxslider.min.js', array( 'jquery' ) );
wp_enqueue_style( 'bxslider', get_template_directory_uri().'/js/bxslider/jquery.bxslider.css' );