Created
March 19, 2016 11:20
-
-
Save jbalzar/d08e58a61f18fab210c5 to your computer and use it in GitHub Desktop.
Custom Genesis Featured Post Widget thru Javasript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//* Modify Genesis Featured Post HTML structure | |
$('.featuredpost article').each(function(index) { | |
//* Element variables | |
var $thumbnail = $(this).find('a.alignleft'); | |
var $header = $(this).find('.entry-header'); | |
var $content = $(this).find('.entry-content'); | |
$thumbnail.removeClass('alignleft'); | |
//* Apply Genesis column classes | |
$thumbnail.addClass('one-fourth'); | |
$thumbnail.addClass('first'); | |
//* Create wrapper for header and content | |
var $wrap_header_content = $("<div class='content-wrap three-fourths'></div>"); | |
//* Insert the wrapper to container | |
$(this).append($wrap_header_content); | |
//* Move header and content to wrapper | |
$header.detach().appendTo($(this).find('.content-wrap')); | |
$content.detach().appendTo($(this).find('.content-wrap')); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment