Browse Source

tweak studio

windhamdavid 3 years ago
parent
commit
72e9987966
2 changed files with 67 additions and 16 deletions
  1. 15 15
      inc/tweaks.php
  2. 52 1
      page-studio.php

+ 15 - 15
inc/tweaks.php

@@ -174,21 +174,21 @@ function doctype_opengraph($output) {
 add_filter('language_attributes', 'doctype_opengraph');
 
 function dw_opengraph() {
-    global $post;
-    if (is_single()) {
-      if (has_post_thumbnail($post->ID)) {
-        $img_src = wp_get_attachment_image_src(get_post_thumbnail_id( $post->ID ), 'full'); $img_src = $img_src[0];
-      } elseif ( metadata_exists( 'post', get_the_ID(), 'featured_image_url' ) ){
-        $img_src = get_post_meta( get_the_ID(), 'featured_image_url', true );
-      } else {
-        $img_src = get_stylesheet_directory_uri() . '/img/opengraph_image.jpg';
-      }
-      if($excerpt = $post->post_excerpt) {
-        $excerpt = strip_tags($post->post_excerpt);
-        $excerpt = str_replace("", "'", $excerpt);
-      } else {
-        $excerpt = get_bloginfo('description');
-      }
+  global $post;
+  if (is_single()) {
+    if (has_post_thumbnail($post->ID)) {
+      $img_src = wp_get_attachment_image_src(get_post_thumbnail_id( $post->ID ), 'full'); $img_src = $img_src[0];
+    } elseif ( metadata_exists( 'post', get_the_ID(), 'featured_image_url' ) ){
+      $img_src = get_post_meta( get_the_ID(), 'featured_image_url', true );
+    } else {
+      $img_src = get_stylesheet_directory_uri() . '/img/opengraph_image.jpg';
+    }
+    if($excerpt = $post->post_excerpt) {
+      $excerpt = strip_tags($post->post_excerpt);
+      $excerpt = str_replace("", "'", $excerpt);
+    } else {
+      $excerpt = get_bloginfo('description');
+    }
 ?>
   <meta property="og:title" content="<?php echo the_title(); ?>"/>
   <meta property="og:description" content="<?php echo $excerpt; ?>"/>

+ 52 - 1
page-studio.php

@@ -267,7 +267,7 @@
 			<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
 			<div class="col-sm-4">
 				<div class="studio-thumbnail">
-					<?php $img_url = wp_get_attachment_image_src(get_post_thumbnail_id(),'medium'); ?>
+					<?php $img_url = wp_get_attachment_image_src(get_post_thumbnail_id(),'studio'); ?>
 					<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 $img_url[0];?>" width="100%" alt="<?php the_title(); ?>"/></a>
 				</div>
 				<article class="studio">
@@ -330,6 +330,57 @@
 			</div>
 			<?php endwhile; ?>
 		</div>
+		<div class="row">
+			<?php query_posts('category_name=studio&offset=12&showposts=3'); ?>
+			<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
+			<div class="col-sm-4">
+				<div class="studio-thumbnail">
+					<?php $img_url = wp_get_attachment_image_src(get_post_thumbnail_id(),'studio'); ?>
+					<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 $img_url[0];?>" width="100%" alt="<?php the_title(); ?>"/></a>
+				</div>
+				<article class="studio">
+					<div class="entry-content">
+						<h4 class="tight"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( '%s', 'daw' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h4>
+						<?php dw_good_excerpt(110); ?>
+					</div>
+				</article>
+			</div>
+			<?php endwhile; ?>
+		</div>
+		<div class="row">
+			<?php query_posts('category_name=studio&offset=15&showposts=3'); ?>
+			<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
+			<div class="col-sm-4">
+				<div class="studio-thumbnail">
+					<?php $img_url = wp_get_attachment_image_src(get_post_thumbnail_id(),'studio'); ?>
+					<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 $img_url[0];?>" width="100%" alt="<?php the_title(); ?>"/></a>
+				</div>
+				<article class="studio">
+					<div class="entry-content">
+						<h4 class="tight"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( '%s', 'daw' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h4>
+						<?php dw_good_excerpt(110); ?>
+					</div>
+				</article>
+			</div>
+			<?php endwhile; ?>
+		</div>
+		<div class="row">
+			<?php query_posts('category_name=studio&offset=18&showposts=3'); ?>
+			<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
+			<div class="col-sm-4">
+				<div class="studio-thumbnail">
+					<?php $img_url = wp_get_attachment_image_src(get_post_thumbnail_id(),'studio'); ?>
+					<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 $img_url[0];?>" width="100%" alt="<?php the_title(); ?>"/></a>
+				</div>
+				<article class="studio">
+					<div class="entry-content">
+						<h4 class="tight"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( '%s', 'daw' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h4>
+						<?php dw_good_excerpt(110); ?>
+					</div>
+				</article>
+			</div>
+			<?php endwhile; ?>
+		</div>
 	</div>
 
 <?php get_footer('home'); ?>