Skip to content

Instantly share code, notes, and snippets.

View eddt's full-sized avatar

Edd Twilbeck eddt

  • Ocean Springs, MS
View GitHub Profile
/* Small Devices, Tablets */
@media only screen and (max-width : 768px) {
.animated {
/*CSS transitions*/
-o-transition-property: none !important;
-moz-transition-property: none !important;
-ms-transition-property: none !important;
-webkit-transition-property: none !important;
transition-property: none !important;
/*CSS transforms*/
@eddt
eddt / npm-commands.md
Created January 31, 2019 15:17 — forked from ankurk91/npm-commands.md
Useful npm commands and tricks

npm v3.10 - ◾

⚠️ This gist is outdated, but most of the commands are still relevant.

Update npm itself

npm install -g npm
# Downgrade to a specific version
npm install -g npm@2
@eddt
eddt / functions.php
Created October 14, 2016 19:16 — forked from bamadesigner/functions.php
WordPress Multsite - wp_get_post_featured_image_src() - Get wp_get_attachment_image_src() data for any post's featured image on your network
/**
* This function allows you to retrieve the wp_get_attachment_image_src()
* data for any post's featured image on your network. If you are running
* a multisite network, you can supply another blog's ID to retrieve a post's
* featured image data from another site on your WordPress multisite network.
*
* Does not take care of icon business (at this time).
*
* If successful, this function returns an array of the following:
* [0] => url
@eddt
eddt / current_page_share.php
Created June 1, 2016 20:22 — forked from jawinn/current_page_share.php
Share Current Page via Facebook
<?php
/**
* Get the current Url taking into account Https and Port
* @link http://css-tricks.com/snippets/php/get-current-page-url/
* @version Refactored by @AlexParraSilva
*/
function getUrl() {
$url = isset( $_SERVER['HTTPS'] ) && 'on' === $_SERVER['HTTPS'] ? 'https' : 'http';
$url .= '://' . $_SERVER['SERVER_NAME'];
$url .= in_array( $_SERVER['SERVER_PORT'], array('80', '443') ) ? '' : ':' . $_SERVER['SERVER_PORT'];
@eddt
eddt / wp-get_id_by_slug
Last active December 19, 2017 08:22 — forked from davidpaulsson/wp-get_id_by_slug
WordPress: Get page ID from slug
// Usage:
// get_id_by_slug('any-page-slug','any-post-type');
function get_id_by_slug($page_slug, $slug_page_type = 'page') {
$find_page = get_page_by_path($page_slug, OBJECT, $slug_page_type);
if ($find_page) {
return $find_page->ID;
} else {
return null;
}
@eddt
eddt / Create a custom pagination
Created December 2, 2015 18:01 — forked from corsonr/Create a custom pagination
A simple pagination in a few lines of code
<?php
/* ------------------------------------------------------------------*/
/* PAGINATION */
/* ------------------------------------------------------------------*/
//paste this where the pagination must appear
global $wp_query;
$total = $wp_query->max_num_pages;
// only bother with the rest if we have more than 1 page!
<?php
/* Register custom post types on the 'init' hook. */
add_action( 'init', 'my_register_post_types' );
/**
* Registers post types needed by the plugin.
*
* @since 0.1.0
* @access public