Skip to content

Instantly share code, notes, and snippets.

View groupewibi's full-sized avatar

Wibi groupewibi

  • Groupe Wibi
  • France
View GitHub Profile
@vivek-kumar-poddar
vivek-kumar-poddar / functions.php
Created August 23, 2017 17:15
This is an updated version of social media buttons. This code snippet will help you to add social media buttons to your website without even using any plugin. Furthermore it's javascript free. Enjoy fast speed and the same usability. For more details visit the official post: https://wpvkp.com/add-social-media-sharing-buttons-to-wordpress-without…
// 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
@PauliusKrutkis
PauliusKrutkis / set-image.php
Created July 6, 2017 13:35
Wordpress set post thumbnail with media_sideload_image function
<?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;
@yratof
yratof / functions.php
Created March 10, 2015 14:37
ACF OEmbed with thumbnails
<?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
@JiveDig
JiveDig / acf_front_end_edit.php
Last active September 14, 2023 16:19
ACF front end post editing
<?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
*/
@luetkemj
luetkemj / wp-query-ref.php
Last active May 25, 2024 10:56
WP: Query $args
// 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
*/