current progress

This commit is contained in:
prospect
2023-12-26 22:56:58 -05:00
commit 7843c7b084
99 changed files with 42808 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
<?php
function themeStarter_editor_enqueue()
{
add_theme_support('editor-styles');
add_editor_style([
'assets/css/styles.css',
'assets/css/bootstrap-icons.css',
'assets/css/font-awesome.css'
]);
}

View File

@@ -0,0 +1,64 @@
<?php
// Get List of Sub Categories for Slug
function getSubpagesForSlug($arrayOfWPPages, $slug)
{
foreach ($arrayOfWPPages as $page) {
if ($page['page']->post_name === $slug) {
return $page['subpages'];
}
}
// Return an empty array if the slug is not found
return [];
}
// Return WordPress Page For A Slug
function getPageForSlug($arrayOfWPPages, $slug)
{
foreach ($arrayOfWPPages as $page) {
if ($page['page']->post_name === $slug) {
return $page['page'];
}
foreach ($page['subpages'] as $index => $subpage) {
if ($subpage->post_name === $slug) {
return $page['subpages'][$index];
}
}
}
// Return an empty array if the slug is not found
return [];
}
function ddd($variable)
{
echo '<pre>';
var_dump($variable);
echo '<pre>';
}
// Get An Array of Top Level Pages and their Subpages
function get_pages_as_array()
{
$pages = get_pages();
$page_hierarchy = array();
foreach ($pages as $page) {
$parent_id = $page->post_parent;
// If it's a top-level page
if ($parent_id == 0) {
$page_hierarchy[$page->ID] = array(
'page' => $page,
'subpages' => array()
);
} else {
// If it's a child page, add it under its parent
$page_hierarchy[$parent_id]['subpages'][] = $page;
}
}
return $page_hierarchy;
}

View File

@@ -0,0 +1,19 @@
<?php
// Change Login Page header url
function ourHeaderUrl()
{
return esc_url(site_url('/'));
}
// Make login title the name of our website
function ourLoginTitle()
{
return get_bloginfo('name');
}
// Enqueue out stylesheet for login screen
function ourLoginCSS()
{
wp_enqueue_style('login styles', get_theme_file_uri('/assets/css/styles.css'));
}

View File

