Add new page "Kariera"
This commit is contained in:
@@ -311,4 +311,38 @@ if (!function_exists('split_text_into_spans')) {
|
||||
|
||||
return $html;
|
||||
}
|
||||
}
|
||||
|
||||
add_action('wp_ajax_load_more_kariera', 'load_more_kariera_callback');
|
||||
add_action('wp_ajax_nopriv_load_more_kariera', 'load_more_kariera_callback');
|
||||
|
||||
function load_more_kariera_callback() {
|
||||
$paged = isset($_POST['page']) ? intval($_POST['page']) + 1 : 1;
|
||||
|
||||
$query = new WP_Query([
|
||||
'post_type' => 'kariera',
|
||||
'posts_per_page' => get_option('posts_per_page'),
|
||||
'paged' => $paged,
|
||||
'orderby' => 'date',
|
||||
'order' => 'DESC',
|
||||
]);
|
||||
|
||||
if ($query->have_posts()) :
|
||||
while ($query->have_posts()) : $query->the_post();
|
||||
$image = get_the_post_thumbnail_url(get_the_ID(), 'medium');
|
||||
$title = get_the_title();
|
||||
$link = get_permalink();
|
||||
|
||||
get_template_part(
|
||||
'inc/template-article-card', null, [
|
||||
'image' => $image ?: '/wp-content/uploads/2025/08/default.jpg',
|
||||
'title' => $title,
|
||||
'link' => $link,
|
||||
]
|
||||
);
|
||||
endwhile;
|
||||
endif;
|
||||
|
||||
wp_reset_postdata();
|
||||
wp_die();
|
||||
}
|
||||
Reference in New Issue
Block a user