浏览代码

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

Allan Cole 6 年之前
父节点
当前提交
5207afe88a
共有 1 个文件被更改,包括 10 次插入0 次删除
  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' );