This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Function to handle the thumbnail request | |
function get_the_post_thumbnail_src($img) | |
{ | |
return (preg_match('~\bsrc="([^"]++)"~', $img, $matches)) ? $matches[1] : ''; | |
} | |
function wpvkp_social_buttons($content) { | |
global $post; | |
if(is_singular() || is_home()){ | |
// Get current page URL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once(ABSPATH . 'wp-admin/includes/media.php'); | |
require_once(ABSPATH . 'wp-admin/includes/file.php'); | |
require_once(ABSPATH . 'wp-admin/includes/image.php'); | |
$url = 'http://wordpress.org/about/images/logos/wordpress-logo-stacked-rgb.png'; | |
$title = "Anything you want"; | |
$postId = 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Pull apart OEmbed video link to get thumbnails out*/ | |
function get_video_thumbnail_uri( $video_uri ) { | |
$thumbnail_uri = ''; | |
// determine the type of video and the video id | |
$video = parse_video_uri( $video_uri ); | |
// get youtube thumbnail |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Check if user is logged in and is post author | |
* Setup functions for front end post editing | |
* @author Mike Hemberger | |
* @link http://thestizmedia.com/front-end-post-editing-with-acf-pro/ | |
* @uses Advanced Custom Fields Pro | |
* @uses Sidr | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref | |
<?php | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.github.io | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters | |
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php | |
*/ |