File "page-authors.php"
Full Path: /home/ozbarhaber/public_html/19052025___siteeee/wp-content/themes/anka/pages/page-authors.php
File size: 1.87 KB
MIME-type: text/x-php
Charset: utf-8
<?php if(!defined('ABSPATH')) exit; ?>
<?php
/*
Template Name: Tüm Yazarlar
*/
?>
<?php get_header(); ?>
<div id="main">
<div class="innerContainer pad">
<div id="content">
<div id="allAuthorsPage">
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
<div class="pageHeading">
<h1 class="title"><?php the_title(); ?></h1>
<?php if(xoption('breadcrumb')) sfrBreadcrumbs(); ?>
</div>
<div class="reading">
<?php the_content(); ?>
</div>
<?php endwhile; ?>
<?php
$widgetData = new sfrAuthorsWidget();
$settings = $widgetData->get_settings();
if(count($settings) > 0) {
foreach ($settings as $setting) {
$authorOrder = $setting["authorOrder"];
}
} else {
$authorOrder = "lastpost";
}
?>
<div class="authorsWidget safirWidget wideWidget" data-order="<?php echo $authorOrder ?>" style="padding:0">
<div class="items">
<div class="listing">
<?php $args = [
'role__in' => xoption("userRoles")
];
$authors = get_users( $args );
$authorIDs = array();
foreach ($authors as $author) {
$authorIDs[] = $author->ID;
}
$args = array(
'posts_per_page' => 1,
'post_status' => 'publish',
'no_found_rows' => true,
'ignore_sticky_posts' => true,
);
foreach($authorIDs as $authorID) :
$args['author'] = $authorID;
$results = new WP_Query($args);
if( $results->have_posts() ) {
while( $results->have_posts() ) {
$results->the_post();
include(get_template_directory() . '/posts/post-author.php');
}
wp_reset_postdata();
}
endforeach;
?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php get_footer(); ?>