Changeset 12067 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/archive-lesson-plan.php
- Timestamp:
- 09/15/2022 09:23:21 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/archive-lesson-plan.php
r11697 r12067 16 16 <main id="main" class="site-main"> 17 17 18 <?php 19 if ( '' === get_query_var( 'search' ) && empty( $_GET ) && is_post_type_archive() ) : 20 ?> 21 <section> 22 <div class="row align-middle between section-heading section-heading--with-space"> 23 <h1 class="section-heading_title h2"><?php esc_html_e( 'Lesson Plans', 'wporg-learn' ); ?></h1> 24 <a href="<?php echo esc_url( get_post_type_archive_link( 'lesson-plan' ) . '?_view=all' ); ?>" class="button button-xlarge button-secondary"> 25 <?php esc_html_e( 'Browse all lesson plans', 'wporg-learn' ); ?> 26 </a> 27 </div> 28 29 <hr> 30 31 <div class="row align-middle between section-lp_description"> 32 <p class="section-lp_text"> 33 <?php esc_html_e( 'Want to help others learn about WordPress? Read through, use, and remix these lesson plans.', 'wporg-learn' ); ?> 34 </p> 35 <?php 36 set_query_var( 'post_type', 'lesson-plan' ); 37 get_template_part( 'template-parts/component', 'archive-search' ); 38 ?> 39 </div> 40 41 <hr> 42 <?php 43 $categories = get_terms( 'wporg_lesson_category', array( 44 'hide_empty' => false, 45 'orderby' => 'id', 46 ) ); 47 ?> 48 <div class="row lp-taxonomy categories"> 49 <div class="card-grid card-grid_4"> 50 <h2 class="h4 lp-taxonomy-header"><?php echo esc_html__( 'Topic', 'wporg-learn' ); ?></h2> 51 <div class="lp-taxonomy-description"><?php echo esc_html__( 'Browse lesson plans by their high-level topic.', 'wporg-learn' ); ?></div> 52 <?php foreach ( $categories as $category ) : 53 $is_sticky = get_term_meta( $category->term_id, 'sticky', true ); 54 if ( $is_sticky ) : 55 ?> 56 <div class="card"> 57 <a href="<?php echo esc_url( get_term_link( $category ) ); ?>"> 58 <?php 59 $category_icon = get_term_meta( $category->term_id, 'dashicon-class', true ) ?? 'wordpress-alt'; 60 ?> 61 <div class="icon"> 62 <span class="dashicons dashicons-<?php echo esc_attr( $category_icon ); ?>"></span> 63 </div> 64 <p class="taxonomy-title"><?php echo esc_html( $category->name ); ?></p> 65 </a> 66 </div> 67 <?php 68 endif; 69 endforeach; ?> 70 </div> 71 </div> 72 73 <?php 74 $audiences = get_terms( 'audience', array( 75 'hide_empty' => false, 76 'orderby' => 'id', 77 ) ); 78 ?> 79 <div class="row lp-taxonomy"> 80 <div class="card-grid card-grid_4"> 81 <h2 class="h4 lp-taxonomy-header"><?php echo esc_html__( 'Audience', 'wporg-learn' ); ?></h2> 82 <div class="lp-taxonomy-description"><?php echo esc_html__( "Browse lesson plans by the audience they're intended for.", 'wporg-learn' ); ?></div> 83 <?php foreach ( $audiences as $audience ) : 84 $is_sticky = get_term_meta( $audience->term_id, 'sticky', true ); 85 if ( $is_sticky ) : 86 ?> 87 <div class="card"> 88 <a href="<?php echo esc_url( get_term_link( $audience ) ); ?>"> 89 <div class="icon"> 90 <?php 91 $audience_icon = get_term_meta( $audience->term_id, 'dashicon-class', true ) ?? 'wordpress-alt'; 92 ?> 93 <span class="dashicons dashicons-<?php echo esc_attr( $audience_icon ); ?>"></span> 94 </div> 95 <p class="taxonomy-title"><?php echo esc_html( $audience->name ); ?></p> 96 </a> 97 </div> 98 <?php 99 endif; 100 endforeach; ?> 101 </div> 102 </div> 103 104 <div class="row lp-two-col between"> 105 <div class="lp-taxonomy"> 106 <h2 class="h4 lp-taxonomy-header"><?php echo esc_html__( 'Level', 'wporg-learn' ); ?></h2> 107 <div class="lp-taxonomy-description"><?php echo esc_html__( 'What experience partipants need.', 'wporg-learn' ); ?></div> 108 <ul class="lp-two-col-list"> 109 <?php 110 $levels = get_terms( 'level', array( 111 'hide_empty' => false, 112 'orderby' => 'id', 113 ) ); 114 115 foreach ( $levels as $level ) : ?> 116 <li><a href="<?php echo esc_url( get_post_type_archive_link( 'lesson-plan' ) ) . '?level[]=' . esc_html( $level->term_id ); ?>"><?php echo esc_html( $level->name ); ?><span class="dashicons dashicons-arrow-right-alt2"></span></a></li> 117 <?php 118 endforeach; 119 ?> 120 </ul> 121 </div> 122 123 <div class="lp-duration"> 124 <h2 class="h4 lp-taxonomy-header"><?php echo esc_html__( 'Duration', 'wporg-learn' ); ?></h2> 125 <div class="lp-taxonomy-description"><?php echo esc_html__( 'How long a lesson is estimated to take.', 'wporg-learn' ); ?></div> 126 <ul class="lp-two-col-list"> 127 <?php 128 $durations = get_terms( 'duration', array( 129 'hide_empty' => false, 130 'orderby' => 'name', 131 'order' => 'ASC', 132 ) ); 133 134 $duration_index = 0; 135 $any_duration_arr = array(); 136 $lp_archive_url = get_post_type_archive_link( 'lesson-plan' ); 137 foreach ( $durations as $duration ) : 138 if ( $duration_index < 3 ) : 139 ?> 140 <li> 141 <a href="<?php echo esc_url( add_query_arg( array( 'duration[]' => $duration->term_id ), $lp_archive_url ) ); ?>"> 142 <?php echo esc_html( $duration->name ); ?><span class="dashicons dashicons-arrow-right-alt2"></span> 143 </a> 144 </li> 145 <?php 146 else : 147 $any_duration_arr['duration'][] = $duration->term_id; 148 endif; 149 $duration_index++; 150 endforeach; 151 152 if ( $any_duration_arr['duration'] ) : 153 ?> 154 <li> 155 <a href="<?php echo esc_url( add_query_arg( $any_duration_arr, $lp_archive_url ) ); ?>"> 156 <?php echo esc_html__( 'Any (over 60m)', 'wporg-learn' ); ?><span class="dashicons dashicons-arrow-right-alt2"></span> 157 </a> 158 </li> 159 <?php 160 endif; 161 ?> 162 </ul> 163 </div> 164 </div> 165 166 <?php 167 $instruction_types = get_terms( 'instruction_type', array( 168 'hide_empty' => false, 169 'orderby' => 'id', 170 ) ); 171 ?> 172 <div class="row lp-taxonomy"> 173 <div class="card-grid card-grid_4"> 174 <h2 class="h4 lp-taxonomy-header"><?php echo esc_html__( 'Format', 'wporg-learn' ); ?></h2> 175 <div class="lp-taxonomy-description"><?php echo esc_html__( 'Browse lesson plans based on their format.', 'wporg-learn' ); ?></div> 176 <?php foreach ( $instruction_types as $instruction_type ) : ?> 177 <div class="card"> 178 <p class="taxonomy-title"><a href="<?php echo esc_url( get_post_type_archive_link( 'lesson-plan' ) ) . '?type[]=' . esc_html( $instruction_type->term_id ); ?>"><?php echo esc_html( $instruction_type->name ); ?></a></p> 179 </div> 180 <?php endforeach; ?> 181 </div> 182 </div> 183 184 <hr> 185 186 <div class="row align-middle around lp-cta"> 187 <a href="<?php echo esc_url( get_post_type_archive_link( 'lesson-plan' ) . '?_view=all' ); ?>" class="button button-xlarge button-secondary"> 188 <?php esc_html_e( 'Browse all lesson plans', 'wporg-learn' ); ?> 189 </a> 190 </div> 191 </section> 192 193 <?php else : ?> 18 194 <section> 19 195 <div class="row align-middle between section-heading section-heading--with-space"> … … 24 200 <hr> 25 201 26 <div class=" row gutters between">202 <div class="lp-archive-items row gutters between"> 27 203 <div class="card-grid col-9"> 28 204 <?php if ( have_posts() ) : ?> … … 50 226 51 227 <?php get_template_part( 'template-parts/component', 'submit-idea-cta' ); ?> 228 <?php endif; ?> 229 52 230 </main> 53 231
Note: See TracChangeset
for help on using the changeset viewer.