Skip to content

Commit

Permalink
Merge pull request #254 from wikitongues/bug/various-fixes-nov29
Browse files Browse the repository at this point in the history
update fontawesome source and tags, readme, refactor all home_url functions to make use of built-in path and scheme params, fixed visual bugs in FAQ, added missing links
  • Loading branch information
FredericoAndrade authored Nov 29, 2024
2 parents 7c7ec70 + 4cc6cd6 commit e75e9cf
Show file tree
Hide file tree
Showing 44 changed files with 813 additions and 640 deletions.
6 changes: 6 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,12 @@ Some of our advanced features are maintained as custom plugins. At present, we h
/includes/templates/*
```

# Dependencies

## Font Awesome

We use [FontAwewsome](https://fontawesome.com/) to render social icons.

# Errors

Localhost db view error: `The user specified as a definer ('wikitong_master'@'localhost') does not exist`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
$iso_code = get_the_title();
$iso_code_element = '<aside>'.esc_html($iso_code).'</aside>';
$video_query = get_videos_by_featured_language($iso_code);
$url = home_url('/languages/' . $iso_code);
$url = home_url('/languages/' . $iso_code, 'relative');

if ($video_query->have_posts()) {
while ($video_query->have_posts()) {
Expand Down
2 changes: 1 addition & 1 deletion wp-content/themes/blankslate-child/404.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php get_header(); ?>
<article id="page-404" class="post not-found">
<h1>Page not found</h1>
<p>This page was lost in translation. <a href="<?php echo home_url(); ?>/archive">Try a search instead?</a></p>
<p>This page was lost in translation. <a href="<?php echo home_url('archive', 'relative'); ?>">Try a search instead?</a></p>
</article>
<?php include( 'modules/newsletter.php' ); ?>
<?php get_footer(); ?>
Original file line number Diff line number Diff line change
Expand Up @@ -67,20 +67,20 @@
"label": "Block Copy",
"name": "block_copy",
"aria-label": "",
"type": "text",
"type": "textarea",
"instructions": "",
"required": 0,
"required": false,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"default_value": "",
"new_lines": "",
"maxlength": "",
"placeholder": "",
"prepend": "",
"append": ""
"rows": ""
}
],
"location": [
Expand All @@ -101,5 +101,5 @@
"active": true,
"description": "",
"show_in_rest": 0,
"modified": 1728232279
"modified": 1732883697
}
5 changes: 1 addition & 4 deletions wp-content/themes/blankslate-child/archive-fellows.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
<?php

$wikitongues_url = home_url();

header('Location: ' . $wikitongues_url . '/revitalization/fellows');
header('Location: ' . home__url('/revitalization/fellows','relative'));
5 changes: 1 addition & 4 deletions wp-content/themes/blankslate-child/archive-languages.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
<?php

$wikitongues_url = home_url();

header('Location: ' . $wikitongues_url . '/archive');
header('Location: ' . home_url('/archive', 'relative'));
5 changes: 1 addition & 4 deletions wp-content/themes/blankslate-child/archive-team.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
<?php

$wikitongues_url = home_url();

header('Location: ' . $wikitongues_url . '/team');
header('Location: ' . home_url('/team', 'relative'));
5 changes: 1 addition & 4 deletions wp-content/themes/blankslate-child/archive-videos.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
<?php

$wikitongues_url = home_url();

header('Location: ' . $wikitongues_url . '/languages');
header('Location: ' . home_url('/languages', 'relative'));
4 changes: 2 additions & 2 deletions wp-content/themes/blankslate-child/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@

<aside class="wt_header__mobile-buttons">
<button id="mobile-nav-open">
<i class="fa-regular fa-bars"></i>
<i class="fa-solid fa-bars"></i>
</button>
<button id="mobile-nav-close">
<i class="fa-regular fa-x"></i>
<i class="fa-solid fa-xmark"></i>
</button>
</aside>
</section>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ function log_data($data, $method = 'console') { // methods: console, dom
}
}

function get_url() {
$url = home_url();
}

add_action('wp_head', 'modify_page_title');
function modify_page_title() {
$environment = get_environment();
Expand Down
10 changes: 3 additions & 7 deletions wp-content/themes/blankslate-child/modules/fellow-bio.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
<section class="wt_fellow__bio">
<strong>
<?php echo $first_name; ?>'s background
</strong>
<p>
<?php echo $fellow_bio; ?>
</p>
<section class="main-content">
<h3><?php echo $first_name; ?>'s background</h3>
<p><?php echo $fellow_bio; ?></p>
</section>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Function to generate a single language link with an optional preferred name
function generate_language_link($language, $preferred_name = '') {
if ($language instanceof WP_Post) {
$language_url = home_url('/languages/' . $language->post_name);
$language_url = home_url('/languages/' . $language->post_name, 'relative');
return '<a class="language" href="' . esc_url($language_url) . '"><span class="identifier">' . esc_html($language->post_title) . '</span><p>' . esc_html($preferred_name) . '</p></a>';
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,24 @@
?>
<div class="wt_meta--languages-single">
<h2 class="wt_sectionHeader"><?php echo $standard_name; ?> resources</h2>
<ul>
<ul class="resources">
<li>
<a href="#wt_single-languages__videos">
<h3>Videos <?php echo ($videos_count > 0 ? '(' . $videos_count . ')' : ''); ?></h3>
</a>
<a href="<?php echo home_url(); ?>/submit-a-video">Submit a video</a>
<a href="<?php echo home_url('/submit-a-video', 'relative'); ?>">Submit a video</a>
</li>
<li>
<a href="#wt_single-languages__lexicons">
<h3>Dictionaries, phrase books, and lexicons <?php echo ($lexicons_count > 0 ? '(' . $lexicons_count . ')' : ''); ?></h3>
</a>
<a href="<?php echo home_url(); ?>/submit-a-lexicon">Submit a lexicon</a>
<a href="<?php echo home_url('/submit-a-lexicon', 'relative'); ?>">Submit a lexicon</a>
</li>
<li>
<a href="#wt_single-languages__resources">
<h3>External Resources <?php echo ($external_resources_count > 0 ? '(' . $external_resources_count . ')' : ''); ?></h3>
</a>
<a href="<?php echo home_url(); ?>/submit-a-resource">Recommend a resource</a>
<a href="<?php echo home_url('/submit-a-resource', 'relative'); ?>">Recommend a resource</a>
</li>
</ul>
<h2>Learn more about <?php echo $standard_name; ?></h2>
Expand Down
7 changes: 3 additions & 4 deletions wp-content/themes/blankslate-child/modules/page--head.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<?php if ( $favicon ): ?>
<link href="<?php echo $favicon['url']; ?>" rel="shortcut icon">
<?php else: ?>
<link href="<?php echo home_url(); ?>/wp-content/themes/blankslate-child/img/icons/favicon.ico" rel="shortcut icon">
<link href="<?php echo home_url('/wp-content/themes/blankslate-child/img/icons/favicon.ico', 'relative'); ?>" rel="shortcut icon">
<?php endif; ?>

<!-- Custom metadata variables -->
Expand Down Expand Up @@ -88,16 +88,15 @@
} // what should the default be here? ?>">

<!-- Open graph url -->
<meta property="og:url"
content="<?php echo home_url( $wp->request); ?>">
<meta property="og:url" content="<?php echo home_url( $wp->request, 'relative'); ?>">

<!-- Twitter card format -->
<meta name="twitter:card" content="summary_large_image">

<!-- For the CMS: Reconciling the guidelines for the image is simple: follow Facebook’s recommendation of a minimum dimension of 1200×630 pixels and an aspect ratio of 1.91:1, but adhere to Twitter’s file size requirement of less than 1MB. Validate: https://developers.facebook.com/tools/debug/sharing/ and https://cards-dev.twitter.com/validator -->

<!-- Font Awesome connection for UI/UX icons and small graphic elements -->
<script src="https://kit.fontawesome.com/01c8e3d542.js" crossorigin="anonymous"></script>
<script src="https://kit.fontawesome.com/5c48172421.js" crossorigin="anonymous"></script>

<!-- Fundraise Up connection -->
<script>(function(w,d,s,n,a){if(!w[n]){var l='call,catch,on,once,set,then,track'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,6 @@
?>
</ul>
<?php else: ?>
<p>There are no lexicons to display—yet. <a href="<?php echo home_url() ;?>/submit-a-lexicon">Submit a lexicon</a>.</p>
<p>There are no lexicons to display—yet. <a href="<?php echo home_url('/submit-a-lexicon', 'relative') ;?>">Submit a lexicon</a>.</p>
<?php endif; ?>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function getDomainFromUrl($url) {
?>
<div class="custom-cta-container">
<section class="custom-gallery-video-cta">
<a href="<?php echo home_url(); ?>/submit-a-video">Contribute a resource</a>
<a href="<?php echo home_url('/submit-a-video', 'relative'); ?>">Contribute a resource</a>
</section>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
?>
<div class="custom-cta-container">
<section class="custom-gallery-video-cta">
<a href="<?php echo home_url(); ?>/submit-a-video">Contribute a video</a>
<a href="<?php echo home_url(); ?>/wp-content/uploads/2024/09/Wikitongues-Recording-an-Oral-History-Sep-2024.pdf">How to create an oral history</a>
<a href="<?php echo home_url('/submit-a-video', 'relative'); ?>">Contribute a video</a>
<a href="<?php echo home_url('/wp-content/uploads/2024/09/Wikitongues-Recording-an-Oral-History-Sep-2024.pdf', 'relative'); ?>">How to create an oral history</a>
</section>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<article class="wt_team-member--grid">
<!-- team member image -->
<aside class="wt_team-member--grid__img" role="img" aria-label="<?php echo $profile_picture['alt']; ?>" style="background-image:url(<?php echo $profile_picture['url']; ?>);"></aside>

<!-- team member meta -->
<aside class="wt_team-member--grid__meta">
<!-- team member name and title -->
Expand All @@ -23,7 +23,7 @@
<?php if ( $email ): ?>
<li>
<a href="mailto:<?php echo $email; ?>">
<i class="fa-sharp fa-solid fa-envelope"></i>
<i class="fa-solid fa-envelope"></i>
</a>
</li>
<?php endif; ?>
Expand All @@ -40,7 +40,7 @@
<?php if ( $website ): ?>
<li>
<a href="<?php echo $twitter; ?>">
<i class="fa-brands fa-twitter"></i>/<i class="fa-brands fa-x-twitter"></i>
<i class="fa-brands fa-x-twitter"></i>/<i class="fa-brands fa-x-twitter"></i>
</a>
</li>
<?php endif; ?>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<article class="wt_team-member--partner">
<!-- team member image -->
<aside class="wt_team-member--partner__img" role="img" aria-label="<?php echo $partner_logo['alt']; ?>" style="background-image:url(<?php echo $partner_logo['url']; ?>);"></aside>

<!-- team member meta -->
<aside class="wt_team-member--partner__meta">
<!-- team member name and title -->
Expand All @@ -22,7 +22,7 @@
<?php if ( $partner_email ): ?>
<li>
<a href="mailto:<?php echo $partner_email; ?>">
<i class="fa-sharp fa-solid fa-envelope"></i>
<i class="fa-solid fa-envelope"></i>
</a>
</li>
<?php endif; ?>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<article class="wt_team-member--wide">
<!-- team member image -->
<aside class="wt_team-member--wide__img" role="img" aria-label="<?php echo $profile_picture['alt']; ?>" style="background-image:url(<?php echo $profile_picture['url']; ?>);"></aside>

<!-- team member meta -->
<aside class="wt_team-member--wide__meta">
<!-- team member name and title -->
Expand All @@ -25,15 +25,15 @@
<?php if ( $website ): ?>
<li>
<a href="<?php echo $website; ?>">
<i class="fa-regular fa-link"></i>
<i class="fa-solid fa-link"></i>
</a>
</li>
<?php endif; ?>

<?php if ( $email ): ?>
<li>
<a href="mailto:<?php echo $email; ?>">
<i class="fa-sharp fa-solid fa-envelope"></i>
<i class="fa-solid fa-envelope"></i>
</a>
</li>
<?php endif; ?>
Expand Down
5 changes: 1 addition & 4 deletions wp-content/themes/blankslate-child/single-events.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
<?php

$wikitongues_url = home_url();

header('Location: ' . $wikitongues_url . '/events');
header('Location: ' . home_url('/events', 'relative'));
11 changes: 7 additions & 4 deletions wp-content/themes/blankslate-child/single-fellows.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,16 @@
'instagram' => ['url' => get_field('instagram'), 'icon' => 'fa-brands fa-instagram'],
'linkedin' => ['url' => get_field('linkedin'), 'icon' => 'fa-brands fa-linkedin'],
'tiktok' => ['url' => get_field('tiktok'), 'icon' => 'fa-brands fa-tiktok'],
'twitter' => ['url' => get_field('twitter'), 'icon' => 'fa-brands fa-twitter'],
'website' => ['url' => get_field('website'), 'icon' => 'fa-regular fa-link'],
'twitter' => ['url' => get_field('twitter'), 'icon' => 'fa-brands fa-x-twitter'],
'website' => ['url' => get_field('website'), 'icon' => 'fa-solid fa-link'],
'youtube' => ['url' => get_field('youtube'), 'icon' => 'fa-brands fa-youtube']
];
$revitalization_fellows_url = home_url('/revitalization/fellows/?fellow_year=');
$revitalization_fellows_url = home_url('/revitalization/fellows/?fellow_year=', 'relative');
$revitalization_fellows_url = add_query_arg('fellow_year', $fellow_year, $revitalization_fellows_url);

$current_slug = add_query_arg( array(), $wp->request );
$fundraising_link = home_url("{$current_slug}/?element=XESPGTCJ&form=FUNQMUDJDGQ", 'relative');

// ====================
// Manage Fellows Page Titles
// ====================
Expand All @@ -46,7 +49,7 @@
?>
<div class="custom-gallery full">
<h2 class="wt_sectionHeader"><?php echo 'Other fellows from <a href="'.esc_url($revitalization_fellows_url).'">' . $fellow_year ?></a></h2>
<p>The Wikitongues Fellowship is an accelerator program where activists can learn from a network of revitalization projects. <a href="">Support a revitalization project.</a></p>
<p>The Wikitongues Fellowship is an accelerator program where activists can learn from a network of revitalization projects. <a href="<?php echo $fundraising_link?>">Support a revitalization project.</a></p>
</div>
<?php
$custom_title = '';
Expand Down
5 changes: 1 addition & 4 deletions wp-content/themes/blankslate-child/single-lexicons.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
<?php

$wikitongues_url = home_url();

header('Location: ' . $wikitongues_url . '/archive');
header('Location: ' . home_url('/archive', 'relative'));
5 changes: 1 addition & 4 deletions wp-content/themes/blankslate-child/single-partners.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
<?php

$wikitongues_url = home_url();

header('Location: ' . $wikitongues_url . '/');
header('Location: ' . home_url('/'));
5 changes: 1 addition & 4 deletions wp-content/themes/blankslate-child/single-reports.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
<?php

$wikitongues_url = home_url();

header('Location: ' . $wikitongues_url . '/reports');
header('Location: ' . home_url('/reports', 'relative'));
5 changes: 1 addition & 4 deletions wp-content/themes/blankslate-child/single-resources.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
<?php

$wikitongues_url = home_url();

header('Location: ' . $wikitongues_url . '/archive');
header('Location: ' . home_url('/archive', 'relative'));
5 changes: 1 addition & 4 deletions wp-content/themes/blankslate-child/single-team.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
<?php

$wikitongues_url = home_url();

header('Location: ' . $wikitongues_url . '/about/staff-and-volunteers/');
header('Location: ' . home_url('/about/staff-and-volunteers/', 'relative'));
4 changes: 2 additions & 2 deletions wp-content/themes/blankslate-child/single-videos.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@
$custom_selected_posts = '';
echo do_shortcode('[custom_gallery title="'.$custom_title.'" custom_class="'.$custom_class.'" post_type="'.$custom_post_type.'" columns="'.$custom_columns.'" posts_per_page="'.$custom_posts_per_page.'" orderby="'.$custom_orderby.'" order="'.$custom_order.'" pagination="'.$custom_pagination.'" meta_key="'.$custom_meta_key.'" meta_value="'.$custom_meta_value.'" selected_posts="'.$custom_selected_posts.'"]');

$cta_el = '<a href="'.home_url().'/submit-a-video">Contribute a video</a>';
$cta_el .= '<a href="'.home_url().'/wp-content/uploads/2024/09/Wikitongues-Recording-an-Oral-History-Sep-2024.pdf">How to create an oral history</a>';
$cta_el = '<a href="'.home_url('/submit-a-video', 'relative').'">Contribute a video</a>';
$cta_el .= '<a href="'.home_url('/wp-content/uploads/2024/09/Wikitongues-Recording-an-Oral-History-Sep-2024.pdf', 'relative').'">How to create an oral history</a>';
$gallery_cta = '<div class="custom-cta-container full"><section class="custom-gallery-video-cta">'.$cta_el.'</section></div>';
echo $gallery_cta;

Expand Down
Loading

0 comments on commit e75e9cf

Please sign in to comment.