Skip to content

Instantly share code, notes, and snippets.

View OksanaRomaniv's full-sized avatar

Oksana Romaniv OksanaRomaniv

  • Kalush, Ukraine
View GitHub Profile
@chuckreynolds
chuckreynolds / wordpress-remove-seo-columns.php
Last active March 29, 2020 06:17 — forked from norcross/remove-seo-columns.php
remove WordPress SEO columns from admin post tables
<?php
function rkv_remove_columns( $columns ) {
// remove the Yoast SEO columns
unset( $columns['wpseo-score'] );
unset( $columns['wpseo-title'] );
unset( $columns['wpseo-metadesc'] );
unset( $columns['wpseo-focuskw'] );
@zet-snippets
zet-snippets / .htaccess - activate svg cache
Created October 17, 2013 08:45
.htaccess - activate svg cache
# SVG Chaching aktivieren
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/svg+xml "access plus 1 year"
</IfModule>
@joyrexus
joyrexus / README.md
Last active May 3, 2024 10:41 — forked from liamcurry/gist:2597326
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@nternetinspired
nternetinspired / gist:7482445
Last active February 24, 2022 17:20
Load Disqus comments only on demand if you give a shit about page weight and your visitors. Even with no comments, i.e. an empty comment form, calling Disqus will load an extra 226Kb. If your page has comments this can be far higher. This Gist accompanies my blog post: http://internet-inspired.com/wrote/load-disqus-on-demand/
// Requires jQuery of course.
$(document).ready(function() {
$('.show-comments').on('click', function(){
var disqus_shortname = 'YOUR-DISQUS-USERNAME'; // Replace this value with *your* username.
// ajax request to load the disqus javascript
$.ajax({
type: "GET",
url: "http://" + disqus_shortname + ".disqus.com/embed.js",
dataType: "script",
@NaWer
NaWer / duration8601.php
Last active April 7, 2022 13:58
Convert duration in second to duration in ISO8601
<?php
/*
* Convert duration in second to duration in ISO8601
* http://www.w3schools.com/Schema/schema_dtypes_date.asp#Duration Data Type
* http://en.wikipedia.org/wiki/ISO_8601#Durations
*
* @param integer $duration in second seconde
* @return string duration in ISO8601
*
* >= PHP 5.3 : use DateInterval <http://www.php.net/manual/en/dateinterval.construct.php>
@cdils
cdils / change-style-load-order.php
Last active February 7, 2022 15:35
Change order of where Genesis child theme stylesheet is loaded on theme initialization.
<?php //Remove this line
/**
* Remove Genesis child theme style sheet
* @uses genesis_meta <genesis/lib/css/load-styles.php>
*/
remove_action( 'genesis_meta', 'genesis_load_stylesheet' );
/**
* Enqueue Genesis child theme style sheet at higher priority
<?php
/*
Insert this script into functions.php in your WordPress theme (be cognizant of the opening and closing php tags) to allow field groups in Gravity Forms. The script will create two new field types - Open Group and Close Group. Add classes to your Open Group fields to style your groups.
Note that there is a stray (but empty) <li> element created. It is given the class "fieldgroup_extra_li" so that you can hide it in your CSS if needed.
*/
add_filter("gform_add_field_buttons", "add_fieldgroup_fields");
function add_fieldgroup_fields($field_groups){
foreach($field_groups as &$group){
@corsonr
corsonr / gist:8703820
Last active December 23, 2020 08:16
WooCommerce : Remove the "shop" title on the main shop page
<?php
/**
* Removes the "shop" title on the main shop page
*/
add_filter( 'woocommerce_show_page_title', '__return_false' );
@ihorvorotnov
ihorvorotnov / get-social-shares
Last active May 26, 2024 08:13
Get number of shares from social platforms
Facebook*:
https://api.facebook.com/method/links.getStats?urls=%%URL%%&format=json
+ works, returns shares, likes, comments and total
Twitter:
http://urls.api.twitter.com/1/urls/count.json?url=%%URL%%&callback=twttr.receiveCount
+ v1 API but still works
Reddit:
http://buttons.reddit.com/button_info.json?url=%%URL%%
@georgicodes
georgicodes / gist:9182096
Created February 24, 2014 04:46
Horizontal list of font-awesome icons
.actions li {
display: inline;
list-style-type: none;
padding-right: 5px;
font-size: 1.2em;
}
<span class="actions">
<ul>
<li><i class="fa fa-heart"></i> Add to my wishlist</li>