Skip to content

Commit

Permalink
Add support for half-post-width and full-post-width inline images.
Browse files Browse the repository at this point in the history
  • Loading branch information
markbarnes committed Nov 3, 2016
1 parent d7a15e5 commit 26f1a8a
Show file tree
Hide file tree
Showing 9 changed files with 144 additions and 4 deletions.
16 changes: 15 additions & 1 deletion classes/theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public static function set_everything_up() {
remove_action ('genesis_entry_footer', 'genesis_post_meta' );
unregister_sidebar( 'header-right' );
add_filter ('genesis_attr_entry-header', array (__CLASS__, 'add_attributes_to_entry_header'));

// Front page
if (is_front_page()) {
add_action ('genesis_meta', array (__CLASS__, 'add_google_structured_data_to_homepage'));
Expand Down Expand Up @@ -1039,6 +1039,20 @@ public static function add_attributes_to_entry_header($attributes) {
}
return $attributes;
}

/**
* Filters the list of images sizes available in the media gallery
*
* Filters image_size_names_choose
*
* @param array $sizes
* @return array
*/
public static function add_image_sizes_to_media_gallery ($sizes) {
$sizes ['half-post-width'] = 'Half-width';
$sizes ['full-post-width'] = 'Full-width';
return $sizes;
}

/**
* Enqueues the stylesheets for various media queries
Expand Down
18 changes: 18 additions & 0 deletions css/style-0-369.css
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,24 @@ body.full-size-header-image .entry-title {
margin-bottom: 0;
}

img.size-full-post-width {
margin-left: -20px;
width: 300px;
}

img.size-half-post-width {
width: 300px;
margin-right: 0;
}

img.size-half-post-width.alignleft {
margin-left: -20px;
}

img.size-half-post-width.alignright {
margin-right: -20px;
}

/* Issue archive page
----------------- */

Expand Down
17 changes: 17 additions & 0 deletions css/style-1000-1299.css
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,23 @@ body.single-em_author .entry-header {
margin-left: 0;
}

img.size-full-post-width {
margin-left: -45px;
width: 620px;
}

img.size-half-post-width {
width: 310px;
}

img.size-half-post-width.alignleft {
margin-left: -45px;
}

img.size-half-post-width.alignright {
margin-right: -45px;
}

/* Issue archive page
----------------- */

Expand Down
18 changes: 18 additions & 0 deletions css/style-370-469.css
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,24 @@ body.full-size-header-image .entry-title {
margin-bottom: 0;
}

img.size-full-post-width {
margin-left: -20px;
width: 350px;
}

img.size-half-post-width {
width: 350px;
margin-right: 0;
}

img.size-half-post-width.alignleft {
margin-left: -20px;
}

img.size-half-post-width.alignright {
margin-right: -20px;
}

/* Issue archive page
----------------- */

Expand Down
17 changes: 17 additions & 0 deletions css/style-470-559.css
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,23 @@ body.full-size-header-image .entry-header {
margin-left: 17.5px;
}

img.size-full-post-width {
margin-left: -35px;
width: 450px;
}

img.size-half-post-width {
width: 225px;
}

img.size-half-post-width.alignleft {
margin-left: -35px;
}

img.size-half-post-width.alignright {
margin-right: -35px;
}

/* Issue archive page
----------------- */

Expand Down
17 changes: 17 additions & 0 deletions css/style-560-734.css
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,23 @@ body.full-size-header-image .entry-header {
margin-left: 30px;
}

img.size-full-post-width {
margin-left: -35px;
width: 540px;
}

img.size-half-post-width {
width: 270px;
}

img.size-half-post-width.alignleft {
margin-left: -35px;
}

img.size-half-post-width.alignright {
margin-right: -35px;
}

/* Issue archive page
----------------- */

Expand Down
17 changes: 17 additions & 0 deletions css/style-735-999.css
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,23 @@ body.full-size-header-image .entry-header {
height: 133.333px;
}

img.size-full-post-width {
margin-left: -35px;
width: 730px;
}

img.size-half-post-width {
width: 365px;
}

img.size-half-post-width.alignleft {
margin-left: -35px;
}

img.size-half-post-width.alignright {
margin-right: -35px;
}

/* Issue archive page
----------------- */

Expand Down
8 changes: 6 additions & 2 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
//* Child theme
define( 'CHILD_THEME_NAME', 'Evangelical Magazine Theme' );
define( 'CHILD_THEME_URL', 'http://www.evangelicalmagazine.com/' );
define( 'CHILD_THEME_VERSION', '0.82.1' );
define( 'CHILD_THEME_VERSION', '0.83' );

add_action ('wp', array ('evangelical_mag_theme', 'set_everything_up'));
add_filter ('intermediate_image_sizes_advanced', array ('evangelical_mag_theme', 'remove_default_image_sizes'));
Expand All @@ -33,12 +33,16 @@
add_image_size ('facebook_share', 1200, 630, true);
add_image_size ('twitter_share', 800, 400, true);
add_image_size ('article_header', 800, 400, true);
add_image_size ('full-post-width', 800);
add_image_size ('issue_very_large', 540, 762, true);
add_image_size ('article_very_large', 540, 360, true);
add_image_size ('article_large', 380, 253, true);
add_image_size ('half-post-width', 400);
add_image_size ('author_medium', 300, 300, true);
add_image_size ('issue_medium', 250, 359, true);
add_image_size ('article_small', 210, 140, true);
add_image_size ('issue_small', 150, 212, true);
add_image_size ('author_small', 113, 113, true);
add_image_size ('square_thumbnail_tiny', 75, 75, true);
add_image_size ('square_thumbnail_tiny', 75, 75, true);

add_filter ('image_size_names_choose', array ('evangelical_mag_theme', 'add_image_sizes_to_media_gallery'));
20 changes: 19 additions & 1 deletion style.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Theme URI: http://www.evangelicalmagazine.com
Description: Custom theme for the Evangelical Magazine
Author: Mark Barnes
Author URI: http://www.markbarnes.net/
Version: 0.82.1
Version: 0.83
Template: genesis
Template Version: 2.2.0
Tags: one-column, two-columns, three-columns, left-sidebar, right-sidebar, responsive-layout, custom-menu, full-width-template, rtl-language-support, sticky-post, theme-options, threaded-comments
Expand Down Expand Up @@ -1540,6 +1540,24 @@ body.full-size-header-image .entry-header {
margin-top: -30px;
}

img.size-full-post-width {
float: left;
margin-left: -60px;
width: 800px;
}

img.size-half-post-width {
width: 400px;
}

img.size-half-post-width.alignleft {
margin-left: -60px;
}

img.size-half-post-width.alignright {
margin-right: -60px;
}

/* ## Entry Meta
--------------------------------------------- */

Expand Down

0 comments on commit 26f1a8a

Please sign in to comment.