Files
profile/template-parts/archive/ajax-load-more/author.php

64 lines
1.5 KiB
PHP
Raw Normal View History

2025-07-09 21:21:17 +03:00
<!--[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
);
2026-01-12 13:37:40 +03:00
$posts_count = $wp_query->post_count;
if ( $posts_count > 10 ){
2025-07-09 21:21:17 +03:00
$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 );
2026-01-12 13:37:40 +03:00
}
2025-07-09 21:21:17 +03:00
?>
<!--[/archive/ajax-load-more/author]-->