Skip to content

Instantly share code, notes, and snippets.

@CoachBirgit
CoachBirgit / functions.php
Created January 13, 2016 16:01
Register featured images with the Genesis Framework.
<?php
//* Do NOT include the opening php tag
//* Add featured images
add_image_size( 'front-page-hero', 800, 450, TRUE );
add_image_size( 'front-page-square', 125, 125, TRUE );
add_image_size( 'front-page-thumbnail', 200, 100, TRUE );
@CoachBirgit
CoachBirgit / functions.php
Created January 13, 2016 16:00
Enqueue Ionicons on your site with the Genesis Framework.
<?php
//* Do NOT include the opening php tag
//* Enqueue Ionicons
add_action( 'wp_enqueue_scripts', 'bg_enqueue_ionicons' );
function bg_enqueue_ionicons() {
wp_enqueue_style( 'ionicons', '//code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css', array(), CHILD_THEME_VERSION );
}
@CoachBirgit
CoachBirgit / sample.html
Created January 13, 2016 16:00
Sample HTML used for social media links using Ionicons with the Genesis Framework.
<p class="social">
<a href="http://twitter.com/bgardner"><i class="icon ion-social-twitter"></i></a>
<a href="http://www.facebook.com/bgardner"><i class="icon ion-social-facebook"></i></a>
<a href="http://instagram.com/bgardner"><i class="icon ion-social-instagram-outline"></i></a>
<a href="http://dribbble.com/bgardner"><i class="icon ion-social-dribbble-outline"></i></a>
</p>
@CoachBirgit
CoachBirgit / sample.css
Created January 13, 2016 16:00
Sample CSS used for social media links using Ionicons with the Genesis Framework.
/* Ionicons
--------------------------------------------- */
.site-footer p.social a {
border: 1px solid #949792;
border-radius: 50%;
color: #949792;
display: inline-block;
height: 42px;
margin-left: 10px;
@CoachBirgit
CoachBirgit / sample.html
Created January 13, 2016 16:00
Sample HTML to add "Made with Love" to your site footer with the Genesis Framework.
<p class="love">Made with <i class="icon ion-heart"></i> by Brian Gardner</p>
@CoachBirgit
CoachBirgit / sample.css
Created January 13, 2016 15:59
Sample CSS to add "Made with Love" to your site footer with the Genesis Framework. Raw
/* Heart Icon
--------------------------------------------- */
.site-footer .icon {
font-size: 20px;
}
.site-footer .love .icon {
font-size: 12px;
margin-left: 2px;
@CoachBirgit
CoachBirgit / functions.php
Created January 13, 2016 15:59
Exclude categories from blog homepage with the Genesis Framework.
<?php
//* Do NOT include the opening php tag
//* Exclude categories from blog homepage
add_action( 'pre_get_posts', 'bg_exclude_categories' );
function bg_exclude_categories( $query ) {
if( $query->is_main_query() && $query->is_home() ) {
$query->set( 'cat', '-5,-7' );
}
@CoachBirgit
CoachBirgit / functions.php
Created January 13, 2016 15:59
Set a default layout with the Genesis Framework.
<?php
//* Do NOT include the opening php tag
//* Set content/sidebar as the default layout
genesis_set_default_layout( 'content-sidebar' );
//* Set sidebar/content as the default layout
genesis_set_default_layout( 'sidebar-content' );
//* Set content/sidebar/sidebar as the default layout

Keybase proof

I hereby claim:

  • I am CoachBirgit on github.
  • I am coachbirgit (https://keybase.io/coachbirgit) on keybase.
  • I have a public key whose fingerprint is 8D6B E6DB AC82 C2D9 E188 DB2D 6002 F1C5 8782 3445

To claim this, I am signing this object:

@CoachBirgit
CoachBirgit / divi-lightbox-snippet-for-functions.php
Last active January 19, 2022 06:33
DIVI: add lightbox to regular content images
/* --- DEPRECATED --- */
/* add .et_pb_lightbox_image clss to content images */
add_filter('the_content', 'divi_add_lightbox');
function divi_add_lightbox($content) {
global $post;
$pattern ="/<a(.*?)href=('|\")(.*?).(bmp|gif|jpeg|jpg|png)('|\")(.*?)>/i";
$replacement = '<a$1href=$2$3.$4$5 class="et_pb_lightbox_image" title="'.$post->post_title.'"$6>';
$content = preg_replace($pattern, $replacement, $content);
return $content;
}