Skip to content

Instantly share code, notes, and snippets.

@topleague
topleague / Related-Posts-CSS-Grid.php
Created September 20, 2017 08:44
Display Related Posts in Grid Format using CSS Grid
@topleague
topleague / Related-Posts-CSS-Grid.css
Last active September 21, 2017 10:47
Display Related Posts in Grid Format using CSS Grid
@topleague
topleague / Fadeup-Animation-Genesis.php
Created September 25, 2017 11:41
FadeUp Animation in Genesis
//* Add extra CSS classes to animate the site-container
add_filter('genesis_attr_site-container', 'susanta_animate_site_container');
function susanta_animate_site_container($attributes) {
$attributes['class'] .= ' animate-site-container fadeUp';
return $attributes;
}
@topleague
topleague / Fadeup-Animation-Genesis.css
Last active September 25, 2017 13:08
Styling for FadeUp Animation in Genesis
/* Animate Site Container - Keyframes
------------------------------------------------------------ */
.animate-site-container {
animation-delay: .7s;
animation-duration: 1s;
animation-fill-mode: both;
}
/* fadeIn
@topleague
topleague / fadeup.js
Created September 25, 2017 12:44
JS Code for Fadeup Effect
(function($) {
//* Make sure JS is enabled
document.documentElement.className = "js";
$(document).ready( function() {
//* Run 0.25 seconds after document ready for any instances viewable on load
setTimeout( function() {
animateObject();
@topleague
topleague / fadeup-effect-js.css
Created September 25, 2017 12:46
Fadeup Effect with JS
/* Fadeup Effect
---------------------------------------------------------------------------------------------------- */
.js .fadeup-effect {
opacity: 0;
overflow: hidden;
-webkit-animation-duration: 1s;
animation-duration: 1s;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
@topleague
topleague / register-widgets-fadeup-class.php
Created September 25, 2017 12:52
Register Widgets with FadeUp Class
// Register a new widget area (this code snippet should go in functions.php)
genesis_register_widget_area(
array(
'id' => "your-widget-area",
'name' => __( "Your Widget", 'your-theme-text-domain' ),
'description' => __( "This is Your Widget Area section.", 'your-theme-text-domain' ),
)
);
// Display Widget Area (this code snippet should go in front.php)
@topleague
topleague / Enqueue Fadeup Script.php
Created September 25, 2017 13:56
Enqueue Fadeup Script
wp_enqueue_script( 'fadeup-script', get_stylesheet_directory_uri() . '/js/fadeup.js', array( 'jquery' ), '1.0.0', true );
@topleague
topleague / add-classes-attributes-genesis.php
Last active December 3, 2019 07:11
Adding Classes and Attributes to HTML elements in Genesis
// Adding Classes and Attributes to HTML elements in Genesis
// Courtesy: https://wpbeaches.com/adding-attribute-html-section-genesis/
//* Add class to .entry
add_filter( 'genesis_attr_entry', 'susanta_animate_entry' );
function susanta_animate_entry( $attributes ) {
$attributes['class'] = $attributes['class']. ' animate-entry fadeUp';
return $attributes;
}
@topleague
topleague / loading-animation-effects-genesis.css
Created September 27, 2017 07:45
Different Loading Animation Effects in Genesis
/* Effect 2: Move Up */
.animate-entry {
-webkit-transform: translateY(200px);
transform: translateY(200px);
-webkit-animation: moveUp 0.65s ease forwards;
animation: moveUp 0.65s ease forwards;
}
@-webkit-keyframes moveUp {