@@ -0,0 +1,101 @@
<?php
$menuData = [
// Goals and Objectives
[
'slug' => 'goals-and-objectives',
'title' => 'Goals and Objectives',
'description' => 'Clarify aspirations, set achievable targets, and foster personal growth.',
'subcategories' => [
['title' => 'Career Goals', 'slug' => 'career-goals', 'description' => 'What kind of work you would like to do'],
['title' => 'Educational Goals', 'slug' => 'educational-goals', 'description' => 'To get the career and life you want'],
['title' => 'Financial Goals', 'slug' => 'financial-goals', 'description' => 'Will help you achieve your other goals'],
['title' => 'Personal Goals', 'slug' => 'personal-goals', 'description' => 'What you want for yourself in life'],
],
'bootstrap_icon' => 'bi-bullseye',
],
// Preparing for College or University
[
'slug' => 'preparing-for-college-and-university',
'title' => 'Preparing for College and University',
'description' => 'Navigate academia successfully with insights on admissions, majors, and preparation.',
'subcategories' => [
['title' => 'Applying to Post Secondary', 'slug' => 'applying-to-post-secondary', 'description' => ''],
['title' => 'Education Level Differences', 'slug' => 'education-level-differences', 'description' => ''],
['title' => 'Online Learning and Remote Work', 'slug' => 'online-learning-and-remote-work', 'description' => ''],
['title' => 'Strategies For Success', 'slug' => 'strategies-for-success', 'description' => ''],
['title' => 'Support and Accommodations', 'slug' => 'support-and-accommodations', 'description' => ''],
],
'bootstrap_icon' => 'bi-journal-bookmark-fill',
],
// Managing Your Finances
[
'slug' => 'managing-your-finances',
'title' => 'Managing Your Finances',
'description' => 'Master budgeting, savings, and financial literacy for a secure financial future.',
'subcategories' => [
['title' => 'Band Funding', 'slug' => 'band-funding', 'description' => ''],
['title' => 'Budgeting Your Money', 'slug' => 'budgeting-your-money', 'description' => ''],
['title' => 'Financial Awards For Students With Special Needs', 'slug' => 'special-needs-financial-awards', 'description' => ''],
['title' => 'Grants, Bursaries and Loans', 'slug' => 'grants-bursaries-and-loans', 'description' => ''],
['title' => 'Income Tax', 'slug' => 'income-tax', 'description' => ''],
['title' => 'Tips To Increase Income', 'slug' => 'tips-to-increase-income', 'description' => ''],
['title' => 'Tips To Reduce Expenses', 'slug' => 'tips-to-reduce-expenses', 'description' => ''],
],
'bootstrap_icon' => 'bi-cash-coin',
],
// Daily Living and Housing
[
'slug' => 'daily-living-and-housing',
'title' => 'Daily Living and Housing',
'description' => 'Tips for independent living, housing options, and creating a comfortable daily routine.',
'subcategories' => [
['title' => 'Before Signing The Lease', 'slug' => 'before-signing-the-lease', 'description' => ''],
['title' => 'Finding A Place To Stay', 'slug' => 'finding-a-place-to-stay', 'description' => ''],
['title' => 'First Time Renting FAQs', 'slug' => 'first-time-renting-faqs', 'description' => ''],
['title' => 'House vs. Apartment', 'slug' => 'house-vs-apartment', 'description' => ''],
['title' => 'Off Campus Housing', 'slug' => 'off-campus-housing', 'description' => ''],
['title' => 'Students With Children', 'slug' => 'students-with-children', 'description' => ''],
['title' => 'Transportation', 'slug' => 'transportation', 'description' => ''],
],
'bootstrap_icon' => 'bi-building',
],
// Mental Health and Wellness
[
'slug' => 'mental-health-and-wellness',
'title' => 'Mental Health and Wellness',
'description' => 'Prioritize well-being with strategies for mental health, stress management, and resilience.',
'subcategories' => [
['title' => 'Gender Identity and Sexual Orientation', 'slug' => 'gender-identity-and-sexual-orientation', 'description' => ''],
['title' => 'Living In Balance', 'slug' => 'living-in-balance', 'description' => ''],
['title' => 'Making Healthy Choices', 'slug' => 'making-healthy-choices', 'description' => ''],
['title' => 'Managing Stress', 'slug' => 'managing-stress', 'description' => ''],
['title' => 'Physical Health', 'slug' => 'physical-health', 'description' => ''],
['title' => 'Safety', 'slug' => 'safety', 'description' => ''],
['title' => 'Sexual Health', 'slug' => 'sexual-health', 'description' => ''],
['title' => 'Stay in Touch', 'slug' => 'stay-in-touch', 'description' => ''],
],
'bootstrap_icon' => 'bi-heart-pulse-fill',
],
// Forms and Additional Information
[
'slug' => 'resources-and-additional-information',
'title' => 'Resources and Additional Information',
'description' => 'Access a wealth of tools, guides, and external links for comprehensive support.',
'subcategories' => [
['title' => 'NAN Map', 'slug' => 'nan-map', 'description' => ''],
['title' => 'NAN Tribe Councils', 'slug' => 'nan-tribe-councils', 'description' => ''],
['title' => 'Ontario Native Education Counseling Associations', 'slug' => 'ontario-native-education-counseling-associations', 'description' => ''],
['title' => 'Resources Samples', 'slug' => 'resources-samples', 'description' => ''],
['title' => 'Understanding Your Treaties', 'slug' => 'understanding-your-treaties', 'description' => ''],
],
'bootstrap_icon' => 'bi-info-circle-fill',
],
];

View File

