Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Insert grid container before the loop.
- *
- * @param obj $query The WP_Query instance.
- */
- function miniva_loop_start( $query ) {
- if ( ! $query->is_main_query() ) {
- return;
- }
- if ( $query->is_feed() ) {
- return;
- }
- if ( is_singular() ) {
- return;
- }
- if ( miniva_is_grid() ) {
- miniva_container_open( 'grid', 'posts-container' );
- }
- }
- add_action( 'loop_start', 'miniva_loop_start' );
- /**
- * Insert grid container after the loop.
- *
- * @param obj $query The WP_Query instance.
- */
- function miniva_loop_end( $query ) {
- if ( ! $query->is_main_query() ) {
- return;
- }
- if ( $query->is_feed() ) {
- return;
- }
- if ( is_singular() ) {
- return;
- }
- if ( miniva_is_grid() ) {
- miniva_container_close();
- }
- }
- add_action( 'loop_end', 'miniva_loop_end' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement