Skip to content

Instantly share code, notes, and snippets.

View deckerweb's full-sized avatar
🏠
Working from home

David Decker deckerweb

🏠
Working from home
View GitHub Profile
<?php
/* Set up Licence key for this theme. URL: https://easydigitaldownloads.com/docs/activating-license-keys-in-wp-plugins-and-themes */
/* This is the URL our updater / license checker pings. This should be the URL of the site with EDD installed. */
define( 'MINA_OLEN_SL_STORE_URL', 'http://localhost/foxnet-themes-shop' ); // use your own unique prefix to prevent conflicts
/* The name of your product. This should match the download name in EDD exactly. */
define( 'MINA_OLEN_SL_THEME_NAME', 'Mina olen' ); // use your own unique prefix to prevent conflicts
/**
* Change Image Alignment of Featured Image From Left to Right
*
*/
function sk_change_image_alignment( $attributes ) {
$attributes['class'] = str_replace( 'alignleft', 'alignright', $attributes['class'] );
return $attributes;
}
/**
* to exclude field from notification add 'exclude[ID]' option to {all_fields} tag
* 'include[ID]' option includes HTML field / Section Break field description / Signature image in notification
* see http://www.gravityhelp.com/documentation/page/Merge_Tags for a list of standard options
* example: {all_fields:exclude[2,3]}
* example: {all_fields:include[6]}
* example: {all_fields:include[6],exclude[2,3]}
*/
add_filter( 'gform_merge_tag_filter', 'all_fields_extra_options', 11, 5 );
function all_fields_extra_options( $value, $merge_tag, $options, $field, $raw_value ) {
<?php
/**
* Dont Update the Theme
*
* If there is a theme in the repo with the same name, this prevents WP from prompting an update.
*
* @since 1.0.0
* @param array $r Existing request arguments
* @param string $url Request URL
* @return array Amended request arguments
<?php
/*
* @goliver79
* woocommerce hide empty categories in woocommerce widget "product categories"
*/
function woo_hide_product_categories_widget( $list_args ){
$list_args[ 'hide_empty' ] = 1;
return $list_args;
}
<?php
/*
* Add custom query vars to handle Google Analytics Ecommerce tracking.
* This should be placed in a plugin or in functions.php of the theme.
*
* You'll want to use the redirect method for Gravity Forms confirmations and
* turn on passing field data via a query string. An example we used was:
* donation_amount={Donation Amount:13}&donation_id={entry_id}&donation_recurring=0
*/
function sm_add_query_vars( $vars ){
@deckerweb
deckerweb / gist:2658811
Created May 11, 2012 10:24 — forked from anonymous/gist:2633852
WordPress Plugin Header Example
<?php
/**
* Plugin Name: Example Plugin Name
* Plugin URI: http://plugin-homepage.tld
* Description: A description of your plugin.
* Version: 1.0
* Author: Plugin Author Name
* Author URI: http://plugin-author-homepage.tld
* License: GPLv2 or later
* License URI: http://www.opensource.org/licenses/gpl-license.php
@deckerweb
deckerweb / genesis-site-title.php
Created October 6, 2015 18:33 — forked from cdils/genesis-site-title.php
Filter the Genesis SEO Title to output with a custom class.
// Filter the title with a custom function
add_filter('genesis_seo_title', 'wap_site_title' );
// Add additional custom style to site header
function wap_site_title( $title ) {
// Change $custom_title text as you wish
$custom_title = '<span class="custom-title">WA</span>Estate';
// Don't change the rest of this on down
@deckerweb
deckerweb / multisite_custom_my_sites_menu_titles.php
Created November 16, 2015 08:11 — forked from glueckpress/multisite-custom-my-sites-menu-titles.php
Custom site titles for the My Sites network admin bar menu in a WordPress multisite network. Configure first function, then auto-activate by saving this file in wp-content/mu-plugins, or network activate as a regular plugin.
<?php
/**
* Plugin Name: Custom My Sites Menu Titles
* Description: Custom site titles for the My Sites network admin bar menu. Multisite only.
* Version: 2015.11
* Author: Caspar Hübinger
* Author URI: https://profiles.wordpress.org/glueckpress
* License: GNU General Public License v3 or later
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
*/
@deckerweb
deckerweb / wpseo-iconfix.php
Created December 3, 2015 10:22 — forked from krafit/wpseo-iconfix.php
Nachdem der Schmerz, den wpSEO-Menüpunkt ansehen zu müssen zu groß wurde, habe ich das Icon im Admin-Menü ersetzt.
if (function_exists(wpseo_autoload)) {
function krafit_repair_wpseo() {
?>
<style>
#adminmenu #toplevel_page_wpseo div.wp-menu-image img {
display: none;
}
#adminmenu #toplevel_page_wpseo div.wp-menu-image::before {
content: "\f511";