add files
This commit is contained in:
57
template-parts/archive/ajax-load-more/author.php
Normal file
57
template-parts/archive/ajax-load-more/author.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<!--[archive/ajax-load-more/author]-->
|
||||
|
||||
<?php
|
||||
|
||||
$author = get_coauthors()[0];
|
||||
|
||||
$terms = [
|
||||
get_term_by( 'slug', 'cap-' . $author->user_nicename, "author" )->slug,
|
||||
get_term_by( 'slug', 'cap-' . $author->linked_account, "author" )->slug
|
||||
];
|
||||
|
||||
$terms = array_filter($terms);
|
||||
|
||||
$taxonomy = implode (
|
||||
":",
|
||||
array_map(
|
||||
fn ($node) => "author",
|
||||
$terms
|
||||
)
|
||||
);
|
||||
|
||||
$operator = implode (
|
||||
":",
|
||||
array_map(
|
||||
fn ($node) => "IN",
|
||||
$terms
|
||||
)
|
||||
);
|
||||
|
||||
$terms = implode(
|
||||
":",
|
||||
$terms
|
||||
);
|
||||
|
||||
$index_alm_shortcode = '
|
||||
[ajax_load_more
|
||||
cache="true"
|
||||
cache_id="' . get_alm_cache_id() . date("U") . '"
|
||||
container_type="div"
|
||||
css_classes="row"
|
||||
post_type="profile_article,anew,yellow"
|
||||
repeater="template_23"
|
||||
posts_per_page="10"
|
||||
post_format="standard"
|
||||
offset="8"
|
||||
id="archive"
|
||||
taxonomy="' . $taxonomy . '"
|
||||
taxonomy_terms="' . $terms . '"
|
||||
taxonomy_operator="' . $operator . '"
|
||||
taxonomy_relation="OR"
|
||||
]';
|
||||
|
||||
echo do_shortcode( $index_alm_shortcode );
|
||||
|
||||
?>
|
||||
|
||||
<!--[/archive/ajax-load-more/author]-->
|
||||
24
template-parts/archive/ajax-load-more/category.php
Normal file
24
template-parts/archive/ajax-load-more/category.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<!--[archive/ajax-load-more/category]-->
|
||||
|
||||
<?php
|
||||
|
||||
$index_alm_shortcode = '
|
||||
[ajax_load_more
|
||||
cache="true"
|
||||
cache_id="' . get_alm_cache_id( get_queried_object()->term_id ) . '"
|
||||
container_type="div"
|
||||
css_classes="row"
|
||||
post_type="profile_article,anew,yellow"
|
||||
repeater="template_23"
|
||||
posts_per_page="10"
|
||||
post_format="standard"
|
||||
offset="8"
|
||||
id="archive"
|
||||
category="' . get_queried_object()->slug . '"
|
||||
]';
|
||||
|
||||
echo do_shortcode( $index_alm_shortcode );
|
||||
|
||||
?>
|
||||
|
||||
<!--[/archive/ajax-load-more/category]-->
|
||||
3
template-parts/archive/ajax-load-more/event.php
Normal file
3
template-parts/archive/ajax-load-more/event.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<!--[archive/ajax-load-more/event]-->
|
||||
<!--TODO:это потом-->
|
||||
<!--[/archive/ajax-load-more/event]-->
|
||||
23
template-parts/archive/ajax-load-more/post-type-grid.php
Normal file
23
template-parts/archive/ajax-load-more/post-type-grid.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<!--[archive/ajax-load-more/post-type-grid]-->
|
||||
|
||||
<?php
|
||||
|
||||
$index_alm_shortcode = '
|
||||
[ajax_load_more
|
||||
cache="true"
|
||||
cache_id="' . get_alm_cache_id( 23 ) . '"
|
||||
container_type="div"
|
||||
css_classes="row"
|
||||
post_type="profile_article"
|
||||
repeater="template_23"
|
||||
posts_per_page="10"
|
||||
post_format="standard"
|
||||
offset="8"
|
||||
id="archive"
|
||||
]';
|
||||
|
||||
echo do_shortcode( $index_alm_shortcode );
|
||||
|
||||
?>
|
||||
|
||||
<!--[/archive/ajax-load-more/post-type-grid]-->
|
||||
22
template-parts/archive/ajax-load-more/post-type-list.php
Normal file
22
template-parts/archive/ajax-load-more/post-type-list.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<!--[archive/ajax-load-more/post-type-list]-->
|
||||
|
||||
<?php
|
||||
|
||||
$index_alm_shortcode = '
|
||||
[ajax_load_more
|
||||
cache="true"
|
||||
cache_id="' . get_alm_cache_id( 24 ) . '"
|
||||
container_type="div"
|
||||
post_type="anew,yellow"
|
||||
repeater="template_24"
|
||||
posts_per_page="10"
|
||||
post_format="standard"
|
||||
offset="8"
|
||||
id="archive"
|
||||
]';
|
||||
|
||||
echo do_shortcode( $index_alm_shortcode );
|
||||
|
||||
?>
|
||||
|
||||
<!--[/archive/ajax-load-more/post-type-list]-->
|
||||
13
template-parts/archive/ajax-load-more/post-type.php
Normal file
13
template-parts/archive/ajax-load-more/post-type.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<!--[archive/ajax-load-more/post-type]-->
|
||||
|
||||
<?php if( get_post_type() === "profile_article" ) : ?>
|
||||
|
||||
<?php get_template_part("template-parts/archive/ajax-load-more/post-type-grid") ?>
|
||||
|
||||
<?php else : ?>
|
||||
|
||||
<?php get_template_part("template-parts/archive/ajax-load-more/post-type-list") ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<!--[/archive/ajax-load-more/post-type]-->
|
||||
24
template-parts/archive/ajax-load-more/tag.php
Normal file
24
template-parts/archive/ajax-load-more/tag.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<!--[archive/ajax-load-more/tag]-->
|
||||
|
||||
<?php
|
||||
|
||||
$index_alm_shortcode = '
|
||||
[ajax_load_more
|
||||
cache="true"
|
||||
cache_id="' . get_alm_cache_id() . '"
|
||||
container_type="div"
|
||||
css_classes="row"
|
||||
post_type="profile_article,anew,yellow"
|
||||
repeater="template_23"
|
||||
posts_per_page="10"
|
||||
post_format="standard"
|
||||
offset="8"
|
||||
id="archive"
|
||||
tag="' . get_queried_object()->slug . '"
|
||||
]';
|
||||
|
||||
echo do_shortcode( $index_alm_shortcode );
|
||||
|
||||
?>
|
||||
|
||||
<!--[/archive/ajax-load-more/tag]-->
|
||||
Reference in New Issue
Block a user