twentyfifteen-rtl.css
7 years ago
twentyfifteen.css
4 years ago
twentyfifteen.php
4 years ago
twentyfourteen-rtl.css
7 years ago
twentyfourteen.css
4 years ago
twentyfourteen.php
4 years ago
twentynineteen-rtl.css
3 years ago
twentynineteen.css
3 years ago
twentynineteen.php
4 years ago
twentyseventeen.php
4 years ago
twentysixteen-rtl.css
3 years ago
twentysixteen.css
3 years ago
twentysixteen.php
4 years ago
twentytwenty-rtl.css
4 years ago
twentytwenty.css
4 years ago
twentytwenty.php
4 years ago
twentytwentyone-rtl.css
3 years ago
twentytwentyone.css
5 years ago
twentytwentyone.php
5 years ago
twentytwentyone.php
78 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Jetpack Compatibility File |
| 4 | * See: https://jetpack.com/ |
| 5 | * |
| 6 | * @package automattic/jetpack |
| 7 | */ |
| 8 | |
| 9 | /** |
| 10 | * Add Jetpack extra functionality to Twenty Twenty One. |
| 11 | */ |
| 12 | function twentytwentyone_jetpack_setup() { |
| 13 | |
| 14 | /** |
| 15 | * Add theme support for Infinite Scroll. |
| 16 | */ |
| 17 | add_theme_support( |
| 18 | 'infinite-scroll', |
| 19 | array( |
| 20 | 'type' => 'click', |
| 21 | 'container' => 'main', |
| 22 | 'render' => 'twentytwentyone_infinite_scroll_render', |
| 23 | 'footer' => 'main', |
| 24 | ) |
| 25 | ); |
| 26 | |
| 27 | /** |
| 28 | * Add theme support for geo-location. |
| 29 | */ |
| 30 | add_theme_support( 'jetpack-geo-location' ); |
| 31 | |
| 32 | /** |
| 33 | * Add theme support for Content Options. |
| 34 | */ |
| 35 | add_theme_support( |
| 36 | 'jetpack-content-options', |
| 37 | array( |
| 38 | 'blog-display' => array( 'content', 'excerpt' ), |
| 39 | 'post-details' => array( |
| 40 | 'stylesheet' => 'twenty-twenty-one-style', |
| 41 | 'date' => '.posted-on', |
| 42 | 'categories' => '.cat-links', |
| 43 | ), |
| 44 | 'featured-images' => array( |
| 45 | 'archive' => true, |
| 46 | 'post' => true, |
| 47 | 'page' => true, |
| 48 | ), |
| 49 | ) |
| 50 | ); |
| 51 | } |
| 52 | add_action( 'after_setup_theme', 'twentytwentyone_jetpack_setup' ); |
| 53 | |
| 54 | /** |
| 55 | * Custom render function for Infinite Scroll. |
| 56 | */ |
| 57 | function twentytwentyone_infinite_scroll_render() { |
| 58 | while ( have_posts() ) { |
| 59 | the_post(); |
| 60 | get_template_part( 'template-parts/content/content', get_theme_mod( 'display_excerpt_or_full_post', 'excerpt' ) ); |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | /** |
| 65 | * Add our compat CSS file for custom styles. |
| 66 | * Set the version equal to filemtime for development builds, and the JETPACK__VERSION for production |
| 67 | * or skip it entirely for wpcom. |
| 68 | */ |
| 69 | function twentytwentyone_enqueue_jetpack_style() { |
| 70 | $version = Jetpack::is_development_version() |
| 71 | ? filemtime( JETPACK__PLUGIN_DIR . 'modules/theme-tools/compat/twentytwentyone.css' ) |
| 72 | : JETPACK__VERSION; |
| 73 | |
| 74 | wp_enqueue_style( 'twentytwentyone-jetpack', plugins_url( 'twentytwentyone.css', __FILE__ ), array(), $version ); |
| 75 | wp_style_add_data( 'twentytwentyone-jetpack', 'rtl', 'replace' ); |
| 76 | } |
| 77 | add_action( 'wp_enqueue_scripts', 'twentytwentyone_enqueue_jetpack_style' ); |
| 78 |