Нема описа

jetpack.php 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. /**
  3. * Jetpack Compatibility File
  4. *
  5. * @link https://jetpack.com/
  6. *
  7. * @package XShop
  8. */
  9. /**
  10. * Jetpack setup function.
  11. *
  12. * See: https://jetpack.com/support/infinite-scroll/
  13. * See: https://jetpack.com/support/responsive-videos/
  14. * See: https://jetpack.com/support/content-options/
  15. */
  16. function xshop_jetpack_setup() {
  17. // Add theme support for Infinite Scroll.
  18. add_theme_support(
  19. 'infinite-scroll',
  20. array(
  21. 'container' => 'main',
  22. 'render' => 'xshop_infinite_scroll_render',
  23. 'footer' => 'page',
  24. )
  25. );
  26. // Add theme support for Responsive Videos.
  27. add_theme_support( 'jetpack-responsive-videos' );
  28. // Add theme support for Content Options.
  29. add_theme_support(
  30. 'jetpack-content-options',
  31. array(
  32. 'post-details' => array(
  33. 'stylesheet' => 'xshop-style',
  34. 'date' => '.posted-on',
  35. 'categories' => '.cat-links',
  36. 'tags' => '.tags-links',
  37. 'author' => '.byline',
  38. 'comment' => '.comments-link',
  39. ),
  40. 'featured-images' => array(
  41. 'archive' => true,
  42. 'post' => true,
  43. 'page' => true,
  44. ),
  45. )
  46. );
  47. }
  48. add_action( 'after_setup_theme', 'xshop_jetpack_setup' );
  49. /**
  50. * Custom render function for Infinite Scroll.
  51. */
  52. function xshop_infinite_scroll_render() {
  53. while ( have_posts() ) {
  54. the_post();
  55. if ( is_search() ) :
  56. get_template_part( 'template-parts/content', 'search' );
  57. else :
  58. get_template_part( 'template-parts/content', get_post_type() );
  59. endif;
  60. }
  61. }