Skip to content

Instantly share code, notes, and snippets.

View carasmo's full-sized avatar

Christina carasmo

  • Florida
View GitHub Profile
@carasmo
carasmo / unregister-widgets.php
Last active March 24, 2021 13:36
Unregister WordPress, Genesis, and WooCommerce widgets Raw
<?php
//Don't copy above.
add_action('widgets_init', 'cabeymer_unregister_widgets', 10);
/**
* Unregister Various Widgets
* Clean up your widgets.php page
* Single comment out the ones you want to keep
*/
@carasmo
carasmo / gravatar-avatar-outside-loop.php
Last active September 29, 2018 06:03
Get Gravatar / Avatar Outside of loop WordPress.
<?php
//* Do not copy above. Add the hook where it's going. Change the function name to reflect your situation.
add_action( 'your_hook', 'themeprefix_author_gravatar_outside_loop_single_post' );
//* Author Gravatar/Avatar outside of Loop on Single posts
function themeprefix_author_gravatar_outside_loop_single_post() {
<?php
//DO NOT COPY THE ABOVE PHP tag -- change yourprefix_ in two locations
add_filter( 'pre_get_avatar_data', 'yourprefix_remove_gravatars_from_pinterest_choices', 10, 2 );
/**
* Add html5 atts on all avatars to remove from Pinterst choices
*/
function yourprefix_remove_gravatars_from_pinterest_choices( $args, $id_or_email ) {
$args['extra_attr'] = 'data-pin-no-hover="true" data-pin-nopin="true"';
@carasmo
carasmo / woocommerce-functions.php
Last active October 11, 2017 14:16
Change Loop in WooCommerce for CSS Grid or not floats : This is to be included as a separate file in your theme. If you do it differently, be sure to check that WooCommerce is installed,
<?php
/**
* Theme Name
*
* Adds the required WooCommerce setup functions to the Theme Name
*
* @package Your Package
* @author Your Name
* @license GPLv3 or later
* @license uri https://www.gnu.org/licenses/gpl-3.0.en.html
@carasmo
carasmo / what-is-php-version.php
Last active October 2, 2017 15:20
Check version of php. Stick in the root of your site where your WordPress resides. Then check it by visiting this page in your browser: yourdomain.com/what-is-php-version.php
<?php
// prints e.g. 'Current PHP version: 4.1.1'
echo 'Current PHP version: ' . phpversion();
// prints e.g. '2.0' or nothing if the extension isn't enabled
echo phpversion('tidy');
<?php
// do not repeat in your code -- that is don't paste this line in and read comments too.
add_action( 'genesis_loop', 'your_prefix_remove_genesis_simple_share_woo_pages', 0 );
/**
* Remove Genesis Simple Share from WooCommerce (not product pages)
*/
function your_prefix_remove_genesis_simple_share_woo_pages() {
@carasmo
carasmo / genesis-archive-description-embed-shortcode-support.php
Last active September 4, 2017 17:14
Genesis Archive Description oEmbed Shortcode support
<?php
//don't add again
add_action( 'genesis_before', 'your_prefix_embed_shortcode_archive_intro_text_support' );
/**
* Add oEmbed and Shortcode support Genesis archive description
*/
function your_prefix_embed_shortcode_archive_intro_text_support() {
<?php
// don't add again // assumes this is in an include in your child theme usually a helper-functions.php file
/**
* Check if WooCommerce Page of all kinds
* @thanks: https://faish.al/2014/01/06/check-if-it-is-woocommerce-page/
*/
function theme_prefix_is_woocommerce_page() {
if( function_exists ( 'is_woocommerce' ) && is_woocommerce() ) :
return true;
@carasmo
carasmo / yet-another-how-to-get-featured-image-genesis.php
Last active September 3, 2017 14:14
How to get Featured Image Genesis