| 1 |
<?php |
| 2 |
/** |
| 3 |
* Data online for Themes page. |
| 4 |
* |
| 5 |
* @var array $themes Themes data. |
| 6 |
* @since 4.4.7 |
| 7 |
* @version 1.0.0 |
| 8 |
*/ |
| 9 |
|
| 10 |
use LearnPress\Helpers\Template; |
| 11 |
|
| 12 |
defined( 'ABSPATH' ) || exit; |
| 13 |
?> |
| 14 |
|
| 15 |
<div class="learn-press-themes"> |
| 16 |
<div class="lp-themes-toolbar"> |
| 17 |
<div class="lp-themes-filter"> |
| 18 |
|
| 19 |
<button |
| 20 |
type="button" |
| 21 |
class="lp-themes-filter__item active" |
| 22 |
data-category="all" |
| 23 |
aria-pressed="true" |
| 24 |
> |
| 25 |
<?php esc_html_e( 'All Themes', 'learnpress' ); ?> <span class="lp-themes-filter__count"></span> |
| 26 |
</button> |
| 27 |
|
| 28 |
<button |
| 29 |
type="button" |
| 30 |
class="lp-themes-filter__item" |
| 31 |
data-category="paid" |
| 32 |
aria-pressed="false" |
| 33 |
> |
| 34 |
<?php esc_html_e( 'Paid Themes', 'learnpress' ); ?> <span class="lp-themes-filter__count"></span> |
| 35 |
</button> |
| 36 |
|
| 37 |
<button |
| 38 |
type="button" |
| 39 |
class="lp-themes-filter__item" |
| 40 |
data-category="free" |
| 41 |
aria-pressed="false" |
| 42 |
> |
| 43 |
<?php esc_html_e( 'Free Themes', 'learnpress' ); ?> <span class="lp-themes-filter__count"></span> |
| 44 |
</button> |
| 45 |
|
| 46 |
</div> |
| 47 |
<label class="lp-themes-search"> |
| 48 |
<span class="screen-reader-text"><?php esc_html_e( 'Search themes', 'learnpress' ); ?></span> |
| 49 |
<span class="lp-themes-search__icon lp-icon-search" aria-hidden="true"></span> |
| 50 |
<input type="search" class="lp-themes-search__input" placeholder="<?php esc_attr_e( 'Search themes…', 'learnpress' ); ?>" /> |
| 51 |
</label> |
| 52 |
</div> |
| 53 |
|
| 54 |
<?php |
| 55 |
if ( empty( $themes ) ) : |
| 56 |
Template::print_message( __( 'No theme data available.', 'learnpress' ), 'info' ); |
| 57 |
?> |
| 58 |
|
| 59 |
<?php else : ?> |
| 60 |
<div class="lp-themes-grid"> |
| 61 |
|
| 62 |
<?php foreach ( $themes as $theme ) : ?> |
| 63 |
|
| 64 |
<div |
| 65 |
class="lp-theme-card<?php echo ! empty( $theme['featured'] ) ? ' lp-theme-card--featured' : ''; ?>" |
| 66 |
data-category="<?php echo esc_attr( strtolower( $theme['category'] ?? '' ) ); ?>" |
| 67 |
> |
| 68 |
|
| 69 |
<div class="lp-theme-card__thumbnail"> |
| 70 |
|
| 71 |
<?php |
| 72 |
$fallback_image = LP_PLUGIN_URL . 'assets/images/no-image.png'; |
| 73 |
$theme_image = ! empty( $theme['image'] ) ? $theme['image'] : $fallback_image; |
| 74 |
?> |
| 75 |
|
| 76 |
<img |
| 77 |
src="<?php echo esc_url( $theme_image ); ?>" |
| 78 |
data-fallback-src="<?php echo esc_url( $fallback_image ); ?>" |
| 79 |
alt="<?php echo esc_attr( $theme['name'] ?? $theme['title'] ?? '' ); ?>" |
| 80 |
loading="lazy" |
| 81 |
/> |
| 82 |
|
| 83 |
<?php if ( ! empty( $theme['badge'] ) ) : ?> |
| 84 |
|
| 85 |
<span class="lp-theme-card__badge"> |
| 86 |
<?php echo esc_html( $theme['badge'] ); ?> |
| 87 |
</span> |
| 88 |
|
| 89 |
<?php endif; ?> |
| 90 |
|
| 91 |
</div> |
| 92 |
|
| 93 |
<div class="lp-theme-card__content"> |
| 94 |
|
| 95 |
<h3 class="lp-theme-card__title"> |
| 96 |
<?php echo esc_html( $theme['title'] ?? '' ); ?> |
| 97 |
</h3> |
| 98 |
|
| 99 |
<p class="lp-theme-card__description"> |
| 100 |
<?php echo esc_html( $theme['description'] ?? '' ); ?> |
| 101 |
</p> |
| 102 |
|
| 103 |
<div class="lp-theme-card__footer"> |
| 104 |
|
| 105 |
<div class="lp-theme-card__price"> |
| 106 |
|
| 107 |
<?php if ( 'Free' === ( $theme['category'] ?? '' ) ) : ?> |
| 108 |
|
| 109 |
<strong> |
| 110 |
<?php esc_html_e( 'Free', 'learnpress' ); ?> |
| 111 |
</strong> |
| 112 |
|
| 113 |
<?php else : ?> |
| 114 |
|
| 115 |
<strong> |
| 116 |
$<?php echo esc_html( number_format_i18n( $theme['price'] ?? 0 ) ); ?> |
| 117 |
</strong> |
| 118 |
|
| 119 |
<?php if ( ! empty( $theme['old_price'] ) ) : ?> |
| 120 |
|
| 121 |
<del> |
| 122 |
$<?php echo esc_html( number_format_i18n( $theme['old_price'] ) ); ?> |
| 123 |
</del> |
| 124 |
|
| 125 |
<?php endif; ?> |
| 126 |
|
| 127 |
<?php endif; ?> |
| 128 |
|
| 129 |
</div> |
| 130 |
|
| 131 |
<div class="lp-theme-card__meta"> |
| 132 |
|
| 133 |
<div class="lp-theme-card__rating"> |
| 134 |
|
| 135 |
<span class="lp-theme-card__star lp-icon-star" aria-hidden="true"></span> |
| 136 |
|
| 137 |
<span> |
| 138 |
<?php echo esc_html( $theme['rating'] ?? 0 ); ?> |
| 139 |
</span> |
| 140 |
|
| 141 |
<?php if ( ! empty( $theme['reviews'] ) ) : ?> |
| 142 |
|
| 143 |
<span> |
| 144 |
(<?php echo esc_html( number_format_i18n( $theme['reviews'] ) ); ?>) |
| 145 |
</span> |
| 146 |
|
| 147 |
<?php endif; ?> |
| 148 |
|
| 149 |
</div> |
| 150 |
|
| 151 |
<div class="lp-theme-card__sold"> |
| 152 |
|
| 153 |
<span class="lp-theme-card__cart lp-icon-shopping-cart" aria-hidden="true"></span> |
| 154 |
|
| 155 |
<span> |
| 156 |
<?php echo esc_html( number_format_i18n( $theme['sold'] ?? 0 ) ); ?> |
| 157 |
</span> |
| 158 |
|
| 159 |
</div> |
| 160 |
|
| 161 |
</div> |
| 162 |
|
| 163 |
</div> |
| 164 |
|
| 165 |
<div class="lp-theme-card__actions"> |
| 166 |
|
| 167 |
<a |
| 168 |
class="lp-theme-card__buy" |
| 169 |
href="<?php echo esc_url( $theme['buy_url'] ?? '#' ); ?>" |
| 170 |
target="_blank" |
| 171 |
rel="noopener noreferrer" |
| 172 |
> |
| 173 |
<?php echo esc_html( $theme['buy_text'] ?? __( 'Get Theme Now', 'learnpress' ) ); ?> |
| 174 |
</a> |
| 175 |
|
| 176 |
<a |
| 177 |
class="lp-theme-card__demo" |
| 178 |
href="<?php echo esc_url( $theme['demo_url'] ?? '#' ); ?>" |
| 179 |
target="_blank" |
| 180 |
rel="noopener noreferrer" |
| 181 |
> |
| 182 |
<?php echo esc_html( $theme['demo_text'] ?? __( 'Demo', 'learnpress' ) ); ?> |
| 183 |
</a> |
| 184 |
|
| 185 |
</div> |
| 186 |
|
| 187 |
</div> |
| 188 |
|
| 189 |
</div> |
| 190 |
|
| 191 |
<?php endforeach; ?> |
| 192 |
|
| 193 |
</div> |
| 194 |
|
| 195 |
<?php endif; ?> |
| 196 |
</div> |
| 197 |
|