Browse Source

Lodestar: Portfolio page template displays at a wider width than the theme expects. Fixes: #259

Allan Cole 6 years ago
parent
commit
5207afe88a
1 changed files with 10 additions and 0 deletions
  1. 10 0
      lodestar/inc/extras.php

+ 10 - 0
lodestar/inc/extras.php

@@ -94,3 +94,13 @@ function lodestar_is_frontpage() {
 		return false;
 	endif;
 }
+
+/**
+ * Adjust content_width value for portfolio page template.
+ */
+function lodestar_portfolio_content_width() {
+	if ( is_page_template( 'templates/portfolio-page.php' ) ) {
+		$GLOBALS['content_width'] = 1120;
+	}
+}
+add_action( 'template_redirect', 'lodestar_portfolio_content_width' );