Changeset 1981747
- Timestamp:
- 11/28/2018 06:49:17 AM (7 years ago)
- Location:
- better-amp/trunk
- Files:
-
- 11 edited
-
better-amp.php (modified) (2 diffs)
-
includes/classes/class-better-amp-better-rewrite-rules.php (modified) (2 diffs)
-
includes/classes/class-better-amp-content-sanitizer.php (modified) (8 diffs)
-
includes/classes/class-better-amp-redirect-router.php (modified) (7 diffs)
-
includes/components/class-better-amp-iframe-component.php (modified) (3 diffs)
-
includes/functions/theme-functions.php (modified) (4 diffs)
-
readme.txt (modified) (1 diff)
-
template/css/archive.css (modified) (2 diffs)
-
template/css/archive.min.css (modified) (1 diff)
-
template/taxonomy-product_tag.php (modified) (1 diff)
-
template/views/archive/title.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
better-amp/trunk/better-amp.php
r1977493 r1981747 5 5 Description: Add FULL AMP support to your WordPress site. 6 6 Author: Better Studio 7 Version: 1.9. 47 Version: 1.9.5 8 8 Author URI: http://betterstudio.com 9 9 */ … … 53 53 * @since 1.0.0 54 54 */ 55 const VERSION = '1.9. 4';55 const VERSION = '1.9.5'; 56 56 57 57 -
better-amp/trunk/includes/classes/class-better-amp-better-rewrite-rules.php
r1977493 r1981747 60 60 61 61 add_filter( 'rewrite_rules_array', array( $this, 'fix_end_point_rewrites' ), 100 ); 62 } 63 62 add_filter( 'category_rewrite_rules', array( $this, 'append_category_missing_rules' ), 100 ); 63 64 add_action( 'init', array( $this, 'append_rewrite_rules_filters' ) ); 65 } 64 66 65 67 /** … … 144 146 return array_merge( $high_level_rules, $rules ); 145 147 } 148 149 /** 150 * Append some rewrite rules that add_rewrite_endpoint should do that 151 * 152 * todo: add support for custom taxonomies 153 * 154 * @param array $rules 155 * 156 * @since 1.9.4 157 * @return array 158 */ 159 public function append_category_missing_rules( $rules ) { 160 161 global $wp_rewrite; 162 163 $pattern = trim( 164 str_replace( $wp_rewrite->rewritecode, $wp_rewrite->rewritereplace, $wp_rewrite->get_category_permastruct() ), 165 '/' 166 ); 167 $pattern .= '/' . Better_AMP::SLUG; 168 $pattern .= '/page/?([0-9]{1,})/?$'; 169 170 $rules = array_merge( array( 171 $pattern => $wp_rewrite->index . '?category_name=$matches[1]&paged=$matches[2]&' . Better_AMP::SLUG . '=' 172 ), $rules ); 173 174 return $rules; 175 } 176 177 /** 178 * Add some filters to generate rules for custom taxonomies. 179 * 180 * @since 1.9.5 181 */ 182 public function append_rewrite_rules_filters() { 183 184 global $wp_rewrite; 185 186 187 if ( ! isset( $wp_rewrite->extra_permastructs ) ) { 188 return; 189 } 190 191 $skip = array( 'post_tag', 'post_format', 'category' ); 192 $callback = array( $this, 'append_missing_taxonomy_permastructs' ); 193 194 foreach ( $wp_rewrite->extra_permastructs as $permastructname => $_ ) { 195 196 if ( in_array( $permastructname, $skip ) ) { 197 continue; 198 } 199 200 if ( ! taxonomy_exists( $permastructname ) ) { 201 continue; 202 } 203 204 add_filter( $permastructname . '_rewrite_rules', $callback ); 205 } 206 } 207 208 209 /** 210 * Append AMP rewrite rules for custom taxonomies. 211 * 212 * @param array $rules 213 * 214 * @since 1.9.5 215 * @return array 216 */ 217 public function append_missing_taxonomy_permastructs( $rules ) { 218 219 $amp_rules = array(); 220 $next_page = '/page/?([0-9]{1,})/'; 221 222 foreach ( $rules as $match => $query ) { 223 224 // Do not generate amp end-point rule for feeds 225 if ( strstr( $query, '&feed=' ) ) { 226 continue; 227 } 228 229 $e = explode( $next_page, $match ); 230 231 if ( isset( $e[1] ) ) { 232 233 $pattern = $e[0] . '/' . BETTER_AMP::SLUG . $next_page . $e[1]; 234 235 $amp_rules[ $pattern ] = $query . '&' . BETTER_AMP::SLUG . '='; 236 237 } elseif ( substr( $match, - 3 ) === '/?$' ) { 238 239 $pattern = substr( $match, 0, - 3 ); 240 $pattern .= '/' . BETTER_AMP::SLUG . '/?$'; 241 242 $amp_rules[ $pattern ] = $query . '&' . BETTER_AMP::SLUG . '='; 243 } 244 } 245 246 return array_merge( $amp_rules, $rules ); 247 } 146 248 } -
better-amp/trunk/includes/classes/class-better-amp-content-sanitizer.php
r1977493 r1981747 441 441 * 442 442 * @param string $url 443 * 443 * @param bool $strict 444 * 445 * @return string transformed none-amp url on success or passed $url otherwise. 444 446 * @since 1.0.0 445 447 * 446 * @return string transformed none-amp url on success or passed $url otherwise. 447 */ 448 public static function transform_to_none_amp_url( $url ) { 448 */ 449 public static function transform_to_none_amp_url( $url, $strict = false ) { 449 450 450 451 if ( ! better_amp_using_permalink_structure() ) { … … 453 454 } 454 455 456 if ( $strict ) { 457 458 $url = self::remove_end_point_amp( $url, $url ); 459 $url = self::remove_start_point_amp( $url, $url ); 460 461 return $url; 462 } 463 455 464 if ( better_amp_url_format() === 'end-point' ) { 456 465 … … 474 483 /** 475 484 * @param string $url 485 * @param mixed $default 476 486 * 477 487 * @return bool|string none amp url on success or false on error. 478 488 */ 479 public static function remove_start_point_amp( $url ) { 489 public static function remove_start_point_amp( $url, $default = false ) { 490 491 if ( empty( $url ) ) { 492 return $default; 493 } 480 494 481 495 $prefix = better_amp_permalink_prefix(); … … 483 497 if ( ! preg_match( '#^https?://w*\.?' . self::regex_url() . '/?' . $prefix . '([^/]*)/?(.*?)$#', $url, $matched ) ) { 484 498 485 return false;499 return $default; 486 500 } 487 501 … … 489 503 if ( $matched[1] !== Better_AMP::SLUG ) { 490 504 491 return false;505 return $default; 492 506 } 493 507 … … 507 521 /** 508 522 * @param string $url 509 * 510 * @return bool|string none amp url on success or false on error. 511 */ 512 public static function remove_end_point_amp( $url ) { 523 * @param mixed $default 524 * 525 * @return mixed none amp url on success or $default on error. 526 */ 527 public static function remove_end_point_amp( $url, $default = false ) { 528 529 if ( empty( $url ) ) { 530 return $default; 531 } 513 532 514 533 if ( ! preg_match( '#^https?://w*\.?' . self::regex_url() . '/?#', $url ) ) { 515 534 516 return false;535 return $default; 517 536 } 518 537 … … 520 539 521 540 if ( empty( $parsed['path'] ) ) { 522 return false;541 return $default; 523 542 } 524 543 525 544 if ( basename( $parsed['path'] ) !== Better_AMP::SLUG ) { 526 545 527 return self::single_post_pagination_none_amp_url( $parsed['path'] ); 546 if ( $transformed = self::single_post_pagination_none_amp_url( $parsed['path'] ) ) { 547 548 return $transformed; 549 } 550 551 if ( $transformed = self::pagination_none_amp_url( $parsed['path'] ) ) { 552 553 return $transformed; 554 } 555 556 return $default; 528 557 } 529 558 … … 563 592 564 593 return home_url( $none_amp_request_url . $page_number ); 594 } 595 596 return false; 597 } 598 599 600 /** 601 * Remove AMP end-point in paginated pages. 602 * 603 * @param string $url_path 604 * 605 * @since 1.9.5 606 * @return bool|string 607 */ 608 public static function pagination_none_amp_url( $url_path ) { 609 610 if ( preg_match( '#(.+)/' . Better_AMP::SLUG . '(/page/\d+/?)#', $url_path, $match ) ) { 611 612 return home_url( $match[1] . $match[2] ); 565 613 } 566 614 -
better-amp/trunk/includes/classes/class-better-amp-redirect-router.php
r1977493 r1981747 9 9 * @var self 10 10 * 11 * @since 1.9. 511 * @since 1.9.4 12 12 */ 13 13 protected static $instance; … … 19 19 * @var string 20 20 * 21 * @since 1.9. 521 * @since 1.9.4 22 22 */ 23 23 protected $query_var; … … 29 29 * @var string 30 30 * 31 * @since 1.9. 531 * @since 1.9.4 32 32 */ 33 33 protected $request_url; … … 37 37 * Get singleton instance of the class. 38 38 * 39 * @since 1.9. 539 * @since 1.9.4 40 40 * @return self 41 41 */ … … 55 55 * Initialize the module. 56 56 * 57 * @since 1.9. 557 * @since 1.9.4 58 58 */ 59 59 public function init() { … … 86 86 $this->request_url = str_replace( bf_get_wp_installation_slug(), '', $_SERVER['REQUEST_URI'] ); 87 87 88 if ( better_amp_url_format() === 'start-point' ) { 89 90 $new_amp_url = $this->transform_to_start_point_url(); 88 if ( ! Better_AMP::get_instance()->amp_version_exists() ) { 89 90 $new_url = Better_AMP_Content_Sanitizer::transform_to_none_amp_url( better_amp_get_canonical_url(), true ); 91 92 } elseif ( better_amp_url_format() === 'start-point' ) { 93 94 $new_url = $this->transform_to_start_point_url(); 91 95 92 96 } else { 93 97 94 $new_ amp_url = $this->transform_to_end_point_url();95 } 96 97 if ( $this->can_redirect_url( $new_ amp_url ) ) {98 99 wp_redirect( $new_ amp_url, 301 );98 $new_url = $this->transform_to_end_point_url(); 99 } 100 101 if ( $this->can_redirect_url( $new_url ) ) { 102 103 wp_redirect( $new_url, 301 ); 100 104 exit; 101 105 } … … 105 109 * Whether to check ability to redirect user to given url. 106 110 * 107 * @since 1.9. 5111 * @since 1.9.4 108 112 * 109 113 * @param $url -
better-amp/trunk/includes/components/class-better-amp-iframe-component.php
r1975869 r1981747 86 86 case 'youtube': 87 87 88 $video_id = false; 89 90 if ( preg_match( '#https?://(?:(?:m|www)\.)?youtube\.com/watch\?(.*)#i', $url, $matched ) ) { 91 92 parse_str( $matched[1], $vars ); 93 94 if ( ! empty( $vars['v'] ) ) { 95 96 $video_id = $vars['v']; 97 } 98 99 } elseif ( preg_match( '#https?://(?:(?:m|www)\.)?youtube\.com/embed/([^\/]+)#i', $url, $matched ) ) { 100 101 $video_id = $matched[1]; 102 } 103 104 if ( $video_id ) { 88 if ( $video_id = self::extract_youtube_video_id( $url ) ) { 105 89 106 90 $dim = $this->get_iframe_dimension( $html, 'height', 'width', $options ); … … 108 92 return $this->amp_youtube_html( $video_id, $dim[0], $dim[1] ); 109 93 } 94 110 95 break; 111 96 … … 581 566 return $output; 582 567 } 568 569 /** 570 * Grab the video ID from given youtube URL. 571 * 572 * @param string $url 573 * 574 * @since 1.9.5 575 * @return string video id on success or empty string on failure. 576 */ 577 public static function extract_youtube_video_id( $url ) { 578 579 $video_id = ''; 580 581 if ( preg_match( '#https?://(?:(?:m|www)\.)?youtube\.com/watch\?(.*)#i', $url, $matched ) ) { 582 583 parse_str( $matched[1], $vars ); 584 585 if ( ! empty( $vars['v'] ) ) { 586 587 $video_id = $vars['v']; 588 } 589 590 } elseif ( preg_match( '#https?://(?:(?:m|www)\.)?youtube\.com/embed/([^\/\?\&]+)#i', $url, $matched ) ) { 591 592 $video_id = $matched[1]; 593 594 } elseif ( preg_match( '#https?://(?:(?:m|www)\.)?youtu\.be/([^\/\?\&]+)#i', $url, $matched ) ) { 595 596 $video_id = $matched[1]; 597 } 598 599 return $video_id; 600 } 583 601 } 584 602 -
better-amp/trunk/includes/functions/theme-functions.php
r1973642 r1981747 1007 1007 function better_amp_get_canonical_url() { 1008 1008 1009 $canonical = ''; 1010 1011 if ( is_singular() ) { 1012 1013 $queried = get_queried_object(); 1014 1015 $canonical = get_permalink( $queried->ID ); 1016 1017 /** 1018 * Fix paginated pages canonical. 1019 */ 1020 if ( get_query_var( 'page' ) > 1 ) { 1021 $num_pages = ( substr_count( $queried->post_content, '<!--nextpage-->' ) + 1 ); 1022 if ( $num_pages && get_query_var( 'page' ) <= $num_pages ) { 1023 if ( ! $GLOBALS['wp_rewrite']->using_permalinks() ) { 1024 $canonical = add_query_arg( 'page', get_query_var( 'page' ), $canonical ); 1025 } else { 1026 $canonical = user_trailingslashit( trailingslashit( $canonical ) . get_query_var( 'page' ) ); 1027 } 1028 } 1029 } 1030 1031 } elseif ( is_search() ) { 1032 1033 $search_query = get_search_query(); 1034 1035 // Regex catches case when /search/page/N without search term is itself mistaken for search term. R. 1036 if ( ! empty( $search_query ) && ! preg_match( '|^page/\d+$|', $search_query ) ) { 1037 $canonical = get_search_link(); 1038 } 1039 1040 } elseif ( is_front_page() ) { 1041 1042 $canonical = get_bloginfo( 'url' ); 1043 1044 } elseif ( is_tax() || is_tag() || is_category() ) { 1045 1046 $term = get_queried_object(); 1047 1048 if ( ! empty( $term ) ) { 1049 $queried_terms = $GLOBALS['wp_query']->tax_query->queried_terms; 1050 /** 1051 * Check if term archive query is for multiple terms 1052 */ 1053 if ( 1054 ! isset( $queried_terms[ $term->taxonomy ]['terms'] ) || 1055 count( $queried_terms[ $term->taxonomy ]['terms'] ) <= 1 1056 ) { 1057 $term_link = get_term_link( $term, $term->taxonomy ); 1058 1059 if ( $term_link && ! is_wp_error( $term_link ) ) { 1060 $canonical = $term_link; 1061 } 1062 } 1063 } 1064 1065 } elseif ( is_post_type_archive() ) { 1066 1067 $post_type = get_query_var( 'post_type' ); 1068 1069 if ( is_array( $post_type ) ) { 1070 $post_type = reset( $post_type ); 1071 } 1072 1073 $canonical = get_post_type_archive_link( $post_type ); 1074 1075 } elseif ( is_author() ) { 1076 $canonical = get_author_posts_url( get_query_var( 'author' ), get_query_var( 'author_name' ) ); 1077 } elseif ( is_archive() ) { 1078 1079 if ( is_date() ) { 1080 if ( is_day() ) { 1081 $canonical = get_day_link( get_query_var( 'year' ), get_query_var( 'monthnum' ), get_query_var( 'day' ) ); 1082 } elseif ( is_month() ) { 1083 $canonical = get_month_link( get_query_var( 'year' ), get_query_var( 'monthnum' ) ); 1084 } elseif ( is_year() ) { 1085 $canonical = get_year_link( get_query_var( 'year' ) ); 1086 } 1087 } 1088 1089 } 1090 1091 return $canonical; 1009 return home_url( add_query_arg( false, false ) ); 1092 1010 } 1093 1011 } … … 2114 2032 function better_amp_get_archive_title_fields() { 2115 2033 2116 $icon = ''; 2117 $pre_title = ''; 2118 $title = ''; 2034 $icon = ''; 2035 $pre_title = ''; 2036 $title = ''; 2037 $description = ''; 2119 2038 2120 2039 if ( function_exists( 'is_woocommerce' ) && is_woocommerce() ) { 2121 2040 2122 2041 if ( is_product_category() ) { 2123 $icon = '<i class="fa fa-shopping-basket"></i>'; 2124 $pre_title = better_amp_translation_get( 'browsing_product_category' ); 2125 $title = single_term_title( '', false ); 2042 2043 $icon = '<i class="fa fa-shopping-basket"></i>'; 2044 $pre_title = better_amp_translation_get( 'browsing_product_category' ); 2045 $title = single_term_title( '', false ); 2046 $description = term_description( get_queried_object() ); 2047 2126 2048 } elseif ( is_product_tag() ) { 2127 $icon = '<i class="fa fa-shopping-basket"></i>'; 2128 $pre_title = better_amp_translation_get( 'browsing_product_tag' ); 2129 $title = single_term_title( '', false ); 2049 2050 $icon = '<i class="fa fa-shopping-basket"></i>'; 2051 $pre_title = better_amp_translation_get( 'browsing_product_tag' ); 2052 $title = single_term_title( '', false ); 2053 $description = term_description( get_queried_object() ); 2054 2130 2055 } else { 2056 2131 2057 $icon = '<i class="fa fa-truck"></i>'; 2132 2058 $pre_title = better_amp_translation_get( 'browsing' ); … … 2135 2061 2136 2062 } elseif ( is_category() ) { 2137 $icon = '<i class="fa fa-folder"></i>'; 2138 $pre_title = better_amp_translation_get( 'browsing_category' ); 2139 $title = single_cat_title( '', false ); 2063 2064 $icon = '<i class="fa fa-folder"></i>'; 2065 $pre_title = better_amp_translation_get( 'browsing_category' ); 2066 $title = single_cat_title( '', false ); 2067 $description = category_description(); 2068 2140 2069 } elseif ( is_tag() ) { 2141 $icon = '<i class="fa fa-tag"></i>'; 2142 $pre_title = better_amp_translation_get( 'browsing_tag' ); 2143 $title = single_tag_title( '', false ); 2070 2071 $icon = '<i class="fa fa-tag"></i>'; 2072 $pre_title = better_amp_translation_get( 'browsing_tag' ); 2073 $title = single_tag_title( '', false ); 2074 $description = tag_description(); 2075 2144 2076 } elseif ( is_author() ) { 2145 $icon = '<i class="fa fa-user-circle"></i>'; 2146 $pre_title = better_amp_translation_get( 'browsing_author' ); 2147 $title = '<span class="vcard">' . get_the_author() . '</span>'; 2077 2078 $icon = '<i class="fa fa-user-circle"></i>'; 2079 $pre_title = better_amp_translation_get( 'browsing_author' ); 2080 $title = '<span class="vcard">' . get_the_author() . '</span>'; 2081 $description = get_the_author_meta( 'description' ); 2082 2148 2083 } elseif ( is_year() ) { 2084 2149 2085 $icon = '<i class="fa fa-calendar"></i>'; 2150 2086 $pre_title = better_amp_translation_get( 'browsing_yearly' ); 2151 2087 $title = get_the_date( _x( 'Y', 'yearly archives date format', 'better-amp' ) ); 2088 2152 2089 } elseif ( is_month() ) { 2090 2153 2091 $icon = '<i class="fa fa-calendar"></i>'; 2154 2092 $pre_title = better_amp_translation_get( 'browsing_monthly' ); 2155 2093 $title = get_the_date( _x( 'F Y', 'monthly archives date format', 'better-amp' ) ); 2094 2156 2095 } elseif ( is_day() ) { 2096 2157 2097 $icon = '<i class="fa fa-calendar"></i>'; 2158 2098 $pre_title = better_amp_translation_get( 'browsing_daily' ); 2159 2099 $title = get_the_date( _x( 'F j, Y', 'daily archives date format', 'better-amp' ) ); 2100 2160 2101 } elseif ( is_tax( 'post_format' ) ) { 2102 2161 2103 if ( is_tax( 'post_format', 'post-format-aside' ) ) { 2104 2162 2105 $icon = '<i class="fa fa-pencil"></i>'; 2163 2106 $pre_title = better_amp_translation_get( 'browsing_archive' ); 2164 2107 $title = better_amp_translation_get( 'asides' ); 2108 2165 2109 } elseif ( is_tax( 'post_format', 'post-format-gallery' ) ) { 2110 2166 2111 $icon = '<i class="fa fa-camera"></i>'; 2167 2112 $pre_title = better_amp_translation_get( 'browsing_archive' ); 2168 2113 $title = better_amp_translation_get( 'galleries' ); 2114 2169 2115 } elseif ( is_tax( 'post_format', 'post-format-image' ) ) { 2116 2170 2117 $icon = '<i class="fa fa-camera"></i>'; 2171 2118 $pre_title = better_amp_translation_get( 'browsing_archive' ); 2172 2119 $title = better_amp_translation_get( 'images' ); 2120 2173 2121 } elseif ( is_tax( 'post_format', 'post-format-video' ) ) { 2122 2174 2123 $icon = '<i class="fa fa-video-camera"></i>'; 2175 2124 $pre_title = better_amp_translation_get( 'browsing_archive' ); 2176 2125 $title = better_amp_translation_get( 'videos' ); 2126 2177 2127 } elseif ( is_tax( 'post_format', 'post-format-quote' ) ) { 2128 2178 2129 $icon = '<i class="fa fa-quote-' . better_amp_direction() . '"></i>'; 2179 2130 $pre_title = better_amp_translation_get( 'browsing_archive' ); 2180 2131 $title = better_amp_translation_get( 'quotes' ); 2132 2181 2133 } elseif ( is_tax( 'post_format', 'post-format-link' ) ) { 2134 2182 2135 $icon = '<i class="fa fa-link"></i>'; 2183 2136 $pre_title = better_amp_translation_get( 'browsing_archive' ); 2184 2137 $title = better_amp_translation_get( 'links' ); 2138 2185 2139 } elseif ( is_tax( 'post_format', 'post-format-status' ) ) { 2140 2186 2141 $icon = '<i class="fa fa-refresh"></i>'; 2187 2142 $pre_title = better_amp_translation_get( 'browsing_archive' ); 2188 2143 $title = better_amp_translation_get( 'statuses' ); 2144 2189 2145 } elseif ( is_tax( 'post_format', 'post-format-audio' ) ) { 2146 2190 2147 $icon = '<i class="fa fa-music"></i>'; 2191 2148 $pre_title = better_amp_translation_get( 'browsing_archive' ); 2192 2149 $title = better_amp_translation_get( 'audio' ); 2150 2193 2151 } elseif ( is_tax( 'post_format', 'post-format-chat' ) ) { 2152 2194 2153 $icon = '<i class="fa fa-coffee"></i>'; 2195 2154 $pre_title = better_amp_translation_get( 'browsing_archive' ); 2196 2155 $title = better_amp_translation_get( 'chats' ); 2197 2156 } 2157 2198 2158 } elseif ( is_post_type_archive() ) { 2199 $icon = '<i class="fa fa-archive"></i>'; 2200 $pre_title = better_amp_translation_get( 'browsing_archive' ); 2201 $title = post_type_archive_title( '', false ); 2159 2160 $icon = '<i class="fa fa-archive"></i>'; 2161 $pre_title = better_amp_translation_get( 'browsing_archive' ); 2162 $title = post_type_archive_title( '', false ); 2163 $description = function_exists( 'get_the_post_type_description' ) ? 2164 get_the_post_type_description() : ''; 2202 2165 } elseif ( is_tax() ) { 2203 2166 2204 $tax = get_taxonomy( get_queried_object()->taxonomy ); 2205 2206 $icon = '<i class="fa fa-archive"></i>'; 2207 $pre_title = better_amp_translation_get( 'browsing_archive' ); 2208 $title = sprintf( __( '%1$s: %2$s', 'beetter-amp' ), $tax->labels->singular_name, single_term_title( '', false ) ); 2167 $tax = get_taxonomy( get_queried_object()->taxonomy ); 2168 $icon = '<i class="fa fa-archive"></i>'; 2169 $pre_title = better_amp_translation_get( 'browsing_archive' ); 2170 $title = sprintf( __( '%1$s: %2$s', 'beetter-amp' ), $tax->labels->singular_name, single_term_title( '', false ) ); 2171 $description = term_description(); 2172 2209 2173 } else { 2174 2210 2175 $icon = '<i class="fa fa-archive"></i>'; 2211 2176 $pre_title = better_amp_translation_get( 'browsing' ); … … 2213 2178 } 2214 2179 2215 2216 return compact( 'icon', 'pre_title', 'title' ); 2180 return compact( 'icon', 'pre_title', 'title', 'description' ); 2217 2181 } 2218 2182 } -
better-amp/trunk/readme.txt
r1977493 r1981747 51 51 52 52 == Changelog == 53 54 = 1.9.5 = 55 - Added: Category description support in archive page (all taxonomies) 56 57 - Improved: Do not view amp when it’s not enabled. 58 - Improved: Added support for custom taxonomies in end-point. 59 60 - Fixed: Youtube embedded video with short link youtu.be 61 - Fixed: WooCommerce tag archive page header style. 62 53 63 54 64 = 1.9.4 = -
better-amp/trunk/template/css/archive.css
r1600346 r1981747 12 12 position: relative; 13 13 } 14 .archive-page-header .pre-title{ 14 .archive-page-header .pre-title, 15 .archive-page-header .archive-description{ 15 16 font-size: 14px; 16 17 margin-bottom: 3px; … … 26 27 margin-right: 10px; 27 28 } 29 30 .archive-page-header h1 { 31 font-size: 30px; 32 } 33 34 .archive-page-header h1 .fa { 35 margin-right: 8px; 36 } 37 38 body.rtl .archive-page-header h1 .fa { 39 margin-left: 8px; 40 margin-right: 0; 41 } -
better-amp/trunk/template/css/archive.min.css
r1600346 r1981747 1 .archive-page-header{padding:15px 18px 11px;margin:0 0 15px;background:#fff;font-family:Roboto;font-size:25px;font-weight:500;border:1px solid #dcdcdc;position:relative}.archive-page-header . pre-title{font-size:14px;margin-bottom:3px;font-weight:400;color:#868686}.archive-page-header .archive-title{margin:0;font-size:26px;text-transform:capitalize}.archive-page-header .archive-title .fa{margin-right:10px}1 .archive-page-header{padding:15px 18px 11px;margin:0 0 15px;background:#fff;font-family:Roboto;font-size:25px;font-weight:500;border:1px solid #dcdcdc;position:relative}.archive-page-header .archive-description,.archive-page-header .pre-title{font-size:14px;margin-bottom:3px;font-weight:400;color:#868686}.archive-page-header .archive-title{margin:0;font-size:26px;text-transform:capitalize}.archive-page-header .archive-title .fa{margin-right:10px}.archive-page-header h1{font-size:30px}.archive-page-header h1 .fa{margin-right:8px}body.rtl .archive-page-header h1 .fa{margin-left:8px;margin-right:0} -
better-amp/trunk/template/taxonomy-product_tag.php
r1594085 r1981747 2 2 3 3 better_amp_get_header(); 4 5 better_amp_enqueue_block_style( 'archive', 'css/archive' ); 4 6 5 7 better_amp_template_part( 'views/archive/title' ); -
better-amp/trunk/template/views/archive/title.php
r1594085 r1981747 25 25 echo '<h1 class="archive-title">', $title['icon'], $title['title'], '</h1>'; 26 26 27 if ( ! empty( $title['description'] ) ) { 28 29 echo '<div class="archive-description">', $title['description'], '</div>'; 30 } 27 31 ?> 28 32 </header>
Note: See TracChangeset
for help on using the changeset viewer.