From 19c8aa56045176a0e68676d3a284aa3a4699dc0f Mon Sep 17 00:00:00 2001 From: FredericoAndrade Date: Mon, 19 Aug 2024 19:32:21 +0200 Subject: [PATCH 1/7] display banner image captions --- modules/banner--main.php | 1 + stylus/main.css | 13 +++++++++++++ stylus/require/banner--main.styl | 8 ++++++++ 3 files changed, 22 insertions(+) diff --git a/modules/banner--main.php b/modules/banner--main.php index 808636e3..81959e31 100644 --- a/modules/banner--main.php +++ b/modules/banner--main.php @@ -37,6 +37,7 @@ +

diff --git a/stylus/main.css b/stylus/main.css index 88a433b2..0a771ce9 100644 --- a/stylus/main.css +++ b/stylus/main.css @@ -543,6 +543,19 @@ body.home .wt_banner { margin-left: 0.5rem; font-size: 1.6rem; } +.wt_banner p.caption { + position: absolute; + bottom: 0; + margin: 16px; + white-space: pre; + font-family: 'Graphik Web'; + font-weight: 700; + font-style: normal; + font-stretch: normal; + font-size: 1.6rem; + line-height: 1.3; + color: #fffcef; +} @media all and (max-height: 699px) and (orientation: landscape) { .wt_banner { height: calc(100vh / 5 * 3); diff --git a/stylus/require/banner--main.styl b/stylus/require/banner--main.styl index d296cb6f..08fc6cd4 100644 --- a/stylus/require/banner--main.styl +++ b/stylus/require/banner--main.styl @@ -50,6 +50,14 @@ body i margin-left 0.5rem font-size 1.6rem + + p.caption + position absolute + bottom 0 + margin 16px + white-space pre + text--strong($parchment) + @media all and (max-height:$shortScreen) and (orientation:landscape) .wt_banner From d9f56c74b1c2c62b21434b599e6d6f103c1ad555 Mon Sep 17 00:00:00 2001 From: FredericoAndrade Date: Thu, 15 Aug 2024 14:22:29 +0200 Subject: [PATCH 2/7] update readme --- readme.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/readme.md b/readme.md index 61f0df9a..558d70ee 100644 --- a/readme.md +++ b/readme.md @@ -75,6 +75,12 @@ This project uses [Stylus](https://stylus-lang.com/), a CSS pre-processor. Stylus needs to be compiled into CSS before it is usable in HTML. To run the compiler, run `stylus -w stylus` in the terminal. +# Plugins + +**Typeahead Search** +This project uses a React search component maintained in a [separate repository](https://github.com/wikitongues/typeahead/tree/main). +To update the component in this wordpress project, you'll have to update the /build/ directory from the component into the plugin directory here. This applies separately for integration, staging and production environments. Consider using `rsync` to facilitate the distribution. Additionally, the plugin has a PHP file that is not currently tracked on Git due to this repository being only a subset of the full installation. We may want to change this later. + # To-Do ## Code structure and styles @@ -89,6 +95,7 @@ To run the compiler, run `stylus -w stylus` in the terminal. ## global - [] bug on search page title - title has first matching language iso (`Wikitongues | niv`) despite being search route (`?s=russian`). +- [] track entire wordpress instance in git to capture plugin-specific (typeahead) changes - [] add alert banner and display only if user hasn't visited the site in a week - [] build captions post type - [] build single page template for partners post type From d489aed58ccd970f9ead74a880215fd0cab3dddb Mon Sep 17 00:00:00 2001 From: FredericoAndrade Date: Thu, 22 Aug 2024 18:39:38 +0200 Subject: [PATCH 3/7] clean up header styles --- footer.php | 4 +- header.php | 338 ++++++++++------------------- modules/page--head.php | 112 ++++++++++ stylus/main.css | 85 ++++---- stylus/require/banner--main.styl | 4 +- stylus/require/header.styl | 228 ++++++++++--------- stylus/require/search-results.styl | 2 +- 7 files changed, 391 insertions(+), 382 deletions(-) create mode 100644 modules/page--head.php diff --git a/footer.php b/footer.php index a1ea0e61..85f7d8cb 100644 --- a/footer.php +++ b/footer.php @@ -46,4 +46,6 @@ - \ No newline at end of file + + + \ No newline at end of file diff --git a/header.php b/header.php index 1921ace7..d11523e3 100644 --- a/header.php +++ b/header.php @@ -21,233 +21,121 @@ ?> -> - - - - - - - - - - - - - - - - - - - - - <?php - if ( $seo_title ) { - // use title from SEO CRM, if available - echo $seo_title; - - } else if ( is_archive() ) { - // grab archived post type - $archive_post_type = get_queried_object(); - - // title page based on archived post type - echo 'Wikitongues | ' . $archive_post_type->labels->name; - - } else { - // use the default page title - echo 'Wikitongues' . ' | ' . get_the_title(); - - } ?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - data-alert="true"> - - - - - - - 86400 ) { - // include( 'modules/banner--alert.php' ); - //} - - if ( $banner_alert_status === 'active' ) { - include( 'modules/banner--alert.php' ); - } - - ?> - - - \ No newline at end of file diff --git a/modules/page--head.php b/modules/page--head.php new file mode 100644 index 00000000..b9e3daa6 --- /dev/null +++ b/modules/page--head.php @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + <?php + if ( $seo_title ) { + // use title from SEO CRM, if available + echo $seo_title; + + } else if ( is_archive() ) { + // grab archived post type + $archive_post_type = get_queried_object(); + + // title page based on archived post type + echo 'Wikitongues | ' . $archive_post_type->labels->name; + + } else { + // use the default page title + echo 'Wikitongues' . ' | ' . get_the_title(); + + } ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/stylus/main.css b/stylus/main.css index 0a771ce9..d94eca9f 100644 --- a/stylus/main.css +++ b/stylus/main.css @@ -73,7 +73,6 @@ body { max-width: 1800px; margin: auto; box-shadow: 0 0 100px rgba(0,0,0,0.05); - padding-top: 122.63px; background: #fffcef; } body[data-alert="true"] { @@ -82,9 +81,6 @@ body[data-alert="true"] { body[data-alert="true"] .wt_header { top: 72px !important; } -body.logged-in { - padding-top: 154.63px !important; -} body.logged-in .wt_header { top: 32px !important; } @@ -97,37 +93,33 @@ body.logged-in[data-alert="true"] .wt_banner-alert__container { body.logged-in[data-alert="true"] .wt_header { top: 104px !important; } -body.home { - padding-top: 0 !important; -} -body.home.logged-in { - padding-top: 32px !important; +body.page-template-template-archive-home { + padding-top: 96px; } -body.home.logged-in .wt_header { - top: 32px !important; +body.page-template-template-archive-home.logged-in { + margin-top: 128px !important; } -body.page-template-template-giving-campaign { - padding-top: 131.63px !important; +body.home, +body.page-id-15577 { + padding-top: 0; } -body.page-template-template-giving-campaign.logged-in { - padding-top: 91.63px !important; +body.home .wt_header__primary, +body.page-id-15577 .wt_header__primary { + padding: 10px; } -body.page-template-template-giving-campaign.logged-in[data-alert="true"] { - padding-top: 163.63px !important; +body.home.logged-in .wt_header, +body.page-id-15577.logged-in .wt_header { + top: 32px !important; } .wt_header { z-index: 10; display: flex; - flex-direction: row; + flex-direction: column; align-items: center; position: fixed; top: 0; - left: 50%; - transform: translateX(-50%); width: 100%; max-width: 1800px; - height: 60px; - padding: 0 1.5rem; box-sizing: border-box; background: #fffcef; transition-property: background; @@ -143,6 +135,11 @@ body.page-template-template-giving-campaign.logged-in[data-alert="true"] { .wt_header.transparent-background .wt_header__searchbar input[type="search"] { background: #fffcef; } +.wt_header__primary { + display: flex; + width: 100%; + padding: 10px 10px 0; +} .wt_header__logo { flex-grow: initial; } @@ -186,14 +183,8 @@ body.page-template-template-giving-campaign.logged-in[data-alert="true"] { display: none !important; } } -.wt_header--secondary { - z-index: 2; - position: fixed; - top: 60px; - left: 0; +.wt_header__secondary { width: 100%; - background: #fff; - border-top: 6px solid #3814a5; } .wt_header__nav { z-index: inherit; @@ -229,7 +220,7 @@ body.page-template-template-giving-campaign.logged-in[data-alert="true"] { } .wt_header__nav>ul>li { position: relative; - margin-left: 1.25rem; + margin-left: 1.3rem; display: inline-block; padding: 1.25rem 1.5rem; background: #fffcef; @@ -312,24 +303,18 @@ body.page-template-template-giving-campaign.logged-in[data-alert="true"] { .wt_header__nav--secondary { z-index: 2; text-align: center; - padding: 20px 3rem; } -.wt_header__nav--secondary li { +.wt_header__nav--secondary ul { + padding: 0 0 10px; +} +.wt_header__nav--secondary ul li { display: inline-block; margin: 0 0 0 3rem; } -.wt_header__nav--secondary li:first-of-type a { - color: #101010; -} -.wt_header__nav--secondary li:first-of-type a:hover { - cursor: default; -} -.wt_header__nav--secondary li:first-of-type:after { - content: ''; - margin-left: 3rem; - border-right: 1px #dcdcdc solid; +.wt_header__nav--secondary ul li.current_page_item a { + font-weight: bold; } -.wt_header__nav--secondary li a { +.wt_header__nav--secondary ul li a { font-family: 'Graphik Web'; font-weight: 400; font-style: normal; @@ -337,9 +322,13 @@ body.page-template-template-giving-campaign.logged-in[data-alert="true"] { font-size: 1.6rem; line-height: 1.3; color: #3814a5; - font-size: 1.28rem !important; + font-size: 1.3rem !important; text-decoration: none; - text-transform: uppercase; + padding: 10px; + display: inline-block; +} +.wt_header__nav--secondary ul li a:hover { + cursor: pointer; } .wt_header__mobile-buttons { display: none; @@ -472,7 +461,8 @@ body.home .wt_banner { width: 100%; height: calc(100vh / 5 * 2); margin-bottom: 6rem; - padding-top: 80px; + padding-top: 120px; + padding-bottom: 80px; box-sizing: content-box; background-position: center; background-size: cover; @@ -493,6 +483,7 @@ body.home .wt_banner { right: 5%; transform: translateY(-50%); width: 45rem; + margin-top: 80px; } .wt_banner__copy--mobile { display: none; @@ -1203,7 +1194,7 @@ body.search-results .wt_banner--searchbar { color: #979797; } body.search-results .wt_header__nav>ul>li:first-of-type { - background: #fff !important; + background: #fffcef !important; } body.search-results .wt_header__nav>ul>li:first-of-type>a { color: #3814a5 !important; diff --git a/stylus/require/banner--main.styl b/stylus/require/banner--main.styl index 08fc6cd4..47b63314 100644 --- a/stylus/require/banner--main.styl +++ b/stylus/require/banner--main.styl @@ -8,7 +8,8 @@ body width 100% height calc(100vh/5*2) margin-bottom 6rem - padding-top 80px + padding-top 120px + padding-bottom 80px box-sizing content-box background-position center background-size cover @@ -29,6 +30,7 @@ body right 5% transform translateY(-50%) width 45rem + margin-top 80px &--mobile display none diff --git a/stylus/require/header.styl b/stylus/require/header.styl index ca805eac..e0babb81 100644 --- a/stylus/require/header.styl +++ b/stylus/require/header.styl @@ -2,100 +2,115 @@ body max-width 1800px margin auto box-shadow 0 0 100px rgba(0,0,0,.05) - padding-top 122.63px + // padding-top 122.63px background $parchment - + &[data-alert="true"] padding-top 194.63px - + .wt_header top 72px !important - + &.logged-in - padding-top 154.63px !important - + // padding-top 154.63px !important + .wt_header top 32px !important - + &[data-alert="true"] padding-top 226.63px !important - + .wt_banner-alert__container top 32px !important .wt_header top 104px !important - + // consider moving these to page-specific style templates - &.home - padding-top 0 !important - + &.page-template-template-archive-home + padding-top 96px + &.logged-in + margin-top 128px !important + + &.home, + &.page-id-15577 + padding-top 0 + + .wt_header + &__primary + padding 10px + &.logged-in - padding-top 32px !important - + // padding-top 32px !important + .wt_header top 32px !important - - &.page-template-template-giving-campaign - padding-top 131.63px !important - - &.logged-in - padding-top 91.63px !important - - &[data-alert="true"] - padding-top 163.63px !important - + + // &.page-template-template-giving-campaign + // padding-top 131.63px !important + + // &.logged-in + // // padding-top 91.63px !important + + // &[data-alert="true"] + // padding-top 163.63px !important + .wt_header z-index 10 display flex - flex-direction row + flex-direction column align-items center position fixed top 0 - left 50% - transform translateX(-50%) + // left 50% + // transform translateX(-50%) width 100% max-width 1800px - height 60px - padding 0 1.5rem + // height 60px + // padding 0 1.5rem box-sizing border-box background $parchment transition-property background transition-duration 0.3s transition-timing-function cubic-bezier(0.16, 1, 0.3, 1); - + &.transparent-background background none transition-property background transition-duration 0.3s transition-timing-function cubic-bezier(0.16, 1, 0.3, 1); - + .wt_header__searchbar input[type="search"] background $parchment - + + &__primary + display flex + width 100% + padding 10px 10px 0 + &__logo flex-grow initial - + &--light display none - + &.transparent-background display block !important - + &--dark display block - + &.transparent-background display none !important - + img height 40px width auto - - + + #typeahead_nav - .typeahead-form + .typeahead-form input border none width 330px @@ -103,14 +118,14 @@ body &:active, &:focus - width 400px + width 400px background $parchment transition-property background, width transition-duration 0.6s transition-timing-function cubic-bezier(0.16, 1, 0.3, 1); - + .typeahead-list - width 400px + width 400px border-radius 8px outline 2px solid #3814a5 z-index 3 @@ -119,15 +134,16 @@ body #typeahead_nav.react-typeahead-container display none !important - &--secondary - z-index 2 - position fixed - top 60px - left 0 + &__secondary + // z-index 2 + // position fixed + // top 60px + // left 0 width 100% - background $white - border-top 6px solid $blue - + // padding 10px 3rem 20px + // background $white + // border-top 1px solid $blue + &__nav z-index inherit margin-left auto @@ -145,40 +161,40 @@ body visibility hidden transition opacity 0.2s ease, visibility 0.2s ease z-index 1 - + &.visible opacity 1 visibility visible &--mobile display none - + &.transparent-background &>ul>li background $parchment border none !important - + &>a color $blue - + &>ul>li position relative - margin-left 1.25rem + margin-left 1.3rem button--small($parchment, $blue) border none border-radius 8px text-transform initial padding 0 z-index 0 - + &.current_page_item, &.current_page_parent pointer-events none - + > a font-weight bold cursor default - + &>a // button--small is designed for a elements not li text-decoration none color inherit @@ -188,15 +204,15 @@ body &:hover cursor pointer z-index 2 - + &.menu-item-has-children - &:hover + &:hover &:not(.current_page_parent) > .sub-menu display block &.show display block - + .sub-menu display none position absolute @@ -207,7 +223,7 @@ body text-align left box-shadow 0 0 100px rgba(0,0,0,.05) transition display 0.2s ease - + li display block margin 0 @@ -221,7 +237,7 @@ body &:last-of-type padding-bottom 8px border-radius 0 0 8px 8px - + a color $blue padding 1.25rem @@ -231,39 +247,37 @@ body &:hover background #eee - + &--secondary z-index 2 text-align center - padding 20px 3rem - - li - display inline-block - margin 0 0 0 3rem - - &:first-of-type + ul + padding 0 0 10px + + li + display inline-block + margin 0 0 0 3rem + + &.current_page_item + a + font-weight bold + a - color $black - + text--body($blue) + font-size 1.3rem !important + text-decoration none + // text-transform uppercase + padding 10px + display inline-block + &:hover - cursor default - - &:after - content '' - margin-left 3rem - border-right 1px $grey solid - - a - text--body($blue) - font-size 1.28rem !important - text-decoration none - text-transform uppercase - + cursor pointer + &__mobile-buttons display none @media all and (max-width:$smallScreen) - .wt_header + .wt_header &__searchbar display none @@ -275,25 +289,25 @@ body overflow-x scroll -ms-overflow-style none scrollbar-width none - + &::-webkit-scrollbar display none - + li &:first-of-type margin-left 0rem - + &:last-of-type margin-right 3rem - + @media all and (max-width:$mobile) body padding-top 119.63px - + .wt_header &__nav display none - + &--mobile display block z-index 5 @@ -309,55 +323,55 @@ body transition .2s right ease-in-out -ms-overflow-style none scrollbar-width none - + &::-webkit-scrollbar display none - + &.expand right 0 - + &>ul &>li margin-bottom 3rem - + &>a text--strong($blue) text-decoration none - + ul margin-top 1.5rem - + li margin-bottom 1.5rem - + a text--body($blue) text-decoration none - + &__mobile-buttons display block flex-grow 3 text-align right - + button background none border none float right text--strong($black) - + &:hover cursor pointer - + &:focus outline none - + &:last-of-type display none z-index 7 position fixed top 2.5rem right 1.6rem - + &.transparent-background .wt_header__mobile-buttons button:first-of-type diff --git a/stylus/require/search-results.styl b/stylus/require/search-results.styl index b3b8ee7b..de70aa88 100644 --- a/stylus/require/search-results.styl +++ b/stylus/require/search-results.styl @@ -4,7 +4,7 @@ body &__nav &>ul>li &:first-of-type - background $white !important + background $parchment !important &>a color $blue !important From 3a9dfd32e15ec48d9c4da316d5fa82467737faa7 Mon Sep 17 00:00:00 2001 From: FredericoAndrade Date: Sat, 24 Aug 2024 00:26:10 +0200 Subject: [PATCH 4/7] big style effort --- modules/banner--languages-single.php | 14 +-- modules/meta--languages-description.php | 87 ++++++++++++++++++ modules/meta--languages-single.php | 43 ++++----- modules/meta--videos-single.php | 32 ++++--- modules/single-languages__lexicons.php | 20 ++--- modules/single-languages__resources.php | 8 +- modules/single-languages__videos.php | 8 +- single-team.php | 6 ++ single-videos.php | 47 +++++----- stylus/main.css | 92 ++++++++++++++++---- stylus/require/banner--languages-single.styl | 2 +- stylus/require/banner--team.styl | 6 +- stylus/require/carousel--testimonial.styl | 8 +- stylus/require/carousel--thumbnail.styl | 14 +-- stylus/require/global.styl | 1 + stylus/require/header.styl | 35 ++------ stylus/require/meta--languages-single.styl | 31 ++++--- stylus/require/meta--videos-single.styl | 44 ++++++---- stylus/require/single-languages.styl | 11 ++- stylus/require/videos-single--embed.styl | 20 +++-- 20 files changed, 330 insertions(+), 199 deletions(-) create mode 100644 modules/meta--languages-description.php create mode 100644 single-team.php diff --git a/modules/banner--languages-single.php b/modules/banner--languages-single.php index 3b045080..c0b826c5 100644 --- a/modules/banner--languages-single.php +++ b/modules/banner--languages-single.php @@ -1,11 +1,11 @@
diff --git a/modules/meta--languages-description.php b/modules/meta--languages-description.php new file mode 100644 index 00000000..28bd18f1 --- /dev/null +++ b/modules/meta--languages-description.php @@ -0,0 +1,87 @@ +console.log(' . json_encode($B) . ')'; +// Output the constructed sentence +?> + +

\ No newline at end of file diff --git a/modules/meta--languages-single.php b/modules/meta--languages-single.php index 07546337..62bd1a94 100644 --- a/modules/meta--languages-single.php +++ b/modules/meta--languages-single.php @@ -1,42 +1,29 @@ + \ No newline at end of file diff --git a/modules/meta--videos-single.php b/modules/meta--videos-single.php index f28761b1..b4923b80 100644 --- a/modules/meta--videos-single.php +++ b/modules/meta--videos-single.php @@ -1,19 +1,17 @@
-
+
- Video license

'; + Video license

'; echo '

'. $video_license . '

'; } ?> -

- Video file downloads -

+

Video file downloads

Dropbox (.mp4)'; @@ -29,13 +27,13 @@ if ( $dropbox_link === 'none' && !$wikimedia_commons_link ) { echo 'File downloads are currently unavailable for this video.'; - + } if ( !$dropbox_link && !$wikimedia_commons_link ) { echo 'File downloads are currently unavailable for this video.'; - + } // later version: captions @@ -60,13 +58,13 @@ $alternate_names = get_field('alternate_names'); $nations_of_origin = get_field('nations_of_origin'); $writing_systems = get_field('writing_systems'); - $linguistic_genealogy = get_field('linguistic_genealogy'); + $linguistic_genealogy = get_field('linguistic_genealogy'); ?> - About +

About

- + - +
\ No newline at end of file diff --git a/modules/single-languages__lexicons.php b/modules/single-languages__lexicons.php index 5a7f1ba9..bee84d9d 100644 --- a/modules/single-languages__lexicons.php +++ b/modules/single-languages__lexicons.php @@ -1,10 +1,8 @@
-

- Dictionaries, phrase books, and other lexicons -

+

Dictionaries, phrase books, and other lexicons

diff --git a/modules/single-languages__resources.php b/modules/single-languages__resources.php index def3c1ab..d1d94135 100644 --- a/modules/single-languages__resources.php +++ b/modules/single-languages__resources.php @@ -1,10 +1,8 @@
-

- External resources -

+

External resources

    -
diff --git a/modules/single-languages__videos.php b/modules/single-languages__videos.php index af39a6bc..f26fae7e 100644 --- a/modules/single-languages__videos.php +++ b/modules/single-languages__videos.php @@ -1,11 +1,9 @@
-

- Videos -

+

Videos

    -
diff --git a/single-team.php b/single-team.php new file mode 100644 index 00000000..52c8c872 --- /dev/null +++ b/single-team.php @@ -0,0 +1,6 @@ +' . get_field( 'video_title' ) . ''; -echo '

' . get_field( 'video_title' ) . '

'; + // left column - video metadata + include( 'modules/meta--videos-single.php' ); -// left column - video metadata -include( 'modules/meta--videos-single.php' ); + // right column - video content + include( 'modules/main-content--videos-single.php' ); -// right column - video content -include( 'modules/main-content--videos-single.php' ); - -// related videos (thumbnail carousel) -// include( 'modules/carousel--thumbnail.php' ); - -// footer -get_footer(); + // related videos (thumbnail carousel) + // include( 'modules/carousel--thumbnail.php' ); + get_footer(); +?> \ No newline at end of file diff --git a/stylus/main.css b/stylus/main.css index d94eca9f..f509e7b5 100644 --- a/stylus/main.css +++ b/stylus/main.css @@ -138,7 +138,7 @@ body.page-id-15577.logged-in .wt_header { .wt_header__primary { display: flex; width: 100%; - padding: 10px 10px 0; + padding: 8px; } .wt_header__logo { flex-grow: initial; @@ -184,6 +184,7 @@ body.page-id-15577.logged-in .wt_header { } } .wt_header__secondary { + border-top: 1px solid #d4cce0; width: 100%; } .wt_header__nav { @@ -305,7 +306,7 @@ body.page-id-15577.logged-in .wt_header { text-align: center; } .wt_header__nav--secondary ul { - padding: 0 0 10px; + padding: 8px 0; } .wt_header__nav--secondary ul li { display: inline-block; @@ -440,8 +441,8 @@ body.page-id-15577.logged-in .wt_header { display: none; z-index: 7; position: fixed; - top: 2.5rem; - right: 1.6rem; + top: 3rem; + right: 3rem; } .wt_header.transparent-background .wt_header__mobile-buttons button:first-of-type { font-family: 'Graphik Web'; @@ -1476,6 +1477,18 @@ body .wt_single-languages__content { body .wt_single-languages__contents { margin-bottom: 6rem; } +body .wt_single-languages__contents h2.wt_sectionHeader { + font-family: 'Graphik Web'; + font-weight: 700; + font-style: normal; + font-stretch: normal; + font-size: 1.6rem; + line-height: 1.3; + color: #101010; + margin-bottom: 1.5rem; + border-bottom: 1px solid #d4cce0; + padding-bottom: 12px; +} body .wt_single-languages__contents>p { width: 100%; margin: 0 auto 3rem; @@ -1488,9 +1501,6 @@ body .wt_single-languages__contents>p { line-height: 1.3; color: #101010; } -body .wt_single-languages__contents>p:first-of-type { - border-bottom: 1px solid #dcdcdc; -} body .wt_single-languages__contents>p a { font-family: 'Graphik Web'; font-weight: 400; @@ -1534,7 +1544,7 @@ body .wt_single-languages__contents#wt_single-languages__resources .wt_content-b .wt_banner--languages { width: 100%; margin-bottom: 6rem; - padding: 120px 0; + padding: 220px 0 120px; border-bottom: 1px solid #fffcef; background: #9581c2; text-align: center; @@ -1587,6 +1597,9 @@ body .wt_single-languages__contents#wt_single-languages__resources .wt_content-b float: left; padding-left: 6rem; } +.wt_meta--languages-single section { + margin-bottom: 1rem; +} .wt_meta--languages-single strong { font-family: 'Graphik Web'; font-weight: 700; @@ -1597,10 +1610,15 @@ body .wt_single-languages__contents#wt_single-languages__resources .wt_content-b color: #101010; } .wt_meta--languages-single p { - margin-bottom: 1.5rem; - text-transform: uppercase; + font-family: 'Graphik Web'; + font-weight: 400; + font-style: normal; + font-stretch: normal; + font-size: 1.6rem; + line-height: 1.3; + color: #101010; } -.wt_meta--languages-single p strong { +.wt_meta--languages-single h2 { font-family: 'Graphik Web'; font-weight: 700; font-style: normal; @@ -1609,11 +1627,24 @@ body .wt_single-languages__contents#wt_single-languages__resources .wt_content-b line-height: 1.3; color: #101010; } +.wt_meta--languages-single h2.wt_sectionHeader { + margin-bottom: 1.5rem; + border-bottom: 1px solid #d4cce0; + padding-bottom: 12px; +} .wt_meta--languages-single ul li { margin-bottom: 1.5rem; } .wt_meta--languages-single a { text-decoration: none; + font-family: 'Graphik Web'; + font-weight: 400; + font-style: normal; + font-stretch: normal; + font-size: 1.6rem; + line-height: 1.3; + color: #3814a5; + display: block; } .wt_meta--languages-single a strong { font-family: 'Graphik Web'; @@ -1650,6 +1681,10 @@ body.single-videos .wt_header__nav>ul>li:first-of-type:hover:before { body.single-videos .wt_header__nav>ul>li:first-of-type:hover .sub-menu { display: none !important; } +body.logged-in .wt_single-videos__content .wt_single-videos__video, +body.logged-in .wt_single-videos__content .wt_single-videos__no-video { + padding-top: 183px; +} .wt_single-videos__content { width: 100%; margin: 0 auto 6rem auto; @@ -1673,7 +1708,7 @@ body.single-videos .wt_header__nav>ul>li:first-of-type:hover .sub-menu { .wt_single-videos__video, .wt_single-videos__no-video { background: #101010; - padding: 4rem 0; + padding: 151px 0 4rem; margin-bottom: 6rem; } .wt_single-videos__no-video { @@ -1744,8 +1779,17 @@ body.single-videos .wt_header__nav>ul>li:first-of-type:hover .sub-menu { color: #101010; text-transform: uppercase; } +.wt_meta--videos-single h2 { + font-family: 'Graphik Web'; + font-weight: 700; + font-style: normal; + font-stretch: normal; + font-size: 1.6rem; + line-height: 1.3; + color: #101010; + margin-bottom: 4px; +} .wt_meta--videos-single p { - margin-bottom: 1.5rem; font-family: 'Graphik Web'; font-weight: 400; font-style: normal; @@ -1753,8 +1797,21 @@ body.single-videos .wt_header__nav>ul>li:first-of-type:hover .sub-menu { font-size: 1.6rem; line-height: 1.3; color: #101010; + margin-bottom: 1.6rem; } -.wt_meta--videos-single p strong { +.wt_meta--videos-single h2.wt_sectionHeader { + font-family: 'Graphik Web'; + font-weight: 700; + font-style: normal; + font-stretch: normal; + font-size: 1.6rem; + line-height: 1.3; + color: #101010; + margin-bottom: 1.6rem; + border-bottom: 1px solid #d4cce0; + padding-bottom: 12px; +} +.wt_meta--videos-single h2.wt_sectionHeader strong { font-family: 'Graphik Web'; font-weight: 700; font-style: normal; @@ -1770,9 +1827,10 @@ body.single-videos .wt_header__nav>ul>li:first-of-type:hover .sub-menu { margin-top: 3rem; } .wt_meta--videos-single ul li { - margin-bottom: 1.5rem; + margin-bottom: 1.6rem; } -.wt_meta--videos-single ul li p:first-of-type { +p.wt_meta--videos-single ul li:first-of-type, +.wt_meta--videos-single ul li h2 { font-family: 'Graphik Web'; font-weight: 700; font-style: normal; @@ -1871,7 +1929,7 @@ text } .wt_banner--team { margin-bottom: 6rem; - padding: 6rem; + padding: 170px 6rem 6rem; background: #9581c2; text-align: center; } diff --git a/stylus/require/banner--languages-single.styl b/stylus/require/banner--languages-single.styl index b6b4fe4b..983b81f7 100644 --- a/stylus/require/banner--languages-single.styl +++ b/stylus/require/banner--languages-single.styl @@ -1,7 +1,7 @@ .wt_banner--languages width 100% margin-bottom 6rem - padding 120px 0 + padding 220px 0 120px border-bottom 1px solid $parchment background $purple text-align center diff --git a/stylus/require/banner--team.styl b/stylus/require/banner--team.styl index d0fd61e7..576ca84a 100644 --- a/stylus/require/banner--team.styl +++ b/stylus/require/banner--team.styl @@ -1,13 +1,13 @@ .wt_banner--team margin-bottom 6rem - padding 6rem + padding 170px 6rem 6rem background $purple text-align center - + h1 text--header($parchment) margin-bottom 3rem - + p text--body($parchment) diff --git a/stylus/require/carousel--testimonial.styl b/stylus/require/carousel--testimonial.styl index 054f66a5..06d62459 100644 --- a/stylus/require/carousel--testimonial.styl +++ b/stylus/require/carousel--testimonial.styl @@ -50,19 +50,19 @@ .wt_carousel--testimonials p margin-bottom 3rem - + ul .wt_testimonial display block - + &__image display block margin auto - + &__copy p margin 3rem auto - + a display block margin auto diff --git a/stylus/require/carousel--thumbnail.styl b/stylus/require/carousel--thumbnail.styl index 4bc2199c..fc109b9c 100644 --- a/stylus/require/carousel--thumbnail.styl +++ b/stylus/require/carousel--thumbnail.styl @@ -8,7 +8,7 @@ font-size 4.8rem margin-bottom 4rem text-align center - + &__left-scroll display none position absolute @@ -23,7 +23,7 @@ border 1px solid $parchment font-size 1.6rem cursor pointer - + &__right-scroll position absolute top 50% @@ -86,21 +86,21 @@ display block width 100% padding 0 3rem - + .wt_thumbnail margin-bottom 3rem - + &:last-of-type margin-bottom 0 - + &__image width 25% height initial padding-bottom 25% - + &__copy width 75% - + &__left-scroll, &__right-scroll display none \ No newline at end of file diff --git a/stylus/require/global.styl b/stylus/require/global.styl index d4edf7e2..4f0d5a87 100644 --- a/stylus/require/global.styl +++ b/stylus/require/global.styl @@ -23,6 +23,7 @@ $dark_grey = #979797 $red = #e52600 $blue = #3814A5 $purple = #9581c2 +$lightPurple = #D4CCE0 $yellow = #ffff00 // typography diff --git a/stylus/require/header.styl b/stylus/require/header.styl index e0babb81..1cb1cf51 100644 --- a/stylus/require/header.styl +++ b/stylus/require/header.styl @@ -2,7 +2,6 @@ body max-width 1800px margin auto box-shadow 0 0 100px rgba(0,0,0,.05) - // padding-top 122.63px background $parchment &[data-alert="true"] @@ -12,7 +11,6 @@ body top 72px !important &.logged-in - // padding-top 154.63px !important .wt_header top 32px !important @@ -41,20 +39,9 @@ body padding 10px &.logged-in - // padding-top 32px !important - .wt_header top 32px !important - // &.page-template-template-giving-campaign - // padding-top 131.63px !important - - // &.logged-in - // // padding-top 91.63px !important - - // &[data-alert="true"] - // padding-top 163.63px !important - .wt_header z-index 10 display flex @@ -62,12 +49,8 @@ body align-items center position fixed top 0 - // left 50% - // transform translateX(-50%) width 100% max-width 1800px - // height 60px - // padding 0 1.5rem box-sizing border-box background $parchment transition-property background @@ -87,7 +70,7 @@ body &__primary display flex width 100% - padding 10px 10px 0 + padding 8px &__logo flex-grow initial @@ -135,14 +118,8 @@ body display none !important &__secondary - // z-index 2 - // position fixed - // top 60px - // left 0 + border-top 1px solid $lightPurple width 100% - // padding 10px 3rem 20px - // background $white - // border-top 1px solid $blue &__nav z-index inherit @@ -251,8 +228,9 @@ body &--secondary z-index 2 text-align center + ul - padding 0 0 10px + padding 8px 0 li display inline-block @@ -266,7 +244,6 @@ body text--body($blue) font-size 1.3rem !important text-decoration none - // text-transform uppercase padding 10px display inline-block @@ -369,8 +346,8 @@ body display none z-index 7 position fixed - top 2.5rem - right 1.6rem + top 3rem + right 3rem &.transparent-background .wt_header__mobile-buttons diff --git a/stylus/require/meta--languages-single.styl b/stylus/require/meta--languages-single.styl index 2479215e..ab6bdb16 100644 --- a/stylus/require/meta--languages-single.styl +++ b/stylus/require/meta--languages-single.styl @@ -2,30 +2,39 @@ width calc(100%/4) float left padding-left 6rem - + + section + margin-bottom 1rem + strong text--strong($black) - + p + text--body($black) + + h2 + text--strong($black) + + h2.wt_sectionHeader margin-bottom 1.5rem - text-transform uppercase - - strong - text--strong($black) - + border-bottom 1px solid $lightPurple + padding-bottom 12px + ul li margin-bottom 1.5rem - + a text-decoration none - + text--body($blue) + display block + strong text--strong($blue) - + span text--body($blue) - + &:hover text-decoration underline diff --git a/stylus/require/meta--videos-single.styl b/stylus/require/meta--videos-single.styl index b9f56678..2777de2a 100644 --- a/stylus/require/meta--videos-single.styl +++ b/stylus/require/meta--videos-single.styl @@ -1,43 +1,51 @@ .wt_meta--videos-single width calc(100%/4) float left - + strong text--strong($black) text-transform uppercase - + + h2 + text--strong($black) + margin-bottom 4px + p - margin-bottom 1.5rem - // text-transform uppercase text--body($black) - + margin-bottom 1.6rem + + h2.wt_sectionHeader + text--strong($black) + margin-bottom 1.6rem + border-bottom 1px solid $lightPurple + padding-bottom 12px + strong text--strong($black) - + ul margin-top 1.5rem - + &.wt_meta__featured-languages margin-top 3rem - + li - margin-bottom 1.5rem - - p - &:first-of-type + margin-bottom 1.6rem + + p&:first-of-type, h2 text--strong($black) - + a text-decoration none color $blue - + strong text--strong($blue) text - + span text--body($blue) - + &:hover text-decoration underline @@ -46,12 +54,12 @@ &--videos-single float none width 100% - + &__featured-languages li &:last-of-type margin-bottom 0 - + ul li display inline-block diff --git a/stylus/require/single-languages.styl b/stylus/require/single-languages.styl index a75cdbeb..90a2ed98 100644 --- a/stylus/require/single-languages.styl +++ b/stylus/require/single-languages.styl @@ -22,15 +22,18 @@ body &__contents margin-bottom 6rem + h2.wt_sectionHeader + text--strong($black) + margin-bottom 1.5rem + border-bottom 1px solid $lightPurple + padding-bottom 12px + &>p width 100% margin 0 auto 3rem padding-bottom 3rem text--body($black) - - &:first-of-type - border-bottom 1px solid $grey - + a text--body($blue) diff --git a/stylus/require/videos-single--embed.styl b/stylus/require/videos-single--embed.styl index 5560b81b..d2dbdd1f 100644 --- a/stylus/require/videos-single--embed.styl +++ b/stylus/require/videos-single--embed.styl @@ -1,4 +1,10 @@ $video_size = (9/16)*100 // in viewport widths + +body.logged-in .wt_single-videos__content + .wt_single-videos__video, + .wt_single-videos__no-video + padding-top 183px + .wt_single-videos &__content width 100% @@ -18,9 +24,9 @@ $video_size = (9/16)*100 // in viewport widths &__video, &__no-video background $black - padding 4rem 0 + padding 151px 0 4rem margin-bottom 6rem - + &__no-video display flex min-height ($video_size/16*9)vw @@ -32,13 +38,13 @@ $video_size = (9/16)*100 // in viewport widths text-align center max-width ($video_size)vw text--body($parchment) - + &__video width 100% height 100% text--strong($parchment) text-align center - + video background lighten($black, 10%) width 100% @@ -47,10 +53,10 @@ $video_size = (9/16)*100 // in viewport widths iframe min-height ($video_size/16*9)vw max-width ($video_size)vw - + p background $purple - + img width 100% height auto @@ -59,6 +65,6 @@ $video_size = (9/16)*100 // in viewport widths .wt_single-videos &__content margin 2rem auto - + &__video margin-bottom 3rem \ No newline at end of file From b0c6120c9696bc3a8aa0b9f6d5b2828fe45cb121 Mon Sep 17 00:00:00 2001 From: FredericoAndrade Date: Sun, 25 Aug 2024 18:04:15 +0200 Subject: [PATCH 5/7] init 404 --- 404.php | 6 ++++++ stylus/main.css | 38 ++++++++++++++++++++++++++++++++++++++ stylus/main.styl | 4 ++-- stylus/require/404.styl | 19 +++++++++++++++++++ 4 files changed, 65 insertions(+), 2 deletions(-) create mode 100644 404.php create mode 100644 stylus/require/404.styl diff --git a/404.php b/404.php new file mode 100644 index 00000000..c3358084 --- /dev/null +++ b/404.php @@ -0,0 +1,6 @@ + + + \ No newline at end of file diff --git a/stylus/main.css b/stylus/main.css index f509e7b5..890e8d48 100644 --- a/stylus/main.css +++ b/stylus/main.css @@ -2630,3 +2630,41 @@ text box-sizing: border-box; } } +#page-404 { + display: inline-block; + margin-top: 89px; + width: 100%; + height: 0; + padding: 20vh 0 30vh; + font-family: 'Graphik Web'; + font-weight: 400; + font-style: normal; + font-stretch: normal; + font-size: 1.6rem; + line-height: 1.3; + color: #101010; +} +#page-404 h1, +#page-404 p { + text-align: center; +} +#page-404 h1 { + font-family: 'Schnyder Wide M Web'; + font-weight: 300; + font-style: normal; + font-stretch: normal; + font-size: 6.08rem; + color: #101010; + font-size: 3rem; + margin-bottom: 1.5rem; +} +#page-404 a { + font-family: 'Graphik Web'; + font-weight: 700; + font-style: normal; + font-stretch: normal; + font-size: 1.6rem; + line-height: 1.3; + color: #3814a5; + text-decoration: none; +} diff --git a/stylus/main.styl b/stylus/main.styl index f927c9ed..34b16059 100644 --- a/stylus/main.styl +++ b/stylus/main.styl @@ -1,5 +1,4 @@ -// organize alphabetically? -@require "require/global" // includes stylus variables +@require "require/global" @require "require/typeahead" @require "require/header" @require "require/banner--main" @@ -32,3 +31,4 @@ @require "require/banner--alert" @require "require/template-giving-campaign" @require "require/reports" +@require "require/404" diff --git a/stylus/require/404.styl b/stylus/require/404.styl new file mode 100644 index 00000000..fb97a357 --- /dev/null +++ b/stylus/require/404.styl @@ -0,0 +1,19 @@ +#page-404 + display inline-block + margin-top 89px + width 100% + height 0 + padding 20vh 0 30vh + text--body($black) + + h1,p + text-align center + + h1 + text--header($black) + font-size 3rem + margin-bottom 1.5rem + + a + text--strong($blue) + text-decoration none \ No newline at end of file From 2d9a6b8bc37a593ea198d4908bdfad26c9e0557d Mon Sep 17 00:00:00 2001 From: FredericoAndrade Date: Tue, 27 Aug 2024 20:17:17 +0200 Subject: [PATCH 6/7] new 404 message --- 404.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/404.php b/404.php index c3358084..32fda321 100644 --- a/404.php +++ b/404.php @@ -1,6 +1,6 @@ \ No newline at end of file From 31e65c1f335d6217fbe13bcea2105ca479f5dbe6 Mon Sep 17 00:00:00 2001 From: FredericoAndrade Date: Sun, 1 Sep 2024 17:28:08 +0200 Subject: [PATCH 7/7] setup video featured language pre-computed fields --- acf-json/group_614b82766af00.json | 29 +++++++++-- functions.php | 48 ++++++++++--------- ...all-videos-featured-language-iso-codes.php | 44 +++++++++++++++++ ...date-video-featured-language-iso-codes.php | 45 +++++++++++++++++ 4 files changed, 140 insertions(+), 26 deletions(-) create mode 100644 includes/update-all-videos-featured-language-iso-codes.php create mode 100644 includes/update-video-featured-language-iso-codes.php diff --git a/acf-json/group_614b82766af00.json b/acf-json/group_614b82766af00.json index 5e324903..58b486cc 100644 --- a/acf-json/group_614b82766af00.json +++ b/acf-json/group_614b82766af00.json @@ -84,10 +84,12 @@ "post_type": [ "languages" ], + "post_status": "", "taxonomy": "", - "allow_null": 0, - "multiple": 1, "return_format": "object", + "multiple": 1, + "allow_null": 0, + "bidirectional": 0, "ui": 1, "bidirectional_target": [] }, @@ -257,6 +259,27 @@ "prepend": "", "append": "", "maxlength": "" + }, + { + "key": "field_66cba73d7ea4a", + "label": "Language ISO Codes", + "name": "language_iso_codes", + "aria-label": "", + "type": "text", + "instructions": "", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "readonly": true, + "default_value": "", + "maxlength": "", + "placeholder": "", + "prepend": "", + "append": "" } ], "location": [ @@ -277,5 +300,5 @@ "active": true, "description": "", "show_in_rest": 1, - "modified": 1718738564 + "modified": 1725185778 } diff --git a/functions.php b/functions.php index f2e32c08..0dcd7fb1 100644 --- a/functions.php +++ b/functions.php @@ -2,6 +2,8 @@ /* CONSIDER BREAKING INTO MULTIPLE FUNCTIONS FILES */ require_once('includes/class-wt-rest-posts-controller.php'); +require_once('includes/update-video-featured-language-iso-codes.php'); +// require_once('includes/update-all-videos-featured-language-iso-codes.php'); // enqueue stylesheets add_action( 'wp_enqueue_scripts', 'wt_enqueue_styles' ); @@ -9,7 +11,7 @@ function wt_enqueue_styles() { $parenthandle = 'blankslate-style'; $theme = wp_get_theme(); - wp_enqueue_style( $parenthandle, get_template_directory_uri() . '/style.css', + wp_enqueue_style( $parenthandle, get_template_directory_uri() . '/style.css', array(), $theme->parent()->get('Version') ); @@ -25,7 +27,7 @@ function wt_enqueue_styles() { function wt_enqueue_js() { wp_register_script( 'wt_js', - get_stylesheet_directory_uri() . '/js/custom.js', + get_stylesheet_directory_uri() . '/js/custom.js', array('jquery'), true); wp_enqueue_script('wt_js'); @@ -133,7 +135,7 @@ function searchfilter($query) } return $query; } - + add_filter('pre_get_posts', 'searchfilter'); // remove header bump from core css output @@ -141,10 +143,10 @@ function searchfilter($query) function my_filter_head() { remove_action('wp_head', '_admin_bar_bump_cb'); -} +} // initiate options page - consider deprecating this -if( function_exists('acf_add_options_page') ) { +if( function_exists('acf_add_options_page') ) { acf_add_options_page(); } @@ -277,9 +279,9 @@ function html5wp_pagination() } // add custom post types for language archive -add_action('init', 'create_post_type_languages'); +add_action('init', 'create_post_type_languages'); add_action('init', 'create_post_type_videos'); -add_action('init', 'create_post_type_lexicons'); +add_action('init', 'create_post_type_lexicons'); add_action('init', 'create_post_type_resources'); // indexing misc. // revitalization project // translation/interpretation @@ -294,12 +296,12 @@ function html5wp_pagination() // Team function create_post_type_team() { - register_taxonomy_for_object_type('category', 'team'); + register_taxonomy_for_object_type('category', 'team'); register_taxonomy_for_object_type('post_tag', 'team'); register_post_type('team', array( 'labels' => array( - 'name' => __('Team', 'team'), + 'name' => __('Team', 'team'), 'singular_name' => __('Team', 'team'), 'add_new' => __('Add New', 'team'), 'add_new_item' => __('Add New team', 'team'), @@ -332,12 +334,12 @@ function create_post_type_team() // Partners function create_post_type_partners() { - register_taxonomy_for_object_type('category', 'partners'); + register_taxonomy_for_object_type('category', 'partners'); register_taxonomy_for_object_type('post_tag', 'partners'); register_post_type('partners', array( 'labels' => array( - 'name' => __('Partners', 'partner'), + 'name' => __('Partners', 'partner'), 'singular_name' => __('Partner', 'partner'), 'add_new' => __('Add New', 'partner'), 'add_new_item' => __('Add New Partner', 'partner'), @@ -368,12 +370,12 @@ function create_post_type_partners() // Languages function create_post_type_languages() { - register_taxonomy_for_object_type('category', 'languages'); + register_taxonomy_for_object_type('category', 'languages'); register_taxonomy_for_object_type('post_tag', 'languages'); register_post_type('languages', array( 'labels' => array( - 'name' => __('Languages', 'language'), + 'name' => __('Languages', 'language'), 'singular_name' => __('Language', 'language'), 'add_new' => __('Add New', 'language'), 'add_new_item' => __('Add New Language', 'language'), @@ -408,12 +410,12 @@ function create_post_type_languages() // Videos function create_post_type_videos() { - register_taxonomy_for_object_type('category', 'videos'); + register_taxonomy_for_object_type('category', 'videos'); register_taxonomy_for_object_type('post_tag', 'videos'); register_post_type('videos', array( 'labels' => array( - 'name' => __('Videos', 'video'), + 'name' => __('Videos', 'video'), 'singular_name' => __('Video', 'video'), 'add_new' => __('Add New', 'video'), 'add_new_item' => __('Add New Video', 'video'), @@ -449,12 +451,12 @@ function create_post_type_videos() // Lexicons function create_post_type_lexicons() { - register_taxonomy_for_object_type('category', 'lexicons'); + register_taxonomy_for_object_type('category', 'lexicons'); register_taxonomy_for_object_type('post_tag', 'lexicons'); register_post_type('lexicons', array( 'labels' => array( - 'name' => __('Lexicons', 'lexicons'), + 'name' => __('Lexicons', 'lexicons'), 'singular_name' => __('Lexicon', 'lexicon'), 'add_new' => __('Add New', 'lexicon'), 'add_new_item' => __('Add New Lexicon', 'lexicon'), @@ -490,12 +492,12 @@ function create_post_type_lexicons() // External Resources function create_post_type_resources() { - register_taxonomy_for_object_type('category', 'resources'); + register_taxonomy_for_object_type('category', 'resources'); register_taxonomy_for_object_type('post_tag', 'resources'); register_post_type('resources', array( 'labels' => array( - 'name' => __('Resources', 'resource'), + 'name' => __('Resources', 'resource'), 'singular_name' => __('Resource', 'resource'), 'add_new' => __('Add New', 'resource'), 'add_new_item' => __('Add New Resource', 'resource'), @@ -532,12 +534,12 @@ function create_post_type_resources() // Fellows function create_post_type_fellows() { - register_taxonomy_for_object_type('category', 'fellows'); + register_taxonomy_for_object_type('category', 'fellows'); register_taxonomy_for_object_type('post_tag', 'fellows'); register_post_type('fellows', array( 'labels' => array( - 'name' => __('Fellows', 'fellows'), + 'name' => __('Fellows', 'fellows'), 'singular_name' => __('Fellow', 'fellows'), 'add_new' => __('Add New', 'fellows'), 'add_new_item' => __('Add New Fellow', 'fellows'), @@ -571,12 +573,12 @@ function create_post_type_fellows() // Reports function create_post_type_reports() { - register_taxonomy_for_object_type('category', 'reports'); + register_taxonomy_for_object_type('category', 'reports'); register_taxonomy_for_object_type('post_tag', 'reports'); register_post_type('reports', array( 'labels' => array( - 'name' => __('Reports', 'reports'), + 'name' => __('Reports', 'reports'), 'singular_name' => __('Report', 'reports'), 'add_new' => __('Add New', 'reports'), 'add_new_item' => __('Add New Report', 'reports'), diff --git a/includes/update-all-videos-featured-language-iso-codes.php b/includes/update-all-videos-featured-language-iso-codes.php new file mode 100644 index 00000000..bee619f0 --- /dev/null +++ b/includes/update-all-videos-featured-language-iso-codes.php @@ -0,0 +1,44 @@ + 'videos', + 'posts_per_page' => -1, // Get all video posts + 'fields' => 'ids', // Only get post IDs for performance + ); + + $video_posts = new WP_Query($args); + + if ($video_posts->have_posts()) { + foreach ($video_posts->posts as $post_id) { + // Get the 'featured_languages' field + $featured_languages = get_field('featured_languages', $post_id); + + if ($featured_languages && is_array($featured_languages)) { + $iso_codes = array(); + + // Loop through the languages and collect the ISO codes + foreach ($featured_languages as $language) { + if (isset($language->post_name)) { + $iso_codes[] = $language->post_name; + } + } + + // Convert the array of ISO codes to a comma-separated string + $iso_code_string = implode(',', $iso_codes); + + // Update the 'language_iso_codes' field with the string of ISO codes + update_field('language_iso_codes', $iso_code_string, $post_id); + } else { + // If there are no languages, clear the field + update_field('language_iso_codes', '', $post_id); + } + } + } + + // Optionally, you can display a message or log the completion + error_log('All video records have been updated.'); +} +// Run the function once +update_all_video_language_iso_codes(); \ No newline at end of file diff --git a/includes/update-video-featured-language-iso-codes.php b/includes/update-video-featured-language-iso-codes.php new file mode 100644 index 00000000..8b5cac0b --- /dev/null +++ b/includes/update-video-featured-language-iso-codes.php @@ -0,0 +1,45 @@ +post_name)) { + $iso_codes[] = $language->post_name; + } + } + + // Convert the array of ISO codes to a comma-separated string + $iso_code_string = implode(',', $iso_codes); + + // Update the 'language_iso_codes' field with the string of ISO codes + update_field('language_iso_codes', $iso_code_string, $post_id); + } else { + // If there are no languages, clear the field + update_field('language_iso_codes', '', $post_id); + } +} +add_action('save_post', 'update_video_featured_language_iso_codes');