Skip to content

Instantly share code, notes, and snippets.

@vc27
vc27 / create-posts
Created June 13, 2012 17:10
Create posts by from an array of data
<?php
/**
* File Name: create-posts.php
* @package WordPress
* @subpackage ParentTheme_VC
* @license GPL v2 - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* @version 0.3
* @updated: 06.28.12
*
* Description:
@vc27
vc27 / vc_get_post_id_by_meta__key_value
Created July 30, 2012 19:35
Get post_id from meta_key => meta_value
/**
* Get post_id from meta_key => meta_value
*
* @version 0.1
* @updated 07.30.12
*
**/
function vc_get_post_id_by_meta__key_value( $meta_key, $meta_value, $limit = 1 ) {
global $wpdb;
@vc27
vc27 / is-user
Created August 1, 2012 21:13
WordPress is user by user-login
/**
* Is User
*
* @version 0.1
* @updated 08.01.12
*
**/
function is__user( $user_login = false ) {
global $userdata;
@vc27
vc27 / get-post_id-from-slug
Created September 10, 2012 18:19
Get post_id from slug
/**
* Get post_id from slug
*
* @version 0.1
* @updated 09.10.12
*
**/
function get_post_id_by_slug( $slug ) {
global $wpdb;
@vc27
vc27 / YoastSEOWPEdits
Last active June 19, 2019 09:15
Get rid of some annoying part of Yoast SEO for WordPress.
<?php
/**
* File Name: WPSEOEdits.php
* @package WordPress
* @subpackage ParentTheme_VC
* @license GPL v2 - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* @version: 0.1
* @updated: 10.07.12
**/
#################################################################################################### */
@vc27
vc27 / adding-fonts-to-wordpress.php
Last active December 11, 2015 10:18
Adding Fonts to WordPress
/**
* @package WordPress
* @license GPL v2 - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* @version 1.0
* @updated 01.21.13
*
* Description:
* Adding fonts to wordpress is best done in a two step process. 1. Register your fonts with the
* wp-system via wp_register_style. 2. Enqueue your fonts with wp_enqueue_style.
*
@vc27
vc27 / foxycart-constant-contact-send-headers
Last active December 12, 2015 00:39
This is a json object of the received headers when script returns "foxy" after a successful exchange between our server script receiving the foxy datafeed and send the data to constant contact.
"CONTENT_LENGTH":"18815",
"CONTENT_TYPE":"multipart/form-data; boundary=----------------------------290c419c8ef0",
"DOCUMENT_ROOT":"/home/livshin/public_html",
"GATEWAY_INTERFACE":"CGI/1.1",
"HTTP_ACCEPT":"*/*",
"HTTP_EXPECT":"100-continue",
"HTTP_HOST":"ishinelive.com",
"HTTP_USER_AGENT":"FoxyCart Webhook v0.7.2 (http://wiki.foxycart.com/v/0.7.2/webhooks)",
"PATH":"/bin:/usr/bin",
"QUERY_STRING":"",
@vc27
vc27 / AppendPostData.md
Last active December 15, 2015 01:39
The purpose of this class is to append custom field values to the post object. Using this method will lessen the amount of code needed with in "the loop". Rather than writing code with "the loop" you may utilize this class and it's filter to append items to the post object for usage like the following.

AppendPostData

https://github.com/vc27/AppendPostData/

Info

The purpose of this class is to append custom field values to the post object. Using this method will lessen the amount of code needed with in "the loop". Rather than writing code with "the loop" you may utilize this class and it's filter to append items to the post object for usage like the following.

Helper Function

@vc27
vc27 / two-column-table.html
Created January 31, 2014 00:18
Two column table
<table style="width:100%;">
<tr>
<td style="padding:0 10px 0 0;">image here</td>
<td>Text here</td>
</tr>
</table>
@vc27
vc27 / gist:94db7561889d0d1cf1b9
Created November 25, 2014 22:44
Elasticsearch Client
require_once( "vendor/autoload.php" );
$params = array();
$params['hosts'] = array (
'http://20bc6e1944d0a586000.qbox.io/'
);
$client = new Elasticsearch\Client($params);
$params['index'] = 'my_index';
$params['type'] = 'my_type';