Skip to content

Commit

Permalink
Merge pull request #2179 from CityOfPhiladelphia/correct-posts-image-…
Browse files Browse the repository at this point in the history
…size

Correct posts image size
  • Loading branch information
karissademi authored Sep 23, 2024
2 parents 321d576 + b20ef32 commit c12f070
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 33 deletions.
12 changes: 1 addition & 11 deletions wp/wp-content/themes/phila.gov-theme/css/scss/_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -201,14 +201,4 @@ caption {
margin-bottom: 0px !important;
}
}
}

// for 1440px width DD
// .grid-container, .row{
// max-width: 90rem;
// }

// a.card img {
// width: 820px;
// height: auto;
// }
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
margin: $spacing-large auto;
img{
margin: 0 auto;
width: 100%;
}
@include breakpoint(small only) {
padding:0;
Expand Down Expand Up @@ -290,13 +291,13 @@
a {
text-decoration: underline !important;
}

.interact-311 {
a {
text-decoration: none !important;
}
}

h3 {
font-weight: 600 !important;
font-size: 1.429rem !important;
Expand All @@ -308,15 +309,15 @@
font-size: 2rem !important;
}
}

.medium-8.columns.phm {
margin: 0;
h2{
font-weight: 600 !important;
font-size: 1.2rem !important;
}
}

.fat {
.columns {
&.medium-8 {
Expand Down
23 changes: 8 additions & 15 deletions wp/wp-content/themes/phila.gov-theme/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -489,8 +489,6 @@ function phila_get_thumbnails(){
$thumbs = array(
'0' => 'medium',
'1' => 'phila-thumb',
'2' => 'home-thumb',
'3' => 'news-thumb'
);
$output = '';
foreach ($thumbs as $key => $value) {
Expand All @@ -503,12 +501,7 @@ function phila_get_thumbnails(){
}else if ($image[1] == 660 && $image[2] == 430 ) {
$output .= get_the_post_thumbnail( $post=null, 'phila-thumb' );
break;
}else if ( $image[1] == 550 && $image[2] == 360 ){
$output .= get_the_post_thumbnail( $post=null, 'home-thumb' );
break;
}elseif ( $image[1] == 250 && $image[2] == 165 ) {
$output .= get_the_post_thumbnail( $post=null, 'news-thumb' );
break;

}
}
return $output;
Expand Down Expand Up @@ -894,7 +887,7 @@ function phila_is_department_homepage( $post ) {
function phila_get_current_department_name( $category, $byline = false, $break_tags = false, $name_list = false ){


if( !empty( $category ) && $category[0]->slug != 'uncategorized' ) {
if( !empty( $category ) && $category[0]->slug != 'uncategorized' ) {

$cat_name = array();
$cat_ids = array();
Expand All @@ -908,7 +901,7 @@ function phila_get_current_department_name( $category, $byline = false, $break_t
foreach( $category as $cat ){
array_push( $cat_name, $cat->name );
array_push( $cat_ids, $cat->cat_ID );
}
}

$cat_id_string = implode( ', ', $cat_ids );

Expand Down Expand Up @@ -936,7 +929,7 @@ function phila_get_current_department_name( $category, $byline = false, $break_t

if ( !$is_parent || $is_in_govt_dir) {

$all_available_pages[$permalink] = $the_title;
$all_available_pages[$permalink] = $the_title;

}
}
Expand All @@ -946,7 +939,7 @@ function phila_get_current_department_name( $category, $byline = false, $break_t

if ( $byline == true ) {
echo ' by ';
}
}

foreach ( $all_available_pages as $k => $v ){

Expand Down Expand Up @@ -2226,7 +2219,7 @@ function inject_translation_slug($language)
$default_lang = 'en';
$language_codes = array('zh', 'es','ar', 'fr', 'ru', 'ms', 'hi', 'pt', 'bn', 'id', 'sw', 'ja', 'de', 'ko', 'it', 'fa', 'tr', 'nl', 'te', 'vi', 'ht');
$new_path_segments = array();

foreach ($path_segments as $segment) {
if (!in_array($segment, $language_codes)) {
$new_path_segments[] = $segment;
Expand Down Expand Up @@ -2326,7 +2319,7 @@ function add_html_lang_attribute($output) {
$lang = empty(rwmb_meta('phila_select_language')) ? 'en' : rwmb_meta('phila_select_language');
$language_code = phila_return_language_code($lang);
$attributes[] = 'lang="' . $language_code . '"';

$output = implode(' ', $attributes);
return $output;
}
Expand All @@ -2345,7 +2338,7 @@ function add_html_lang_attribute($output) {
// 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
// 'docx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
// 'ppt' => 'application/vnd.ms-powerpoint',
// 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
// 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
// 'pages' => 'application/vnd.apple.pages',
// 'numbers' => 'application/vnd.apple.numbers',
// 'csv' => 'text/csv',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<article id="post-<?php the_ID(); ?>" <?php post_class('full-height'); ?>>
<a href="<?php echo the_permalink(); ?>" class="card card--<?php echo $label_arr['label'] ?> flex-container flex-dir-row full-height">
<div class="grid-x flex-dir-column">
<div class="flex-child-shrink">
<div class="flex-child-grow">
<?php if ( has_post_thumbnail() ) : ?>
<?php echo phila_get_thumbnails(); ?>
<?php endif; ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@
</div>
</div>
<?php else : ?>
<div class="lightbox-link lightbox-link--feature" data-open="phila-lightbox-feature">
<div class="lightbox-link lightbox-link--feature flex-child-auto" data-open="phila-lightbox-feature">
<?php echo phila_get_thumbnails(); ?>
<?php $image_caption = get_post(get_post_thumbnail_id())->post_excerpt; ?>
<?php $image_credit = get_post_meta(get_post_thumbnail_id())['phila_media_credit'][0]; ?>
<?php $image_credit = isset(get_post_meta(get_post_thumbnail_id())['phila_media_credit'][0]) ? get_post_meta(get_post_thumbnail_id())['phila_media_credit'][0] : ''; ?>
<?php if ($image_caption || $image_credit) { ?>
<div class="phila-image-caption pam">
<?php if ($image_credit) { ?>
Expand Down

0 comments on commit c12f070

Please sign in to comment.