Skip to content

Instantly share code, notes, and snippets.

View carasmo's full-sized avatar

Christina carasmo

  • Florida
View GitHub Profile
@Luehrsen
Luehrsen / innerLayoutControls.js
Created February 16, 2022 20:56
A hacky way how to return to formerly expected behaviour for the group block for the WordPress block editor.
/**
* @type {string[]} Array of block names that should be excluded from the layout settings.
*/
const haystack = ['core/group'];
wp.hooks.addFilter(
'blocks.registerBlockType',
'lh/fseFixes/layoutSettings',
(settings, name) => {
if (!haystack.includes(name)) {
@itsdavidmorgan
itsdavidmorgan / basic-block-styles.css
Last active October 7, 2022 14:05
WordPress Gutenberg Basic Block Styles
/************************************************
Audio Blocks
************************************************/
.wp-block-audio {
margin-left: 0px;
margin-right: 0px;
}
.wp-block-audio audio {
width: 100%;
@HoldOffHunger
HoldOffHunger / bradvin.social.share.urls.txt
Last active October 19, 2024 18:33
Social Share URL's (Summary)
https://www.facebook.com/sharer.php?u={url}
https://www.facebook.com/dialog/share?app_id={app_id}&display={page_type}&href={url}&redirect_uri={redirect_url}
https://reddit.com/submit?url={url}&title={title}
https://twitter.com/intent/tweet?url={url}&text={title}&via={user_id}&hashtags={hash_tags}
https://www.linkedin.com/sharing/share-offsite/?url={url}
https://api.whatsapp.com/send?phone={phone_number}&text={title}%20{url}
https://www.tumblr.com/widgets/share/tool?canonicalUrl={url}&title={title}&caption={text}&tags={hash_tags}
http://pinterest.com/pin/create/button/?url={url}
https://www.blogger.com/blog-this.g?u={url}&n={title}&t={text}
https://www.evernote.com/clip.action?url={url}&title={title}
@maheshwaghmare
maheshwaghmare / override-woocommerce-from-plugin.php
Created May 4, 2017 07:26
Override default WooCommerce templates and template parts from plugin
<?php
/**
* Override default WooCommerce templates and template parts from plugin.
*
* E.g.
* Override template 'woocommerce/loop/result-count.php' with 'my-plugin/woocommerce/loop/result-count.php'.
* Override template part 'woocommerce/content-product.php' with 'my-plugin/woocommerce/content-product.php'.
*
* Note: We used folder name 'woocommerce' in plugin to override all woocommerce templates and template parts.
* You can change it as per your requirement.
@dtbaker
dtbaker / code.php
Last active May 21, 2022 10:48
Add a custom control to an existing Elementor widget
// This example will add a custom "select" drop down to the "Image Box"
// This will change the class="" on the rendered image box so we can style the Image Box differently
// based on the selected option from the editor.
// The class will be "my-image-box-style-blue" or "my-image-box-style-green" based on the selected option.
add_action('elementor/element/before_section_end', function( $section, $section_id, $args ) {
if( $section->get_name() == 'image-box' && $section_id == 'section_image' ){
// we are at the end of the "section_image" area of the "image-box"
$section->add_control(
@emzo
emzo / wp_link_query_term_linking.php
Created June 14, 2016 21:57
Allow linking to taxonomy terms as well as posts when performing internal linking
@vielhuber
vielhuber / .htaccess
Last active February 24, 2023 06:01
Apache: htaccess force www and https ssl #server
# force HTTPS and www.
RewriteEngine On
RewriteCond %{HTTP_HOST} (?!^www\.)^(.+)$ [OR]
RewriteCond %{HTTPS} off
RewriteRule ^ https://www.%1%{REQUEST_URI} [R=301,L]
# alternative way
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^www\. [NC]
@levymetal
levymetal / functions.php
Last active November 1, 2022 02:43
Custom adaptation for my sub-menu script that allows you to force a specific sub-menu to be displayed. Full documentation here: http://christianvarga.com/how-to-get-submenu-items-from-a-wordpress-menu-based-on-parent-or-sibling/
<?php
/* usage
*
* wp_nav_menu( array(
* 'theme_location' => 'primary',
* 'sub_menu' => true,
* 'root_id' => id_of_menu_item
* ) );
*/
@ashfame
ashfame / woocommerce-category-images-from-product.php
Last active June 6, 2023 00:46
Use WooCommerce product image as its category image, if category image is missing
<?php
/**
* Plugin Name: WooCommerce Category Images Modification
* Plugin URI: http://blog.ashfame.com/?p=1117
* Description: Use product image as its category image on category archive pages (To override image for product category, upload one for that category and it will override)
* Author: Ashfame
* Version: 0.1.2
* Author URI: http://ashfame.com/
*/
@robneu
robneu / genesis-searchwp-image-search.php
Last active September 14, 2019 21:25
Create a custom search template to display custom search results using SearchWP and the Genesis Framework.
<?php
/**
* This file adds the SearchWP Images template to your theme.
*
* Template Name: SearchWP Images
*
* @author Robert Neu
* @package Genesis
* @subpackage SearchWP
*/