Browse Source

feat: move studio projects to a /studio/projects child page

Extract the studio-category post grid out of page-studio.php into its own
page-projects.php template. Created the WP page 'Projects' (ID 3876) as a child
of Studio (1198), so it resolves at /studio/projects/. page-studio.php now ends
after the tab section — clearing it for the rework.

(The WP page itself lives in the DB, not git.)
windhamdavid 2 days ago
parent
commit
a6b50b4365
2 changed files with 38 additions and 31 deletions
  1. 38 0
      page-projects.php
  2. 0 31
      page-studio.php

+ 38 - 0
page-projects.php

@@ -0,0 +1,38 @@
+<?php
+/*
+ * Template for the Studio → Projects child page (/studio/projects).
+ * Lists every post in the `studio` category (moved off page-studio.php).
+ */
+get_header(); ?>
+<div class="container leader">
+	<div class="row mt-5">
+		<h1><em><?php the_title(); ?></em></h1>
+	</div>
+	<div class="row">
+    <?php $i = 0; $query = new WP_Query( array( 'category_name' => 'studio', 'posts_per_page' => -1 ) ); while ( $query->have_posts() ) : $query->the_post(); ?>
+			<div class="col-lg-3">
+				<div class="studio-thumbnail">
+          <?php
+            if ( has_post_thumbnail() ) {
+              $img_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'studio' );
+            } else {
+              $img_url = get_post_meta( get_the_ID(), 'featured_image_url' );
+            }
+          ?>
+					<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( '%s', 'daw' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><img class="studio-thumb" src="<?php echo esc_url( $img_url[0] ?? '' ); ?>" width="100%" alt="<?php the_title(); ?>"/></a>
+				</div>
+				<article class="studio">
+					<div class="entry-content">
+						<h5><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( '%s', 'daw' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h5>
+						<?php dw_good_excerpt( 110 ); ?>
+					</div>
+				</article>
+			</div>
+    <?php if ( ( ++$i % 4 ) == 0 ) : ?>
+    </div>
+    <div class="row">
+    <?php endif; ?>
+    <?php endwhile; wp_reset_postdata(); $i++; ?>
+  	</div>
+</div>
+<?php get_footer( 'home' ); ?>

+ 0 - 31
page-studio.php

@@ -308,35 +308,4 @@
 			</div>
 		</div>
 	</div>
-	<div class="container">
-		<div class="row mt-5">
-			<h4><em>Projects</em></h4>
-		</div>
-		<div class="row">
-    <?php $i = 0; $query = new WP_Query(array('category_name' => 'studio', 'posts_per_page' => -1));  while ( $query->have_posts() ) : $query->the_post(); ?>
-			<div class="col-lg-3">
-				<div class="studio-thumbnail">
-          <?php
-            if (has_post_thumbnail()) {
-              $img_url = wp_get_attachment_image_src(get_post_thumbnail_id(), 'studio');
-            } else {
-              $img_url = get_post_meta( get_the_ID(), 'featured_image_url');
-            }
-          ?>
-					<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( '%s', 'daw' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><img class="studio-thumb" src="<?php echo esc_url( $img_url[0] ?? '' );?>" width="100%" alt="<?php the_title(); ?>"/></a>
-				</div>
-				<article class="studio">
-					<div class="entry-content">
-						<h5><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( '%s', 'daw' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h5>
-						<?php dw_good_excerpt(110); ?>
-					</div>
-				</article>
-			</div>
-    <?php if((++$i % 4) == 0): ?>
-    </div>
-    <div class="row">
-    <?php endif; ?>
-    <?php endwhile; $i++;?>
-  	</div>
-  </div>
 <?php get_footer('home'); ?>