Skip to content

Instantly share code, notes, and snippets.

View geeac's full-sized avatar

Eugenia Cosinschi geeac

View GitHub Profile
@geeac
geeac / .htaccess
Created April 8, 2020 07:54
domain change
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS_HOST} !^newdomain\.com$ [NC]
RewriteRule ^(.*)$ https://newdomain.com/$1 [R=301,L]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
@geeac
geeac / genesis_custom_loop.php
Created March 4, 2020 15:33 — forked from JiveDig/genesis_custom_loop.php
wp_query using genesis_custom_loop. To alter content use standard genesis add_action and remove_action hooks
<?php
//* Custom loop WITH pagination
remove_action( 'genesis_loop', 'genesis_do_loop' );
add_action( 'genesis_loop', 'bhl_do_resident_query' );
function bhl_do_resident_query() {
global $paged;
global $query_args;
@geeac
geeac / typography.htm
Created December 12, 2019 09:38
typography page content
<div class="one-fourth first" style="background-color: #1b1852; color: #fff;">#1b1852</div>
<div class="one-fourth " style="background-color: #c1c0be; color: #fff;">#c1c0be</div>
<div class="one-fourth " style="background-color: #999; color: #fff;">#999</div>
<div class="one-fourth " style="background-color: #000; color: #fff;">#000</div>
<p>&nbsp;</p>
<p>Headings:</p>
<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<?php
// Add Google Analytics eCommerce tracking for MemberPress
function echo_ga_tracking_script() {
global $wpdb;
if(isset($_GET['membership']) && isset($_GET['trans_num'])) {
// get transaction info for one time payments
$txn = MeprTransaction::get_one_by_trans_num($_GET['trans_num']);
// check if it has subscription info attached
if(isset($_GET['subscr_id']) && ($_GET['subscr_id'] == $_GET['trans_num'])) {
@geeac
geeac / functions.php
Created June 8, 2019 11:09
Enqueue Google Fonts.
<?php
//* Do NOT include the opening php tag
//* Load Lato and Merriweather Google fonts
add_action( 'wp_enqueue_scripts', 'bg_load_google_fonts' );
function bg_load_google_fonts() {
wp_enqueue_style( 'google-fonts', '//fonts.googleapis.com/css?family=Lato:300,700|Merriweather:300,700', array(), CHILD_THEME_VERSION );
}
@geeac
geeac / AgentPress_class-listings.php
Last active February 18, 2019 11:26
modify class AgentPress_Listings to change the [property_details] shortcode and display data on 3 columns instead of 2
class AgentPress_Listings {
public $settings_field = 'agentpress_taxonomies';
public $menu_page = 'register-taxonomies';
/**
* Property details array.
*/
public $property_details;
@geeac
geeac / README.md
Last active February 15, 2019 10:01 — forked from i2000s/README.md
Add an Export-to-Outlook button for The Events Calendar

This code snipet is based on the events-calendar-outlook-import-fix code. It is aiming at adding a button on the Wordpress Event page to let users export event to various calendars.

Code is licensed under the GPL 2.0 or greater license.

@geeac
geeac / smooth-scroll.js
Created June 28, 2018 15:35
smooth scroll
jQuery(window).load(function($){
function scrollToAnchor(hash) {
var target = $(hash), headerHeight;
if ($("#wpadminbar").length) {
headerHeight = $(".site-header").height() + $("#wpadminbar").height() + 5; // Get fixed header height
}
else headerHeight = $(".site-header").height() + 5;
target = target.length ? target : $('[name=' + hash.slice(1) +']');
@geeac
geeac / functions.php
Created November 6, 2017 09:40
remove "add to cart" functionality
// Remove Add to cart functionality
remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart');
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 );
@geeac
geeac / functions.php
Created October 25, 2017 09:33
custom endpoint My Account
// create a custom end point in the My Accunt Page
function custom_wc_end_point() {
if(class_exists('WooCommerce')){
add_rewrite_endpoint( 'wholesale-ordering', EP_ROOT | EP_PAGES );
}
}
add_action( 'init', 'custom_wc_end_point' );
function custom_endpoint_query_vars( $vars ) {
$vars[] = 'wholesale-ordering';
return $vars;