Yuzu Theme
from meowapps.com
This commit is contained in:
80
inc/jetpack.php
Normal file
80
inc/jetpack.php
Normal file
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
/**
|
||||
* Jetpack Compatibility File
|
||||
*
|
||||
* @link https://jetpack.com/
|
||||
*
|
||||
* @package Yuzu
|
||||
*/
|
||||
|
||||
/**
|
||||
* Jetpack setup function.
|
||||
*
|
||||
* See: https://jetpack.com/support/infinite-scroll/
|
||||
* See: https://jetpack.com/support/responsive-videos/
|
||||
* See: https://jetpack.com/support/content-options/
|
||||
*/
|
||||
function yuzu_jetpack_setup() {
|
||||
// Add theme support for Infinite Scroll.
|
||||
add_theme_support( 'infinite-scroll', array(
|
||||
'container' => 'articles-list',
|
||||
'posts_per_page' => 6,
|
||||
'render' => 'yuzu_infinite_scroll_render',
|
||||
'footer' => 'page',
|
||||
) );
|
||||
|
||||
// Add theme support for Responsive Videos.
|
||||
add_theme_support( 'jetpack-responsive-videos' );
|
||||
|
||||
// Add theme support for Content Options.
|
||||
add_theme_support( 'jetpack-content-options', array(
|
||||
'featured-images' => array(
|
||||
'archive' => true,
|
||||
'post' => true,
|
||||
'page' => true,
|
||||
),
|
||||
) );
|
||||
}
|
||||
add_action( 'after_setup_theme', 'yuzu_jetpack_setup' );
|
||||
|
||||
/**
|
||||
* Custom render function for Infinite Scroll.
|
||||
*/
|
||||
function yuzu_infinite_scroll_render() {
|
||||
$count = 0;
|
||||
while ( have_posts() ) {
|
||||
the_post();
|
||||
switch($count) {
|
||||
case 0:
|
||||
echo '<div class="row">';
|
||||
require get_template_directory() . '/components/article-cards/large-article-card.php';
|
||||
echo '</div>';
|
||||
$count++;
|
||||
break;
|
||||
case 1:
|
||||
echo '<div class="row">';
|
||||
require get_template_directory() . '/components/article-cards/medium-article-card.php';
|
||||
$count++;
|
||||
break;
|
||||
case 2:
|
||||
require get_template_directory() . '/components/article-cards/medium-article-card.php';
|
||||
echo '</div>';
|
||||
$count++;
|
||||
break;
|
||||
case 3:
|
||||
echo '<div class="row">';
|
||||
require get_template_directory() . '/components/article-cards/small-article-card.php';
|
||||
$count++;
|
||||
break;
|
||||
case 4:
|
||||
require get_template_directory() . '/components/article-cards/small-article-card.php';
|
||||
$count++;
|
||||
break;
|
||||
case 5:
|
||||
require get_template_directory() . '/components/article-cards/small-article-card.php';
|
||||
echo '</div>';
|
||||
$count = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user