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 / simple-social-sharing.php
Last active August 29, 2015 14:07
Simple social sharing for WP posts. Requires the post_thumbnail_url() function (a different gist) and https://github.com/cferdinandi/social-sharing#readme
<?php
if ( has_post_thumbnail() ):
$socialimg = post_thumbnail_url($post->ID, $size = 'large');
else:
$socialimg = '';
endif;
?>
<ul class="social-links">
<li><a target="_blank" href="https://facebook.com/sharer.php?u=<?php echo esc_url( get_permalink() ); ?>"><span aria-hidden="true" class="icon-facebook"></span></a></li>
$xs: ( max: 767px );
$sm: ( min: 768px );
$md: ( min: 992px );
$lg: ( min: 1200px );
$sm-only: ( min: map-get($sm, min), max: map-get($md, min) - 1 );
$md-only: ( min: map-get($md, min), max: map-get($lg, min) - 1 );
@mixin breakpoint($map) {
$query: "";
@if map-has-key($map, min) { $query: append($query, "(min-width: #{map-get($map, min)})") }
@FutureMedia
FutureMedia / admin_remove_metaboxes.php
Created October 20, 2014 15:32
Remove the metaboxes from post and pages edit screens
// REMOVE POST META BOXES
function remove_metaboxes() {
/* Posts */
remove_meta_box( 'authordiv','post','normal' ); // Author Metabox
remove_meta_box( 'commentstatusdiv','post','normal' ); // Comments Status Metabox
remove_meta_box( 'commentsdiv','post','normal' ); // Comments Metabox
remove_meta_box( 'postcustom','post','normal' ); // Custom Fields Metabox
@FutureMedia
FutureMedia / wpconfig-defs.php
Created October 27, 2014 12:16
Useful maintenance settings in wpconfig.php
define( 'WP_POST_REVISIONS', 2 ); // set false for none
define( 'AUTOSAVE_INTERVAL', 160 ); // Seconds, default 60
define( 'EMPTY_TRASH_DAYS', 5 ); // 5 days
define( 'WP_ALLOW_REPAIR', true ); // and then use http://www.yourwebsite.com/wp-admin/maint/repair.php
@FutureMedia
FutureMedia / audio.js
Created November 3, 2014 16:59
HTML5 Audio functions from http://www.kalliogladiators.fi/
var Audio = function()
{
var audioVolume = 0;
var audioLibrary = new Array();
//audioLibrary['music'] = {"src": "audio/whativebecome.mp3", "defaultVolume": 1, "loop": true};
audioLibrary['music'] = {"src": "audio/theway.mp3", "defaultVolume": 1, "loop": true};
var init = function()
{
@FutureMedia
FutureMedia / infinite-scroll-masonry-imagesloaded.php
Last active August 29, 2015 14:10 — forked from gregrickaby/infinite-scroll-masonry-imagesloaded.php
Portfoglio List with Mansory, Infinite Scroll & Images Loaded
/**
* Be sure to include library scripts in this order. Can be placed either
* in the header or footer.
*/
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-infinitescroll/2.0b2.120519/jquery.infinitescroll.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/masonry/3.1.2/masonry.pkgd.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery.imagesloaded/3.0.4/jquery.imagesloaded.min.js"></script>
@FutureMedia
FutureMedia / Elastic-stroke-CSS-+-SVG.markdown
Last active August 29, 2015 14:11
Elastic stroke CSS + SVG
@FutureMedia
FutureMedia / about.md
Last active October 3, 2015 09:37 — forked from luetkemj/wp-query-ref.php
All possible WP query attributes

All available WP query attributes

WordPress Query Comprehensive Reference Compiled by luetkemj - luetkemj.com

CODEX

@FutureMedia
FutureMedia / index.php
Last active August 29, 2015 14:15 — forked from certainlyakey/index.php
An extended Search for WP
<?php $posttype = 'registry';
$posttype_obj = get_post_type_object($posttype);
$search_posttype_label = $posttype_obj->labels->search_items;
$term = $wp_query->queried_object;
// $term_based_on_posttype = get_object_taxonomies($posttype);
?>
<!-- change all ids in form to prevent conflict with default site search form -->
<form role="search" method="get" id="searchform_<?php echo $posttype; ?>" class="searchform" action="search-<?php echo $posttype; ?>.php">
<div>
<label class="screen-reader-text" for="s_<?php echo $posttype; ?>"><?php echo $search_posttype_label; ?></label>

WP - Ajax action

Ajaxifying Wordpress via a child theme