Skip to content

Instantly share code, notes, and snippets.

View mrkkr's full-sized avatar

Marek mrkkr

  • Poland
View GitHub Profile
@mrkkr
mrkkr / featured_image_background_image.php
Created January 10, 2018 11:30
Featured Image w background image #php #css
@mrkkr
mrkkr / smooth_scrolling_when_click_anchor_lin_id.js
Created January 18, 2018 11:58
Smooth scrolling po kliknięciu w menu z ID #js
$('a[href*=\\#]').on('click', function(e){
e.preventDefault();
$('html, body').animate({
scrollTop : $(this.hash).offset().top
}, 500);
});
@mrkkr
mrkkr / manually_trim_word_count_post_excerpt.php
Created January 29, 2018 15:05
Ręcznie ustalenie dlugości znaków 'excerpt' postu #php
function custom_excerpt_length( $length ) {
return 30; // limit znakóœ
}
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
@mrkkr
mrkkr / placeholder_stylling_css.css
Created January 30, 2018 10:34
Placeholder styling CSS #css
::-webkit-input-placeholder { /* WebKit browsers */
color: #F4F4F4 !important;
}
:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
color: #F4F4F4 !important;
}
::-moz-placeholder { /* Mozilla Firefox 19+ */
color: #F4F4F4 !important;
}
:-ms-input-placeholder { /* Internet Explorer 10+ */
@mrkkr
mrkkr / gzip_deflate_fonts.txt
Created February 5, 2018 15:06
gzip deflate fonts #htacess
<IfModule mod_deflate.c>
<IfModule mod_headers.c>
Header append Vary User-Agent env=!dont-vary
</IfModule>
AddType x-font/otf .otf
AddType x-font/ttf .ttf
AddType x-font/eot .eot
AddType x-font/woff .woff
@mrkkr
mrkkr / fixed_element_after_scrolling.js
Last active February 22, 2018 09:24
Wybrany element staje sie fixed po scrollowaniu do tego elementu #js #css
var fixmeTop = $('.element-fixed');
if (fixmeTop.length) {
var fixmeTopLength = fixmeTop.offset().top; // get initial position of the element
}
$(window).scroll(function() { // assign scroll event listener
var currentScroll = $(window).scrollTop(); // get current position
if (currentScroll >= fixmeTopLength) { // apply position: fixed if you
$('.element-fixed').css({ // scroll to that element or below it
'position': 'fixed',
'top': '137px',
@mrkkr
mrkkr / Add google reCaptcha to Wordpress site without plugin
Created February 26, 2018 13:07
Add google reCaptcha to Wordpress site without plugin
https://codeforgeek.com/2014/12/add-google-recaptcha-wordpress/
@mrkkr
mrkkr / Summernote Upload Images on Client Side.js
Last active April 11, 2018 10:07
Summernote Save Upload Images on Server #php #js
$('#textarea').summernote({
height: 250, //set editable area's height
callbacks: { // it must be like this in new version
onImageUpload: function(files, editor, $editable) {
sendFile(files[0],editor,$editable);
}
}
});
function sendFile(file,editor,welEditable) {
@mrkkr
mrkkr / How to Display Cookie Notice on WordPress Without any Plugins
Created February 27, 2018 13:20
How to Display Cookie Notice on WordPress Without any Plugins
@mrkkr
mrkkr / Display Wordpress post category in one line without loop.php
Created March 1, 2018 14:24
Display Wordpress post category in one line without loop #php
<?php echo get_the_category( $post->ID )[0]->name; ?>