Skip to content

Instantly share code, notes, and snippets.

View ericnicolaas's full-sized avatar
🎯
Focusing

Eric Daams ericnicolaas

🎯
Focusing
View GitHub Profile
@ericnicolaas
ericnicolaas / footer.php
Created March 18, 2016 12:55
Legacy version of footer.php for Reach
@ericnicolaas
ericnicolaas / gist:04fccd9469ca6b23112c
Last active March 21, 2016 10:21
Register a campaign sidebar
<?php
/**
* Put this in your theme or child theme's functions.php file.
*/
function en_register_campaign_sidebar() {
$args = array(
'id' => 'campaign-sidebar',
'name' => __( 'Campaign Sidebar', 'your-textdomain' ),
<?php get_header() ?>
<?php
global $porto_settings, $porto_layout;
wp_reset_postdata();
?>
<div id="content" role="main">
@ericnicolaas
ericnicolaas / sidebar-campaigns.php
Created March 25, 2016 23:50
Campaigns Sidebar - Porto Theme
<div class="col-md-3 sidebar wide-full ?><!-- main sidebar -->
<?php dynamic_sidebar( 'campaigns-sidebar' ); ?>
</div><!-- end main sidebar -->
@ericnicolaas
ericnicolaas / sidebar-campaigns.php
Created March 25, 2016 23:50
Campaigns Sidebar - Porto Theme
<div class="col-md-3 sidebar wide-full ?><!-- main sidebar -->
<?php dynamic_sidebar( 'campaigns-sidebar' ); ?>
</div><!-- end main sidebar -->
@ericnicolaas
ericnicolaas / charitable-tweaks.php
Created April 13, 2016 19:48
Basic Charitable tweaks plugin
<?php
/**
* Plugin Name: Charitable - My Custom Tweaks
* Plugin URI:
* Description: A simple plugin to allow you to add your own tweaks.
* Version: 0.1
* Author: WP Charitable
* Author URI: https://wpcharitable.com/
*/
@ericnicolaas
ericnicolaas / custom-logo-update-script.php
Last active April 14, 2016 01:06 — forked from devinsays/custom-logo-update-script.php
Code snippet for update script to use new theme logo
<?php
/**
* Theme Update Script
*
* Runs if the logo has not been set yet.
*/
function prefix_update_check() {
// Return if update has already been run
if ( -1 == get_theme_mod( 'custom_logo', -1 ) ) {
@ericnicolaas
ericnicolaas / campaign-post-class.php
Last active April 21, 2016 02:41
Give campaigns a post class of hentry
/**
* Add the `hentry` post class to campaigns.
*
* Some themes remove this class, which breaks the [campaigns] shortcode display.
*
* @param string[] $classes
* @return string[]
*/
function en_set_campaign_hentry_post_class( $classes ) {
if ( Charitable::CAMPAIGN_POST_TYPE == get_post_type() && ! in_array( 'hentry', $classes ) ) {
@ericnicolaas
ericnicolaas / style.css
Last active April 23, 2016 07:23
Change font on Reach
/* If you just do not want uppercase text for headers & buttons, etc, you can use this */
h1, h2, h3, h4, h5, h6, .menu-site li, button, .button, .tribe-events-button, input[type=submit], input[type=reset], .campaign-summary li span, .countdown, .site-title, .site-tagline, .post-title, .entry-header .entry-title, .page-title, legend, .charitable-form-header, .account-links, .barometer span span, .bypostauthor .post-author, .meta, cite, th, .edd_cart_amount, #rockbottom, .campaign-status .campaign-raised span, .campaign-status .campaign-pledged span, .campaign-status .campaign-time-left span, .widget_crowdfunding_stats_widget li span, .campaign-status-tag, .tabs .tab-title, .charitable-campaign-creator-toolbar a, .donation-amounts .amount, .donation-amounts .custom-donation-amount, .widget.widget_charitable_donation_stats_widget .figure, .campaign-finished, .download-price, .sticky-tag, .campaign-title, .author .author-facts h2, .author .author-bio h3, .button-alt, .button-secondary, .button.button-alt, .butto
@ericnicolaas
ericnicolaas / function.php
Last active April 30, 2016 00:15
Hide the campaign summary for campaigns in a certain category
<?php
function charitable_template_campaign_summary( $campaign ) {
if ( has_term( 'my-special-category', 'campaign_category', $campaign->ID ) ) {
return;
}
charitable_template( 'campaign/summary.php', array( 'campaign' => $campaign ) );
}