Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jbalzar/d08e58a61f18fab210c5 to your computer and use it in GitHub Desktop.
Save jbalzar/d08e58a61f18fab210c5 to your computer and use it in GitHub Desktop.
Custom Genesis Featured Post Widget thru Javasript
//* 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