Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
<?php | |
/* | |
* This function will get the first image in this order: | |
* | |
* 1) Featured image | |
* 2) First image attached to post | |
* 3) First image URL in the content of the post | |
* 4) YouTube screenshot | |
* 5) Default images for different categories [SET MANUALLY] |
<?php | |
/** | |
* Template Name: ajax | |
*/ | |
?> | |
<?php | |
$post = get_post($_GET['id']); | |
?> | |
<?php if ($post) : ?> | |
<?php setup_postdata($post); ?> |
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
<?php | |
/* | |
A snippet of code to create static featured images for a WordPress post using | |
a YouTube or Vimeo video URL. I have used this code for several projects where | |
video posts or embedded videos needed to be static images in order to be more | |
mobile friendly as well as for improved page load times when used as a featured | |
image for the post. | |
I have added comments where it might be neccessary to modify the code or where | |
there is room for improvement. There are two primary functions to be used |
.gform_wrapper ul { | |
padding-left: 0; | |
list-style: none; } | |
.gform_wrapper li { | |
margin-bottom: 15px; } | |
.gform_wrapper form { | |
margin-bottom: 0; } |
<?php | |
/* | |
Template Name: Kontakt | |
*/ | |
?> | |
<?php /* other template code goes here... */ ?> | |
<?php |
( function( $, plugin ) { | |
"use strict"; | |
// Working with promises to bubble event later than core. | |
$.when( someObjectWithEvents ).done( function() { | |
console.log( 'AJAX request done.' ); | |
} ) | |
.then( function() { | |
setTimeout( function() { | |
console.log( 'AJAX requests resolved.' ); |
function parseVideo (url) { | |
// - Supported YouTube URL formats: | |
// - http://www.youtube.com/watch?v=My2FRPA3Gf8 | |
// - http://youtu.be/My2FRPA3Gf8 | |
// - https://youtube.googleapis.com/v/My2FRPA3Gf8 | |
// - Supported Vimeo URL formats: | |
// - http://vimeo.com/25451551 | |
// - http://player.vimeo.com/video/25451551 | |
// - Also supports relative URLs: | |
// - //player.vimeo.com/video/25451551 |