Skip to content

Commit aff9953

Browse files
committed
migrate lifterlms-chromatic-catalog-compat.php
1 parent f23c828 commit aff9953

File tree

1 file changed

+98
-0
lines changed

1 file changed

+98
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
<?php
2+
/**
3+
* LifterLMS Chromatic Catalog Theme Compatibility.
4+
*
5+
* https://lifterlms.com/docs/fix-catalogs-chromatic-theme/
6+
*
7+
* You can add this recipe to your site by creating a custom plugin
8+
* or using the Code Snippets plugin available for free in the WordPress repository.
9+
* Read this companion documentation for step-by-step directions on either method.
10+
* https://lifterlms.com/docs/adding-custom-code/
11+
*/
12+
13+
/**
14+
* The Template for displaying LifterLMS Course and Membership Catalogs
15+
* llms_loop page which is a post type archive.
16+
*/
17+
add_filter( 'hoot_main_layout', function( $layout ) {
18+
return 'none';
19+
} );
20+
?>
21+
22+
<?php get_header( 'llms_loop' ); ?>
23+
24+
<?php
25+
// Loads the template-parts/loop-meta.php template to display Title Area with Meta Info (of the loop)
26+
get_template_part( 'template-parts/loop-meta', 'llms_loop' );
27+
28+
// Template modification Hook
29+
do_action( 'hoot_template_before_content_grid', 'archive-product.php' );
30+
?>
31+
32+
<div class="grid main-content-grid">
33+
34+
<?php
35+
// Template modification Hook
36+
do_action( 'hoot_template_before_main', 'archive-product.php' );
37+
?>
38+
39+
<main <?php hoot_attr( 'content' ); ?>>
40+
41+
<?php
42+
// Template modification Hook
43+
do_action( 'hoot_template_main_start', 'archive-product.php' ); ?>
44+
45+
46+
<?php do_action( 'lifterlms_archive_description' ); ?>
47+
48+
<?php if ( have_posts() ) : ?>
49+
50+
<?php
51+
/**
52+
* lifterlms_before_loop hook
53+
* @hooked lifterlms_loop_start - 10
54+
*/
55+
do_action( 'lifterlms_before_loop' );
56+
?>
57+
58+
<?php while ( have_posts() ) : the_post(); ?>
59+
60+
<?php llms_get_template_part( 'loop/content', get_post_type() ); ?>
61+
62+
<?php endwhile; ?>
63+
64+
<?php
65+
/**
66+
* lifterlms_before_loop hook
67+
* @hooked lifterlms_loop_end - 10
68+
*/
69+
do_action( 'lifterlms_after_loop' );
70+
?>
71+
72+
<?php llms_get_template_part( 'loop/pagination' ); ?>
73+
74+
<?php else : ?>
75+
76+
<?php llms_get_template( 'loop/none-found.php' ); ?>
77+
78+
<?php endif; ?>
79+
80+
<?php do_action( 'lifterlms_after_main_content' ); ?>
81+
82+
83+
<?php
84+
// Template modification Hook
85+
do_action( 'hoot_template_main_end', 'archive-product.php' );
86+
?>
87+
88+
</main><!-- #content -->
89+
90+
<?php
91+
// Template modification Hook
92+
do_action( 'hoot_template_after_main', 'archive-product.php' );
93+
?>
94+
95+
96+
</div><!-- .grid -->
97+
98+
<?php get_footer( 'llms_loop' ); ?>

0 commit comments

Comments
 (0)