@@ -0,0 +1,13 @@
<?php
// Change Registration Message
function change_reg_message($message)
{
// change messages that contain 'Register'
if (strpos($message, 'Register') !== FALSE) {
$newMessage = "Register with " . get_bloginfo('name');
return '<p class="message register">' . $newMessage . '</p>';
} else {
return $message;
}
}

View File

@@ -0,0 +1,23 @@
<?php
// Enqueue styles and scripts
function themeStarter_enqueue()
{
/* Register and Enqueue Scripts */
wp_register_script('themeStarter-app', get_parent_theme_file_uri('/assets/js/index.js'), [], '1.0', true);
wp_enqueue_script('themeStarter-app');
/* Register and Enqueue Styles */
wp_register_style('themeStarter-styles', get_parent_theme_file_uri('/assets/css/styles.css'), [], '1.0', 'all');
wp_enqueue_style('themeStarter-styles');
wp_register_style('bootstrap-icons', get_parent_theme_file_uri('/assets/css/bootstrap-icons.css'), [], '1.11.1', 'all');
wp_enqueue_style('bootstrap-icons');
wp_register_style('font-awesome', get_parent_theme_file_uri('/assets/css/font-awesome.css'), [], '6.4.2', 'all');
wp_enqueue_style('font-awesome');
}

View File

@@ -0,0 +1,35 @@
<?php
function open_graph_twitter_card()
{
// Get the post or page ID
$post_id = get_the_ID();
// Get the post or page title
$title = get_the_title($post_id);
// Get the post or page excerpt (description)
$description = (get_the_excerpt()) ? get_the_excerpt() : get_bloginfo('description');
// Get the post or page URL
$url = get_permalink($post_id);
// Set default image url
$default_image_url = get_theme_file_uri('/screenshot.png');
// Get the post thumbnail (featured image) URL
$thumbnail = get_the_post_thumbnail_url($post_id);
?>
<!-- Open Graph meta tags -->
<meta property="og:title" content="<?php echo $title . ' - ' . get_bloginfo('name'); ?>" />
<meta property="og:description" content="<?php echo $description ?>" />
<meta property="og:url" content="<?php echo $url ?>" />
<meta property="og:image" content="<?php echo $default_image_url ?>" />
<!-- Twitter Card meta tags -->
<meta name="twitter:card" content="summary" />
<meta name="twitter:title" content="<?php echo $title . ' - ' . get_bloginfo('name'); ?>" />
<meta name="twitter:description" content="<?php echo $description ?>" />
<meta name="twitter:image" content="<?php echo $default_image_url ?>" />
<?php
}

View File

@@ -0,0 +1,79 @@
<?php
function themeStarter_setup()
{
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
*/
load_theme_textdomain('themeStarter', get_template_directory() . '/languages');
// Add default posts and comments RSS feed links to head.
add_theme_support('automatic-feed-links');
/*
* Let WordPress manage the document title.
*/
add_theme_support('title-tag');
/*
* Enable support for Post Thumbnails on posts and pages.
*/
add_theme_support('post-thumbnails');
//Support custom logo
add_theme_support('custom-logo');
// Add menus.
register_nav_menus(
array(
'primary' => __('Primary Menu', 'themeStarter'),
'secondary' => __('Secondary Menu', 'themeStarter'),
)
);
/*
* Switch default core markup for search form, comment form, and comments
* to output valid HTML5.
*/
add_theme_support(
'html5',
array(
'search-form',
'comment-form',
'comment-list',
'gallery',
'caption',
'style',
'script'
)
);
/*
* Enable support for Post Formats.
*/
add_theme_support(
'post-formats',
array(
'aside',
'image',
'video',
'quote',
'link',
'gallery',
'status',
'audio',
'chat'
)
);
}
function themeStarter_init()
{
// Use categories and tags with attachments
register_taxonomy_for_object_type('category', 'attachment');
register_taxonomy_for_object_type('post_tag', 'attachment');
}