levelSelection.php
66 lines
| 1 | <!doctype html> |
| 2 | <html lang="cs"> |
| 3 | <head> |
| 4 | <meta charset="UTF-8"> |
| 5 | <meta name="viewport" |
| 6 | content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> |
| 7 | <meta http-equiv="X-UA-Compatible" content="ie=edge"> |
| 8 | <title><?php |
| 9 | echo bloginfo('name') ?><?php echo __( 'Výběr úrovně', 'fapi-member' ); ?></title> |
| 10 | <link rel="preconnect" href="https://fonts.gstatic.com"> |
| 11 | <?php wp_head() ?> |
| 12 | </head> |
| 13 | <body class="FapiLevelSelection"> |
| 14 | <div id="Wrapper"> |
| 15 | <h1><?php echo __( 'Výběr sekce', 'fapi-member' ); ?></h1> |
| 16 | <p><?php echo __( 'Prosím, zvolte jednu ze stránek, kam chcete vstoupit', 'fapi-member' ); ?></p> |
| 17 | <div class="pages"> |
| 18 | <?php |
| 19 | $args = [ |
| 20 | 'post_type' => FapiMember\Utils\PostTypeHelper::getSupportedPostTypes(), |
| 21 | 'post__in' => array_values($pages), |
| 22 | 'orderby' => 'post_title', |
| 23 | 'order' => 'ASC' |
| 24 | ]; |
| 25 | $posts = get_posts($args); |
| 26 | |
| 27 | foreach ($posts as $post) { |
| 28 | if (has_excerpt($post)) { |
| 29 | $excerpt = get_the_excerpt($post); |
| 30 | } else { |
| 31 | $text = strip_shortcodes( |
| 32 | wp_strip_all_tags( |
| 33 | get_the_content(null, null, $post) |
| 34 | ) |
| 35 | ); |
| 36 | if (strpos($text, '[') === 0) { |
| 37 | $excerpt = ''; |
| 38 | } else { |
| 39 | $excerpt = wp_trim_words($text, 16, ''); |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | ?> |
| 44 | <div> |
| 45 | <?php |
| 46 | if (has_post_thumbnail($post)) { |
| 47 | echo get_the_post_thumbnail($post, 'level-selection'); |
| 48 | } else { |
| 49 | echo '<div class="thumbPlaceholder"></div>'; |
| 50 | } |
| 51 | ?> |
| 52 | <h3><?php echo get_the_title($post) ?></h3> |
| 53 | <p> |
| 54 | <?php echo $excerpt ?> |
| 55 | </p> |
| 56 | <div class="actions"> |
| 57 | <a href="<?php echo get_permalink($post) ?>"><?php echo __( 'Vstoupit', 'fapi-member' ); ?></a> |
| 58 | </div> |
| 59 | </div> |
| 60 | <?php } ?> |
| 61 | </div> |
| 62 | </div> |
| 63 | <?php wp_title(); ?> |
| 64 | </body> |
| 65 | </html> |
| 66 |