Skip to content

Commit

Permalink
Merge pull request #301 from wikitongues/main
Browse files Browse the repository at this point in the history
Staging deploy
  • Loading branch information
FredericoAndrade authored Feb 4, 2025
2 parents 55cc0fe + d3a5227 commit 49d4e8b
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -584,8 +584,8 @@
"sub_fields": [
{
"key": "field_67a2242b68bad",
"label": "Text",
"name": "text",
"label": "Text Area",
"name": "text_area",
"aria-label": "",
"type": "wysiwyg",
"instructions": "",
Expand Down Expand Up @@ -677,5 +677,5 @@
"active": true,
"description": "",
"show_in_rest": 0,
"modified": 1738686115
"modified": 1738687505
}
Original file line number Diff line number Diff line change
Expand Up @@ -448,5 +448,5 @@
"active": true,
"description": "",
"show_in_rest": 0,
"modified": 1738686139
"modified": 1738687181
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php
echo '<section class="main-content">';
echo wpautop(wp_kses_post(get_sub_field('text_area')));
echo '</section>';
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
$video = get_sub_field('video');
$video_title = get_sub_field('video_title');
$dropbox_link_raw = str_replace("dl=0", "raw=1", $video);
if ( $dropbox_link_raw ) {
?>
<div class="wt_single-videos__embed">
<video width="320" height="240" controls>
<source src="<?php echo $dropbox_link_raw ?>" type="video/mp4">Your browser does not support the video tag.
</video>
<?php
if ( $video_title ) {
echo '<h3>' . $video_title . '</h3>';
};
echo '</div>';
};
14 changes: 2 additions & 12 deletions wp-content/themes/blankslate-child/single-fellows.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,12 @@
if( have_rows('main_content') ):
while( have_rows('main_content') ) : the_row();

// Determine the current layout.
$layout = get_row_layout();

// Load a partial based on the layout.
if( $layout == 'text_layout' ):
// get_template_part('template-parts/flexible/hero');
echo '<section class="main-content">';
echo wpautop(wp_kses_post(get_sub_field('text')));
echo '</section>';

include( 'modules/flexible-content--text-layout.php' );
elseif( $layout == 'video_layout' ):
$fellow_video = get_sub_field('video');
$dropbox_link_raw = str_replace("dl=0", "raw=1", $fellow_video);
if ( $dropbox_link_raw ) {
echo '<div class="wt_single-videos__embed"><video width="320" height="240" controls><source src="'. $dropbox_link_raw .'" type="video/mp4">Your browser does not support the video tag.</video></div>';
}
include( 'modules/flexible-content--video-layout.php' );
endif;

endwhile;
Expand Down
1 change: 1 addition & 0 deletions wp-content/themes/blankslate-child/stylus/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -2134,6 +2134,7 @@ body.single-videos .wt_header__nav>ul>li:first-of-type:hover .sub-menu {
.wt_single-videos__embed {
width: 1140px;
margin: 0 auto 6.4rem;
border-radius: 4px;
}
.wt_single-videos__embed h3 {
text-align: left;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ $video_size = (9/16)*100 // in viewport widths
&__embed
width $content
margin 0 auto 6.4rem
border-radius 4px

h3
text-align left
Expand Down
25 changes: 3 additions & 22 deletions wp-content/themes/blankslate-child/template-editorial.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,12 @@

// Load a partial based on the layout.
if( $layout == 'text_layout' ):
// get_template_part('template-parts/flexible/hero');
echo '<section class="main-content">';
echo wpautop(wp_kses_post(get_sub_field('text_area')));
echo '</section>';

include( 'modules/flexible-content--text-layout.php' );
elseif( $layout == 'banner_layout' ):
$page_banner = get_sub_field('banner');
include( 'modules/banner--main.php' );

elseif( $layout == 'video_layout' ):
include( 'modules/flexible-content--video-layout.php' );
elseif( $layout == 'gallery_layout' ):
if ( have_rows( 'custom_gallery_posts' ) ) {
while ( have_rows( 'custom_gallery_posts') ) {
Expand Down Expand Up @@ -49,22 +46,6 @@
echo create_gallery_instance($params);
}
};
elseif( $layout == 'video_layout' ):
$video = get_sub_field('video');
$video_title = get_sub_field('video_title');
$dropbox_link_raw = str_replace("dl=0", "raw=1", $video);
if ( $dropbox_link_raw ) {
?>
<div class="wt_single-videos__embed">
<video width="320" height="240" controls>
<source src="<?php echo $dropbox_link_raw ?>" type="video/mp4">Your browser does not support the video tag.
</video>
<?php
if ( $video_title ) {
echo '<h3>' . $video_title . '</h3>';
};
echo '</div>';
};
endif;

endwhile;
Expand Down

0 comments on commit 49d4e8b

Please sign in to comment.