Skip to content

Instantly share code, notes, and snippets.

Christina carasmo

Block or report user

Report or block carasmo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@carasmo
carasmo / replace-woocommerce-lightbox-with-lightgallery.php
Last active May 31, 2019
Replace PhotoSwipe Lightbox in WooCommerce with your own, as long as your own is LightGallery (https://github.com/sachinchoolur/lightGallery). Assumes that you've registered your js. Pardon the formatting, it got weird on me.
View replace-woocommerce-lightbox-with-lightgallery.php
<?php
//don't add again
// assumes that you have registered your js for the new lightbox and that you understand what a handle is.
// Gallery Support
add_theme_support( 'wc-product-gallery-zoom' );
add_theme_support( 'wc-product-gallery-slider' );
@carasmo
carasmo / dequeue-woocommerce-js-css-on-non-woo-pages.php
Last active Jun 1, 2019
Dequeue WooCommerce CSS and JS on non-WooCommerce pages for 3.6.4
View dequeue-woocommerce-js-css-on-non-woo-pages.php
<?php
//don't add above twice if it already exists
/**
* Check if WooCommerce Page of all kinds (not just cart and shop)
* @thanks: https://faish.al/2014/01/06/check-if-it-is-woocommerce-page/
* Checked IDS with WooCommerce Repo 1 June 2019
*/
function ca_is_really_woocommerce_page() {
@carasmo
carasmo / change-posts-to-blog.php
Last active Jun 27, 2019
This file adds the blog/ path without affecting all other CPTS (having to change their args) now and in the future. Changes all labels to Blog. Converts post_tag to hierarchical because flat is annoying to deal with
View change-posts-to-blog.php
<?php
/**
*
* This file:
*
* 1. adds the blog/ path without affecting all other CPTS (having to change their args) now and in the future.
* 2. Changes all labels to Blog
* 3. Converts post_tag to hierarchical because flat is annoying to deal with
*
@carasmo
carasmo / remove-genesis-plugin-submenu.php
Created May 11, 2019
Remove Genesis Plugin Submenu Menu from admin
View remove-genesis-plugin-submenu.php
<?php
//don't add this
add_action( 'admin_menu', 'christina_remove_genesis_plugins_admin_page', 99 );
//remove genesis-plugin sub menu
function christina_remove_genesis_plugins_admin_page() {
remove_submenu_page( 'genesis', 'genesis-plugins' );
}
@carasmo
carasmo / random-hero-image.css
Last active Mar 5, 2018
TThis has two sets of code. The first is the CSS is which is an example only. The next file is the random image php from a directory for Genesis (modifiable for any WordPress theme). Adjust as needed for your requirements. If this saved you time, and I'm sure it did, consider a donation via PayPal to me@christinacreativedesign.com
View random-hero-image.css
.my-hero-container {
position: relative;
height: 20vh;
min-height: 150px;
}
@media (min-width: 800px) {
.my-hero-container {
height: 45vh;
min-height: 250px;
@carasmo
carasmo / un-register-widgets.php
Created Jan 29, 2018
Un-register widgets and clean up the widgets page.
View un-register-widgets.php
<?php
//Don't re-add the php tag
/*
* Comment out the ones you want to keep. You will need some, but not all, for each project.
* Also, if you un-register then you can't use the_widget();
*/
add_action( 'widgets_init', 'cab_unregister_widgets', 10 );
/**
@carasmo
carasmo / for-include-or-functions.php
Created Jan 29, 2018
Add Custom Post Type and Taxonomy Terms to wp_link_query. Link search function in WordPress editor add Custom Post Types and Taxonomy Terms
View for-include-or-functions.php
<?php
//don't re add the php tag above
add_filter('wp_link_query', 'cab_add_custom_post_type_archive_link', 10, 2);
/**
* Add Custom Post Type archive to WordPress search link query
* Author: https://github.com/mthchz/editor-archive-post-link/blob/master/editor-archive-post-link.php
*/
function cab_add_custom_post_type_archive_link( $results, $query ) {
@carasmo
carasmo / remove-google-fonts-add-default-fonts-beaver-builder.php
Last active Apr 17, 2019
How to add only the theme font choices and remove the Google fonts from Beaver Builder. See the image in the comment.
View remove-google-fonts-add-default-fonts-beaver-builder.php
<?php
//don't add again
// Save Time? Consider a donation via PayPal @ me@christinacreativedesign.com
add_action( 'wp_head', 'childprefix_beaver_builder_modifications', 0 );
/*
* Beaver Builder Builder Enabled Modifications
@carasmo
carasmo / remove-beaver-builder-from-admin-woocommerce.php
Last active Jan 5, 2018
Remove Beaver Builder link and tab in Admin for WooCommerce pages
View remove-beaver-builder-from-admin-woocommerce.php
<?php
//* DON'T ADD ABOVE
/*
*
* READ ME:
* I'm using Beaver Builder for page post types and I don't want that option on
* WooCommerce store, cart, checkout, and my account pages. I don't want the client to ask why she can't change
@carasmo
carasmo / html-no-js-device-class.php
Created Dec 27, 2017
In Genesis add a no-js to the html tag and a touch-device or desktop-device class depending on server side detection. See comments under the gist.
View html-no-js-device-class.php
<?php
///DO NOT copy above
remove_action( 'genesis_doctype', 'genesis_do_doctype' );
add_action( 'genesis_doctype', 'childthemeprefix_html5_no_js_device_doctype' );
/**
* Add Doc Type no-js default
* reference: http://alxmedia.se/code/2013/11/using-a-no-js-class-in-your-wordpress-theme/
You can’t perform that action at this time.