64 lines
1.5 KiB
PHP
64 lines
1.5 KiB
PHP
<!--[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
|
|
);
|
|
|
|
|
|
$posts_count = $wp_query->post_count;
|
|
|
|
if ( $posts_count > 10 ){
|
|
|
|
$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]-->
|