Skip to content

Instantly share code, notes, and snippets.

View FutureMedia's full-sized avatar
💭
I may be slow to respond.

Lefteris Theodossiadis FutureMedia

💭
I may be slow to respond.
View GitHub Profile
@FutureMedia
FutureMedia / wordpress-hide-toolbar-in-post-editor.php
Last active May 10, 2017 09:36 — forked from mbijon/wordpress-remove-media_buttons.php
Remove 'Add Media' (and toolbar) button from above WP editor, per post-type.
// Removes the Post Editor Toolbar
// found here http://stackoverflow.com/questions/36865699/wordpress-how-to-hide-toolbar-in-post-editor
if( get_post_type() == 'product' && is_admin() ) {
add_filter( 'admin_footer', 'custom_edit_page_js', 99);
}
function custom_edit_page_js(){
echo '<style type="text/css"> a#content-tmce, a#content-tmce:hover, #qt_content_fullscreen{ display:none; } </style>';
echo '<script type="text/javascript"> jQuery(document).ready(function(){ jQuery("#content-tmce").attr("onclick", null); }); </script>';
@FutureMedia
FutureMedia / wp-get_id_by_slug.php
Last active May 6, 2017 10:41 — forked from lcdsantos/wp-get_id_by_slug
WordPress: Get page ID from slug WPML: Hard-coding Link
<?php
// Usage:
// get_id_by_slug('page-slug');
function get_id_by_slug($page_slug) {
$page = get_page_by_path($page_slug);
if ($page) {
return $page->ID;
} else {
return null;
@FutureMedia
FutureMedia / get-isotope-items.php
Created December 8, 2016 09:56 — forked from mohandere/get-isotope-items.php
jQuery isotope plugin for wordpress posts filtering by category with pagination.
<?php
function get_isotope_item( $query_args = array() ){
$defaults = array(
'post_type' => 'post',
'posts_per_page' => -1,
'post_status' => 'publish',
);
@FutureMedia
FutureMedia / blurred-background.txt
Last active June 8, 2016 08:31
CSS blurred background
opacity: .2;
filter: alpha(opacity=20);
filter: blur(4px);
-webkit-filter: blur(4px);
-moz-filter: blur(4px);
-o-filter: blur(4px);
-ms-filter: blur(4px);
filter: progid: DXImageTransform.Microsoft.blur(pixelradius=3)
Also (better) using backdrop-filter (https://developer.mozilla.org/en-US/docs/Web/CSS/backdrop-filter):
@FutureMedia
FutureMedia / functions.php
Created June 1, 2016 08:54 — forked from drewbaker/functions.php
Blurring image using WordPress
/**
* Several functions relatting to blurring images on uploaded.
* @see https://codeable.io/community/how-to-watermark-wordpress-images-with-imagemagick/
*/
add_image_size( 'background-image-blurred', 1920, 1080, true );
function generate_blurred_image( $meta ) {
$time = substr( $meta['file'], 0, 7); // Extract the date in form "2015/04"
$upload_dir = wp_upload_dir( $time ); // Get the "proper" upload dir
/*
* Load More for Masonry modification
*
* Full post:
* http://www.billerickson.net/infinite-scroll-in-wordpress/
*
*/
jQuery(function($){
@FutureMedia
FutureMedia / acf-gallery-remove-front-end-dependency.php
Created February 29, 2016 19:16
Remove Front-End Dependency for ACF Gallery Field Example (displays images with src, alt, width/height and caption)
@FutureMedia
FutureMedia / credit-card.md
Created November 10, 2015 18:31 — forked from claudiosanches/credit-card.md
Credit Card - Snippets

Credit Card

Credit Card numbers for test

Credit card type EBANX payment type code Credit card numbers
American Express amex 378282246310005 or 371449635398431
Aura aura 5078601870000127985 or 5078601800003247449
Diners Club diners 30569309025904 or 38520000023237
Discover discover 6011111111111117
@FutureMedia
FutureMedia / Add to cart interaction.markdown
Created October 3, 2015 17:26
Add to cart interaction