This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Woocommerce "item" taxonomy | |
* | |
* This plugin is a template to add a custom taxonomy to products in woocommerce. | |
* One should search/replace every "Item" occurence with the taxonomy name. | |
* | |
* @link https://gist.github.com/smeric/523c54a16f2ed1870a60 | |
* @since 1.0.0 | |
* @package woocommerce_custom_taxonomy_product_item |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Redirect WooCommerce customer to profile page after a successful login through wp-login.php or | |
* redirect any unauthorised user trying to access any wp-admin files. | |
* | |
* @author Sébastien Méric <sebastien.meric@gmail.com> | |
* @param string $redirect_to URL to redirect to. | |
* @return string | |
*/ | |
add_action( 'init', 'woocommerce_custom_redirect_customer_to_account_page' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Force attachments download : | |
* | |
* In order for this to work, when you insert the file into your post through the media uploader, | |
* you have to select Post URL rather than File URL in the Link URL field before inserting into your post. | |
* A link to a filename will follow the browser's preferences, but by linking to the WP post link, | |
* you can control its behaviour.) | |
* | |
* @link https://gist.github.com/smeric/cb4520e848aaa0be703c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add post type images to feed items | |
*/ | |
add_action('rss2_item', 'add_images_in_feed' ); | |
function add_images_in_feed() { | |
global $post; | |
// Thumbnail... | |
$thumbnail_ID = get_post_thumbnail_id( $post->ID ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* AddToAny : custom script inserted into the document head | |
* | |
* Push shared data to datalayer for GTM | |
* Re-shape title to remove special characters | |
* Use shortlink for Twitter | |
* | |
* see https://www.addtoany.com/ext/google_analytics/ | |
* see https://www.addtoany.com/buttons/customize/wordpress/events |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Smooth scroll : | |
* <a href="#top" class="go-top">Top</a> | |
* $( '.go-top' ).click( function( e ){ e.preventDefault(); $( this ).autoscroll( $( this ).attr( 'href' ) ); }); | |
**/ | |
( function( $ ) { | |
$.fn.autoscroll = function( selector ) { | |
$( 'html,body' ).animate({ | |
scrollTop: $( selector ).offset().top | |
}, 200); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Merge multiple RSS feeds with SimplePie | |
* | |
* Just modify the path to SimplePie and | |
* modify the $feeds array with the feeds you want | |
* | |
* You should probably also change the channel title, link and description, | |
* plus I added a CC license you may not want | |
* | |
* Help from: http://www.webmaster-source.com/2007/08/06/merging-rss-feeds-with-simplepie/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Register all actions, filters and shortcodes for the plugin | |
* | |
* @link http://example.com | |
* @since 1.0.0 | |
* | |
* @package Plugin_Name | |
* @subpackage Plugin_Name/includes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add user roles as classes to body tag in front and backend. | |
*/ | |
add_filter( 'body_class','add_roles_to_body' ); | |
add_filter( 'admin_body_class', 'add_roles_to_body' ); | |
function add_roles_to_body( $classes ) { | |
global $current_user; | |
foreach ( $current_user->roles as $user_role ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* truncated content styles : add this to the child theme style.css */ | |
div.truncated_content { | |
position: relative; | |
} | |
div.truncated_content:before { | |
content: ''; | |
position: absolute; | |
width: 100%; | |
height: 100px; | |
height: 100%; |
OlderNewer