Title: [217614] trunk/Websites/webkit.org
- Revision
- 217614
- Author
- [email protected]
- Date
- 2017-05-31 11:57:12 -0700 (Wed, 31 May 2017)
Log Message
Reduce Safari Technology Preview Release Notes posts shown on homepage
https://bugs.webkit.org/show_bug.cgi?id=172364
Reviewed by Daniel Bates.
* wp-content/themes/webkit/functions.php: Load some extra posts.
* wp-content/themes/webkit/widgets/post.php: Show STP blog posts when it is the current featured post.
Modified Paths
Diff
Modified: trunk/Websites/webkit.org/ChangeLog (217613 => 217614)
--- trunk/Websites/webkit.org/ChangeLog 2017-05-31 18:56:12 UTC (rev 217613)
+++ trunk/Websites/webkit.org/ChangeLog 2017-05-31 18:57:12 UTC (rev 217614)
@@ -1,3 +1,13 @@
+2017-05-31 Jon Davis <[email protected]>
+
+ Reduce Safari Technology Preview Release Notes posts shown on homepage
+ https://bugs.webkit.org/show_bug.cgi?id=172364
+
+ Reviewed by Daniel Bates.
+
+ * wp-content/themes/webkit/functions.php: Load some extra posts.
+ * wp-content/themes/webkit/widgets/post.php: Show STP blog posts when it is the current featured post.
+
2017-05-18 Jon Davis <[email protected]>
Add an Accessibility icon to webkit.org
Modified: trunk/Websites/webkit.org/wp-content/themes/webkit/functions.php (217613 => 217614)
--- trunk/Websites/webkit.org/wp-content/themes/webkit/functions.php 2017-05-31 18:56:12 UTC (rev 217613)
+++ trunk/Websites/webkit.org/wp-content/themes/webkit/functions.php 2017-05-31 18:57:12 UTC (rev 217614)
@@ -419,7 +419,7 @@
self::$object = new self;
if ( empty(self::$wp_query) )
- self::$wp_query = new WP_Query(array('post_type' => 'post'));
+ self::$wp_query = new WP_Query(array('post_type' => 'post', 'posts_per_page' => 16));
return self::$object;
}
Modified: trunk/Websites/webkit.org/wp-content/themes/webkit/widgets/post.php (217613 => 217614)
--- trunk/Websites/webkit.org/wp-content/themes/webkit/widgets/post.php 2017-05-31 18:56:12 UTC (rev 217613)
+++ trunk/Websites/webkit.org/wp-content/themes/webkit/widgets/post.php 2017-05-31 18:57:12 UTC (rev 217614)
@@ -22,14 +22,23 @@
}
public function widget( array $args, array $options ) {
-
$Query = $this->load($options);
// Get the next post, if available
if ( ! $Query->have_posts() ) return;
+
// Queue the post data
$Query->the_post();
+ $featured = ( 'on' == $options['featured'] );
+ if ( ! $featured ) {
+ // Prevent Safari Technology Preview release note posts from showing up when not a featured post.
+ while ( in_category('safari-technology-preview') && $Query->have_posts() ) {
+ $Query->the_post();
+ continue;
+ }
+ }
+
if ( ! empty($args) )
extract($args, EXTR_SKIP);
@@ -40,12 +49,9 @@
$image = '';
if ( $post_thumbnail_id = get_post_thumbnail_id() ) {
$post_thumbnail_url = wp_get_attachment_url( $post_thumbnail_id );
- // $image = " style=\"background-image: url('" . $post_thumbnail_url . "')\"";
$image = " data-url="" . $post_thumbnail_url . "\"";
}
- $featured = ( 'on' == $options['featured'] );
-
$classes = array('tile');
if ( $featured ) {
$classes[] = 'featured-tile';
@@ -90,7 +96,6 @@
<input type="checkbox" name="<?php echo $this->get_field_name('featured'); ?>" id="<?php echo $this->get_field_id('featured'); ?>" class="widefat" value="on" <?php echo ( 'on' == $options['featured'] ) ? 'checked' : ''; ?>>
<?php _e('Featured'); ?></label>
</p>
-
<?php
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes