From 644954b5e48de0a36635d78218d5450fc9838e1a Mon Sep 17 00:00:00 2001 From: prospect Date: Thu, 18 Jan 2024 18:54:23 -0500 Subject: [PATCH] search complete --- 404.php | 8 +-- assets/css/styles.css | 37 +++------- front-page.php | 2 +- functions.php | 6 +- header.php | 5 +- includes/back-end/template_content_update.php | 54 +++++++++++++++ page.php | 3 +- search.php | 68 +++++++++++++------ searchform.php | 17 ++--- templates/internal/budgeting-your-money.php | 8 +-- .../internal/education-level-differences.php | 4 +- templates/internal/managing-stress.php | 4 +- .../online-learning-and-remote-work.php | 4 +- templates/internal/strategies-for-success.php | 4 +- 14 files changed, 139 insertions(+), 85 deletions(-) create mode 100644 includes/back-end/template_content_update.php diff --git a/404.php b/404.php index 7f3661a..c9e778d 100644 --- a/404.php +++ b/404.php @@ -1,9 +1,9 @@ -
+
-
+
@@ -17,7 +17,7 @@
-
+

Visit category pages

@@ -45,7 +45,7 @@
-
+

Go home

diff --git a/assets/css/styles.css b/assets/css/styles.css index bbe8ee0..e74e1c2 100644 --- a/assets/css/styles.css +++ b/assets/css/styles.css @@ -972,11 +972,6 @@ select { margin-bottom: 1rem; } -.my-8 { - margin-top: 2rem; - margin-bottom: 2rem; -} - .mb-2 { margin-bottom: 0.5rem; } @@ -1093,6 +1088,10 @@ select { max-width: 36rem; } +.max-w-full { + max-width: 100%; +} + .flex-1 { flex: 1 1 0%; } @@ -1437,10 +1436,6 @@ select { padding-bottom: 7rem; } -.pb-32 { - padding-bottom: 8rem; -} - .pb-4 { padding-bottom: 1rem; } @@ -1465,14 +1460,14 @@ select { padding-top: 6rem; } -.pt-28 { - padding-top: 7rem; -} - .pt-4 { padding-top: 1rem; } +.text-left { + text-align: left; +} + .text-center { text-align: center; } @@ -1731,9 +1726,6 @@ html { .lg\:grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); } - .lg\:flex-row { - flex-direction: row; - } .lg\:flex-col { flex-direction: column; } @@ -1748,16 +1740,6 @@ html { margin-right: calc(2rem * var(--tw-space-x-reverse)); margin-left: calc(2rem * (1 - var(--tw-space-x-reverse))); } - .lg\:space-x-4 > :not([hidden]) ~ :not([hidden]) { - --tw-space-x-reverse: 0; - margin-right: calc(1rem * var(--tw-space-x-reverse)); - margin-left: calc(1rem * (1 - var(--tw-space-x-reverse))); - } - .lg\:space-y-0 > :not([hidden]) ~ :not([hidden]) { - --tw-space-y-reverse: 0; - margin-top: calc(0px * (1 - var(--tw-space-y-reverse))); - margin-bottom: calc(0px * var(--tw-space-y-reverse)); - } .lg\:px-2 { padding-left: 0.5rem; padding-right: 0.5rem; @@ -1770,9 +1752,6 @@ html { padding-top: 2rem; padding-bottom: 2rem; } - .lg\:text-left { - text-align: left; - } .lg\:text-center { text-align: center; } diff --git a/front-page.php b/front-page.php index b7f91da..da17b5e 100644 --- a/front-page.php +++ b/front-page.php @@ -29,7 +29,7 @@ require_once(get_theme_file_path('/includes/back-end/helper_functions.php')); ?> -
  • +
  • diff --git a/functions.php b/functions.php index 853753a..fb89b70 100644 --- a/functions.php +++ b/functions.php @@ -5,6 +5,7 @@ // <----- Includes -----> include(get_theme_file_path('/includes/front-end/theme_starter_setup.php')); include(get_theme_file_path('/includes/front-end/styles_and_scripts.php')); +include(get_theme_file_path('/includes/back-end/template_content_update.php')); include(get_theme_file_path('/includes/back-end/editor_styles_and_scripts.php')); include(get_theme_file_path('/includes/front-end/technical_seo.php')); include(get_theme_file_path('/includes/front-end/registration_form_message.php')); @@ -25,6 +26,9 @@ add_action('wp_enqueue_scripts', 'themeStarter_enqueue'); // Enqueue back-end/editor styles and script add_action('after_setup_theme', 'themeStarter_editor_enqueue'); +// Hook the function to run when you visit the WordPress admin area +// add_action('admin_init', 'update_page_content_from_file'); + // Add Facebook Open Graph and Twitter Card to Head add_action('wp_head', 'open_graph_twitter_card', 2); @@ -38,4 +42,4 @@ add_filter('login_headertitle', 'ourLoginTitle'); add_filter('login_headerurl', 'ourHeaderUrl'); // Enqueue out stylesheet for login screen -add_action('login_enqueue_scripts', 'ourLoginCSS'); \ No newline at end of file +add_action('login_enqueue_scripts', 'ourLoginCSS'); diff --git a/header.php b/header.php index 34d4261..d77dc38 100644 --- a/header.php +++ b/header.php @@ -34,10 +34,7 @@ -
    -
    - -
    +
    diff --git a/includes/back-end/template_content_update.php b/includes/back-end/template_content_update.php new file mode 100644 index 0000000..e19308b --- /dev/null +++ b/includes/back-end/template_content_update.php @@ -0,0 +1,54 @@ +post_name; +// $file_path = get_template_directory() . '/templates/internal/' . $slug . '.php'; + +// // Check if the file exists +// if (file_exists($file_path)) { +// // Read the content from the file +// $file_content = file_get_contents($file_path); + +// // Update the page content +// wp_update_post(array( +// 'ID' => $page->ID, +// 'post_content' => $file_content, +// )); +// } +// } +// } + +function update_page_content_from_file() +{ + // Get all pages + $pages = get_pages(); + + foreach ($pages as $page) { + $slug = $page->post_name; + $file_path = get_template_directory() . '/templates/internal/' . $slug . '.php'; + + // Check if the file exists + if (file_exists($file_path)) { + // Start output buffering to capture PHP output + ob_start(); + + // Include the file to execute its PHP code + include($file_path); + + // Get the output and clean the output buffer + $file_content = ob_get_clean(); + + // Update the page content + wp_update_post(array( + 'ID' => $page->ID, + 'post_content' => $file_content, + )); + } + } +} + diff --git a/page.php b/page.php index e7fc156..9c67dc1 100644 --- a/page.php +++ b/page.php @@ -40,7 +40,8 @@ get_header(); ?> get_template_part('/templates/partials/page_header'); ?>
    - + +
    -
    +
    -
    +
    -
    - - -

    Error 404

    -
    - NAN Logo -

    Page not found...

    -
    +
    + + + NAN Logo +

    Search

    + + + +
    +

    Results for "" ()

    +
    +
    -
    +
    + + + + +
    +

    + No results for "" +

    +
    + + + +
    + + +

    Visit category pages

    @@ -44,15 +81,6 @@
    - -
    diff --git a/searchform.php b/searchform.php index aa6f648..f2165e9 100644 --- a/searchform.php +++ b/searchform.php @@ -1,13 +1,4 @@ - - - - -
    -
    - -

    Search Form

    -
    -
    - - - \ No newline at end of file +
    +
    + +
    \ No newline at end of file diff --git a/templates/internal/budgeting-your-money.php b/templates/internal/budgeting-your-money.php index 162d3d8..0827eaf 100644 --- a/templates/internal/budgeting-your-money.php +++ b/templates/internal/budgeting-your-money.php @@ -38,9 +38,9 @@
    - +