* @copyright Copyright (c) 2021, AeonWP * @link https://aeonwp.com/aeonblog * @license http://www.gnu.org/licenses/gpl-2.0.html * */ /** * Front page hook for all WordPress Conditions * * @param null * @return null * * @since AeonMag 1.1.0 * */ if (!defined('ABSPATH')) { exit; // Exit if accessed directly. } if (!function_exists('aeonmag_front_page')) : function aeonmag_front_page() { if (is_active_sidebar('aeonmag-home-widget-area')) { dynamic_sidebar('aeonmag-home-widget-area'); } global $aeonmag_theme_options; $aeonmag_front_page_content = $aeonmag_theme_options['aeonmag-front-page-content']; if ( 1 == $aeonmag_front_page_content) { if ('posts' == get_option('show_on_front')) { if (have_posts()) : /* Start the Loop */ echo "
"; while (have_posts()) : the_post(); /* * Include the Post-Format-specific template for the content. * If you want to override this in a child theme, then include a file * called content-___.php (where ___ is the Post Format name) and that will be used instead. */ get_template_part('template-parts/content', get_post_format()); endwhile; echo '
'; /** * aeonmag_action_navigation hook * @since AeonMag 1.0.0 * * @hooked aeonmag_action_navigation - 10 */ do_action( 'aeonmag_action_navigation'); else : get_template_part('template-parts/content', 'none'); endif; } else { while (have_posts()) : the_post(); get_template_part('template-parts/content', 'page'); // If comments are open or we have at least one comment, load up the comment template. if (comments_open() || get_comments_number()) { comments_template(); } endwhile; // End of the loop. } } } endif; add_action('aeonmag_action_front_page', 'aeonmag_front_page', 10); //hooks for the front page grid slider if (!function_exists('aeonmag_front_page_grid_slider')) : function aeonmag_front_page_grid_slider() { global $aeonmag_theme_options; $aeonmag_grid_cat = absint($aeonmag_theme_options['aeonmag-grid-slider-select-category']); $aeonmag_grid_title = esc_html($aeonmag_theme_options['aeonmag_title_grid_post_front']); $query_args = array( 'post_type' => 'post', 'cat' => absint($aeonmag_grid_cat), 'posts_per_page' => 5, 'ignore_sticky_posts' => true ); $query = new WP_Query($query_args); ?>

'post', 'cat' => absint($aeonmag_missed_cat), 'posts_per_page' => 4, 'ignore_sticky_posts' => true ); $query = new WP_Query($query_args); ?>

have_posts()) : while ($query->have_posts()) : $query->the_post(); ?>