CCCPaste

loop-author

 'grid',
    'columns'           => 4,
    'items'             => get_option('posts_per_page', 12), // WordPress Settings, Fallback: 12
    'contents'          => 'excerpt',
    'preview_mode'      => 'auto',
    'image_size'        => 'portfolio',
    'paginate'          => 'yes',
    'class'             => '',
    'show_modified_date' => 'no',  // 'yes' or 'no' - shows ‘Updated: XX’ when post has been edited
    'orderby'           => 'date',  // 'date', 'modified', 'title', 'rand', 'comment_count', 'menu_order'
    'order'             => 'DESC',  // 'DESC' (newest first) or 'ASC' (oldest first)
    'fallback_image'    => 'placeholder',      // URL for fallback image or 'placeholder' for grey area with icon
);

/**
 * Filter für Author Loop Argumente
 * 
 * @param array $default_args The default arguments
 * @param string $context Always 'author' for this loop
 * @return array Filtered arguments
 */
$atts = apply_filters( 'avf_author_loop_args', $default_args, 'author' );

// Check if we got posts to display (uses the WordPress main query):
if( have_posts() )
{
    // Start containers - different classes for grid vs. list
    $container_class = 'av-author-loop-container';
    
    if( $atts['type'] == 'grid' ) {
        $container_class .= ' av-author-grid-container av-author-grid';
        // Add column class (only for grid)
        $container_class .= ' av-columns-' . $atts['columns'];
    } else {
        $container_class .= ' av-author-list-container av-author-list';
    }
    
    /**
     * Filters for additional CSS classes
     */
    $container_class = apply_filters( 'avf_author_loop_classes', $container_class, 'author', $atts );
    
    echo '
'; while( have_posts() ) { the_post(); $post_id = get_the_ID(); $image_size = $atts['image_size']; $post_format = get_post_format() ? get_post_format() : 'standard'; // Get image or use fallback $thumbnail = get_the_post_thumbnail( $post_id, $image_size ); // If no thumbnail and fallback are defined if( empty( $thumbnail ) && ! empty( $atts['fallback_image'] ) ) { if( $atts['fallback_image'] == 'placeholder' ) { // Graue Fläche mit Icon $thumbnail = '
'; $thumbnail .= ''; $thumbnail .= ''; $thumbnail .= ''; $thumbnail .= ''; $thumbnail .= ''; $thumbnail .= '
'; } else { // Custom Fallback-Bild URL $thumbnail = '' . esc_attr( get_the_title() ) . ''; } } // Content based on settings $show_content = ''; if( in_array( $atts['contents'], array('excerpt', 'excerpt_read_more') ) ) { $show_content = get_the_excerpt(); } elseif( $atts['contents'] == 'content' ) { $show_content = get_the_content(); } // Get meta infos $meta_info = array(); $meta_separator = '/'; // Published Date if( 'blog-meta-date' == avia_get_option( 'blog-meta-date' ) ) { $meta_info['date'] = ''; } // Modified Date (optionally accessible via filter) if( $atts['show_modified_date'] == 'yes' ) { $published_date = get_the_date( get_option('date_format'), $post_id ); $modified_date = get_the_modified_date( get_option('date_format'), $post_id ); // Only display if actually edited if( $published_date != $modified_date ) { $meta_info['modified'] = ''; } } if( 'blog-meta-comments' == avia_get_option( 'blog-meta-comments' ) ) { if( get_comments_number() != '0' || comments_open() ) { ob_start(); comments_popup_link( "0 " . __( 'Comments', 'avia_framework' ), "1 " . __( 'Comment' , 'avia_framework' ), "% " . __( 'Comments', 'avia_framework' ), 'comments-link', __( 'Comments Disabled', 'avia_framework' ) ); $meta_info['comments'] = '' . ob_get_clean() . ''; } } $taxonomies = get_object_taxonomies( get_post_type( $post_id ) ); $cats = ''; $excluded_taxonomies = array_merge( get_taxonomies( array( 'public' => false ) ), array( 'post_tag', 'post_format' ) ); $excluded_taxonomies = apply_filters( 'avf_exclude_taxonomies', $excluded_taxonomies, get_post_type( $post_id ), $post_id, 'loop-author' ); if( ! empty( $taxonomies ) ) { foreach( $taxonomies as $taxonomy ) { if( ! in_array( $taxonomy, $excluded_taxonomies ) ) { $cats .= get_the_term_list( $post_id, $taxonomy, '', ', ','' ) . ' '; } } } if( 'blog-meta-category' == avia_get_option( 'blog-meta-category' ) && ! empty( $cats ) ) { $meta_info['categories'] = '' . __( 'in', 'avia_framework') . ' ' . trim( $cats ) . ''; } $meta_info = apply_filters( 'avf_post_metadata_array', $meta_info, 'loop-author' ); // Parity for columns (only relevant for grid) $parity = ''; $first = $post_loop_count == 1 ? 'first' : ''; // Grid Layout if( $atts['type'] == 'grid' ) { ?> '; // End Container // Pagination - just like in loop-index.php if( ! isset( $avia_config['remove_pagination'] ) && $atts['paginate'] == 'yes' ) { echo '
'; echo avia_pagination( '', 'nav' ); echo '
'; } } else { // Nothing found $default_heading = 'h1'; $args = array( 'heading' => $default_heading, 'extra_class' => '' ); $args = apply_filters( 'avf_customize_heading_settings', $args, 'loop_author::nothing_found', array() ); $heading = ! empty( $args['heading'] ) ? $args['heading'] : $default_heading; $css = ! empty( $args['extra_class'] ) ? $args['extra_class'] : ''; $aria_label = 'aria-label="' . __( 'No Author Archive Posts Found', 'avia_framework' ) . '"'; $aria_label = apply_filters( 'avf_aria_label_for_header', $aria_label, __FILE__, [] ); ?>
> " . __( 'Nothing Found', 'avia_framework' ) . ""; ?>

'entry_content' ) ); ?>>