Browse Source

Ixion: Set a higher content width when any of the footer widget areas are active to account for galleries in the full-width footer. Remove defunct Jetpack filter function for tiled galleries. See #40

Caroline Moore 7 years ago
parent
commit
632bc027fd
2 changed files with 13 additions and 10 deletions
  1. 13 0
      ixion/functions.php
  2. 0 10
      ixion/inc/jetpack.php

+ 13 - 0
ixion/functions.php

@@ -94,6 +94,19 @@ function ixion_content_width() {
 }
 add_action( 'after_setup_theme', 'ixion_content_width', 0 );
 
+
+/**
+ * Set larger content width in some situations.
+ */
+function ixion_adjust_content_width() {
+
+	/* Allow for full-width gallery display in the footer */
+	if ( is_active_sidebar( 'sidebar-2' ) || is_active_sidebar( 'sidebar-3' ) || is_active_sidebar( 'sidebar-4' ) || is_active_sidebar( 'sidebar-5' ) ) {
+		$GLOBALS['content_width'] = 1080;
+	}
+}
+add_action( 'template_redirect', 'ixion_adjust_content_width' );
+
 /**
  * Return early if Custom Logos are not available.
  *

+ 0 - 10
ixion/inc/jetpack.php

@@ -117,13 +117,3 @@ function ixion_has_multiple_featured_posts() {
 function ixion_get_featured_posts() {
 	return apply_filters( 'ixion_get_featured_posts', false );
 }
-
-/**
- * Filter content width for galleries in widgets
- * to accomodate full-width footer widget areas
- */
-function ixion_custom_gallery_content_width() {
-    return 1080;
-}
-add_filter( 'gallery_widget_content_width', 'ixion_custom_gallery_content_width' );
-