Tan-007 /
DesignFly
| 1 | <?php |
||||||
| 2 | /** |
||||||
| 3 | * Jetpack Compatibility File |
||||||
| 4 | * |
||||||
| 5 | * @link https://jetpack.com/ |
||||||
| 6 | * |
||||||
| 7 | * @package DesignFly |
||||||
| 8 | */ |
||||||
| 9 | |||||||
| 10 | /** |
||||||
| 11 | * Jetpack setup function. |
||||||
| 12 | * |
||||||
| 13 | * See: https://jetpack.com/support/infinite-scroll/ |
||||||
| 14 | * See: https://jetpack.com/support/responsive-videos/ |
||||||
| 15 | * See: https://jetpack.com/support/content-options/ |
||||||
| 16 | */ |
||||||
| 17 | function designfly_jetpack_setup() { |
||||||
| 18 | // Add theme support for Infinite Scroll. |
||||||
| 19 | add_theme_support( 'infinite-scroll', array( |
||||||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||||||
| 20 | 'container' => 'main', |
||||||
| 21 | 'render' => 'designfly_infinite_scroll_render', |
||||||
| 22 | 'footer' => 'page', |
||||||
| 23 | ) ); |
||||||
| 24 | |||||||
| 25 | // Add theme support for Responsive Videos. |
||||||
| 26 | add_theme_support( 'jetpack-responsive-videos' ); |
||||||
| 27 | |||||||
| 28 | // Add theme support for Content Options. |
||||||
| 29 | add_theme_support( 'jetpack-content-options', array( |
||||||
| 30 | 'post-details' => array( |
||||||
| 31 | 'stylesheet' => 'designfly-style', |
||||||
| 32 | 'date' => '.posted-on', |
||||||
| 33 | 'categories' => '.cat-links', |
||||||
| 34 | 'tags' => '.tags-links', |
||||||
| 35 | 'author' => '.byline', |
||||||
| 36 | 'comment' => '.comments-link', |
||||||
| 37 | ), |
||||||
| 38 | 'featured-images' => array( |
||||||
| 39 | 'archive' => true, |
||||||
| 40 | 'post' => true, |
||||||
| 41 | 'page' => true, |
||||||
| 42 | ), |
||||||
| 43 | ) ); |
||||||
| 44 | } |
||||||
| 45 | add_action( 'after_setup_theme', 'designfly_jetpack_setup' ); |
||||||
|
0 ignored issues
–
show
The function
add_action was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||
| 46 | |||||||
| 47 | /** |
||||||
| 48 | * Custom render function for Infinite Scroll. |
||||||
| 49 | */ |
||||||
| 50 | function designfly_infinite_scroll_render() { |
||||||
| 51 | while ( have_posts() ) { |
||||||
|
0 ignored issues
–
show
The function
have_posts was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||
| 52 | the_post(); |
||||||
|
0 ignored issues
–
show
The function
the_post was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||
| 53 | if ( is_search() ) : |
||||||
|
0 ignored issues
–
show
The function
is_search was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||
| 54 | get_template_part( 'template-parts/content', 'search' ); |
||||||
|
0 ignored issues
–
show
The function
get_template_part was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||
| 55 | else : |
||||||
| 56 | get_template_part( 'template-parts/content', get_post_type() ); |
||||||
|
0 ignored issues
–
show
The function
get_post_type was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||
| 57 | endif; |
||||||
| 58 | } |
||||||
| 59 | } |
||||||
| 60 |