HEX
Server: Apache/2.4.29 (Ubuntu)
System: Linux bareserver 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64
User: root (0)
PHP: 7.2.24-0ubuntu0.18.04.17
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Upload Files
File: /var/www/html/site/newsite/wp-content/themes/ooze/template-parts/single/author-posts.php
<?php
global $post;
$post_id = $post->ID;

$author_posts_text = ooze_get_option('author_posts_text');
$no_of_author_posts = absint(ooze_get_option('no_of_author_posts'));
$order = esc_attr(ooze_get_option('author_posts_order'));
$orderby = esc_attr(ooze_get_option('author_posts_orderby'));


// Covert id to ID to make it work with query
if ('id' == $orderby) {
    $orderby = 'ID';
}

$author_posts_args = array(
    'author' => get_the_author_meta('ID'),
    'post_type' => 'post',
    'post__not_in' => array($post_id),
    'posts_per_page' => $no_of_author_posts,
    'ignore_sticky_posts' => 1,
    'orderby' => $orderby,
    'order' => $order,
);
$author_posts_query = new WP_Query($author_posts_args);

if ($author_posts_query->have_posts()):
    ?>
    <div class="single-author-posts-area theme-single-post-component">
        <header class="component-header single-component-header">
            <h2 class="single-component-title">
                <?php echo esc_html($author_posts_text); ?>
            </h2>
        </header>
        <div class="component-content single-component-content">
            <?php while ($author_posts_query->have_posts()):
                $author_posts_query->the_post(); ?>
                <article id="post-<?php the_ID(); ?>" <?php post_class('theme-article theme-single-component-article'); ?>>
                    <?php if (has_post_thumbnail()): ?>
                        <div class="entry-image image-size-xsmall">
                            <a href="<?php the_permalink() ?>">
                                <?php
                                the_post_thumbnail('medium_large', array(
                                    'alt' => the_title_attribute(
                                        array(
                                            'echo' => false,
                                        )
                                    ),
                                )
                                );
                                ?>
                            </a>
                        </div>
                    <?php endif; ?>
                    <div class="entry-details">
                        <h3 class="entry-title font-size-small line-clamp line-clamp-2 mb-8">
                            <a href="<?php the_permalink() ?>">
                                <?php the_title(); ?>
                            </a>
                        </h3>
                        <div class="post-date">
                            <?php echo esc_html(get_the_date()); ?>
                        </div>
                    </div>
                </article>
            <?php endwhile;
            wp_reset_postdata(); ?>
        </div>
    </div>
    <?php
endif;