Advertisement
Guest User

Untitled

a guest
Dec 2nd, 2024
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 22.42 KB | None | 0 0
  1. <?php
  2. if( ! defined( 'ABSPATH' ) ) {  exit;  }    // Exit if accessed directly
  3.  
  4. global $avia_config, $post_loop_count;
  5.  
  6.  
  7. if( 'disable_blog' == avia_get_option( 'disable_blog' ) )
  8. {
  9.     if( current_user_can( 'edit_posts' ) )
  10.     {
  11.         $msg  = '<strong>' . __( 'Admin notice for:', 'avia_framework' ) . '</strong><br>';
  12.         $msg .= __( 'Blog Posts', 'avia_framework' ) . '<br><br>';
  13.         $msg .= __( 'This element was disabled in your theme settings. You can activate it here:', 'avia_framework' ) . '<br>';
  14.         $msg .= '<a target="_blank" href="' . admin_url( 'admin.php?page=avia#goto_performance') . '">' . __( 'Performance Settings', 'avia_framework' ) . '</a>';
  15.  
  16.         $content = "<span class='av-shortcode-disabled-notice'>{$msg}</span>";
  17.  
  18.         echo $content;
  19.     }
  20.  
  21.      return;
  22. }
  23.  
  24.  
  25. if( empty( $post_loop_count ) )
  26. {
  27.     $post_loop_count = 1;
  28. }
  29.  
  30. $blog_style = ! empty( $avia_config['blog_style'] ) ? $avia_config['blog_style'] : avia_get_option( 'blog_style', 'multi-big' );
  31.  
  32. if( is_single() )
  33. {
  34.     $blog_style = avia_get_option( 'single_post_style', 'single-big' );
  35. }
  36.  
  37. $blog_global_style = avia_get_option( 'blog_global_style', '' ); //alt: elegant-blog
  38.  
  39. $initial_id = avia_get_the_ID();
  40.  
  41. // check if we got posts to display:
  42. if( have_posts() )
  43. {
  44.     while( have_posts() )
  45.     {
  46.         the_post();
  47.  
  48.         /**
  49.          * get the current post id, the current post class and current post format
  50.          */
  51.         $url = '';
  52.         $current_post = array();
  53.         $current_post['post_loop_count'] = $post_loop_count;
  54.         $current_post['the_id'] = get_the_ID();
  55.         $current_post['parity'] = $post_loop_count % 2 ? 'odd' : 'even';
  56.         $current_post['last'] = count( $wp_query->posts ) == $post_loop_count ? ' post-entry-last ' : '';
  57.         $current_post['post_type'] = get_post_type( $current_post['the_id'] );
  58.         $current_post['post_class'] = "post-entry-{$current_post['the_id']} post-loop-{$post_loop_count} post-parity-{$current_post['parity']} {$current_post['last']} {$blog_style}";
  59.         $current_post['post_class'] .= ( $current_post['post_type'] == 'post' ) ? '' : ' post';
  60.         $current_post['post_format'] = get_post_format() ? get_post_format() : 'standard';
  61.         $current_post['post_layout'] = avia_layout_class( 'main', false );
  62.         $blog_content = ! empty( $avia_config['blog_content'] ) ? $avia_config['blog_content'] : 'content';
  63.  
  64.         /**
  65.          * If post uses builder we must change content to excerpt on overview pages to avoid circular calling of shortcodes when used e.g. in ALB blog element
  66.          *
  67.          * @since 5.3           extended to check for all ALB supported post types
  68.          */
  69.         if( 'active' == Avia_Builder()->get_alb_builder_status( $current_post['the_id'] ) && ! is_singular( $current_post['the_id'] ) && in_array( $current_post['post_type'], Avia_Builder()->get_supported_post_types() ) )
  70.         {
  71.            $current_post['post_format'] = 'standard';
  72.            $blog_content = 'excerpt_read_more';
  73.         }
  74.  
  75.         /**
  76.          * Allows especially for ALB posts to change output to 'content'
  77.          * Supported since 4.5.5
  78.          *
  79.          * @since 4.5.5
  80.          * @param string $blog_content
  81.          * @param array $current_post
  82.          * @param string $blog_style
  83.          * @param string $blog_global_style
  84.          * @return string
  85.          */
  86.         $blog_content = apply_filters( 'avf_blog_content_in_loop', $blog_content, $current_post, $blog_style, $blog_global_style );
  87.  
  88.  
  89.         /*  
  90.          * retrieve slider, title and content for this post,...
  91.          */
  92.         $size = strpos( $blog_style, 'big' ) ? ( ( strpos( $current_post['post_layout'], 'sidebar' ) !== false ) ? 'entry_with_sidebar' : 'entry_without_sidebar' ) : 'square';
  93.  
  94.         if( ! empty( $avia_config['preview_mode'] ) && ! empty( $avia_config['image_size'] ) && $avia_config['preview_mode'] == 'custom' )
  95.         {
  96.             $size = $avia_config['image_size'];
  97.         }
  98.  
  99.         /**
  100.          * Change default theme image
  101.          *
  102.          * @since 4.5.4
  103.          * @param string $image_link
  104.          * @param array $current_post
  105.          * @param string $size
  106.          * @return string
  107.          */
  108.         $current_post['slider'] = apply_filters( 'avf_post_featured_image_link', get_the_post_thumbnail( $current_post['the_id'], $size ), $current_post, $size );
  109.  
  110.         /**
  111.          * Backwards comp. to checkbox prior v4.5.3 (now selectbox with '' or '1')
  112.          */
  113.         $hide_featured_image = empty( get_post_meta( $current_post['the_id'], '_avia_hide_featured_image', true ) ) ? false : true;
  114.         if( is_single( $initial_id ) && $hide_featured_image )
  115.         {
  116.             $current_post['slider'] = '';
  117.         }
  118.  
  119.         $current_post['title'] = get_the_title();
  120.  
  121.  
  122.         $aria_label = 'aria-label="' . __( 'Post:', 'avia_framework' ) . ' ' . esc_attr( $current_post['title'] ) . '"';
  123.  
  124.         /**
  125.          * @since 6.0.3
  126.          * @param string $aria_label
  127.          * @param string $context
  128.          * @param array $current_post
  129.          * @return string
  130.          */
  131.         $aria_label = apply_filters( 'avf_aria_label_for_header', $aria_label, __FILE__, $current_post );
  132.  
  133.         /**
  134.          * Allow 3rd party to hook and return a plugin specific content.
  135.          * This returned content replaces Enfold's standard content building procedure.
  136.          *
  137.          * @since 4.5.7.2
  138.          * @param string
  139.          * @param string $context
  140.          * @return string
  141.          */
  142.         $current_post['content'] = apply_filters( 'avf_the_content', '', 'loop_index' );
  143.         if( '' == $current_post['content'] )
  144.         {
  145.             $current_post['content'] = $blog_content == 'content' ? get_the_content( __( 'Read more', 'avia_framework' ) . '<span class="more-link-arrow"></span>' ) : get_the_excerpt();
  146.             $current_post['content'] = $blog_content == 'excerpt_read_more' ? $current_post['content'] . '<div class="read-more-link"><a href="' . get_permalink() . '" class="more-link">' . __( 'Read more', 'avia_framework' ) . '<span class="more-link-arrow"></span></a></div>' : $current_post['content'];
  147.             $current_post['before_content'] = '';
  148.  
  149.             /*
  150.              * ...now apply a filter, based on the post type... (filter function is located in includes/helper-post-format.php)
  151.              */
  152.             $current_post = apply_filters( 'post-format-' . $current_post['post_format'], $current_post );
  153.             $with_slider = empty( $current_post['slider'] ) ? '' : 'with-slider';
  154.  
  155.             /*
  156.              * ... last apply the default wordpress filters to the content
  157.              */
  158.             $current_post['content'] = str_replace( ']]>', ']]&gt;', apply_filters( 'the_content', $current_post['content'] ) );
  159.         }
  160.  
  161.         /*
  162.          * Now extract the variables so that $current_post['slider'] becomes $slider, $current_post['title'] becomes $title, etc
  163.          */
  164.         extract( $current_post );
  165.  
  166.  
  167.         /**
  168.          * render the html:
  169.          */
  170.         echo '<article class="' . implode( ' ', get_post_class( "post-entry post-entry-type-{$post_format} {$post_class} {$with_slider}" ) ) . '" ' . avia_markup_helper( array( 'context' => 'entry', 'echo' => false ) ) . '>';
  171.  
  172.         //  default link for preview images
  173.         $link = ! empty( $url ) ? $url : get_permalink();
  174.  
  175.         //  prepare responsive lightbox images
  176.         $link_lightbox = false;
  177.         $lightbox_attr = '';
  178.  
  179.         /**
  180.          * Allows to ignore any link setting on featured image
  181.          * @link https://kriesi.at/support/topic/remove-featured-image-expand-in-posts/
  182.          *
  183.          * @since 5.7.1
  184.          * @param boolean $ignore_image_links
  185.          * @param array $current_post
  186.          * @return boolean
  187.          */
  188.         $ignore_image_links = apply_filters( 'avf_post_ingnore_featured_image_link', false, $current_post );
  189.  
  190.         //preview image description
  191.         $desc = '';
  192.         $thumb_post = get_post( get_post_thumbnail_id() );
  193.         if( $thumb_post instanceof WP_Post )
  194.         {
  195.             if( '' != trim( $thumb_post->post_excerpt ) )
  196.             {
  197.                 //  return 'Caption' from media gallery
  198.                 $desc = $thumb_post->post_excerpt;
  199.             }
  200.             else if( '' != trim( $thumb_post->post_title ) )
  201.             {
  202.                 //  return 'Title' from media gallery
  203.                 $desc = $thumb_post->post_title;
  204.             }
  205.             else if( '' != trim( $thumb_post->post_content ) )
  206.             {
  207.                 //  return 'Description' from media gallery
  208.                 $desc = $thumb_post->post_content;
  209.             }
  210.         }
  211.  
  212.         $desc = trim( $desc );
  213.         if( '' == $desc )
  214.         {
  215.             $desc = trim( the_title_attribute( 'echo=0' ) );
  216.         }
  217.  
  218.         /**
  219.          * Allows to change the title attribute text for the featured image.
  220.          * If '' is returned, then no title attribute is added.
  221.          *
  222.          * @since 4.6.4
  223.          * @param string $desc
  224.          * @param string $context               'loop_index'
  225.          * @param WP_Post $thumb_post
  226.          */
  227.         $featured_img_title = apply_filters( 'avf_featured_image_title_attr', $desc, 'loop_index', $thumb_post );
  228.  
  229.         $featured_img_title = '' != trim( $featured_img_title ) ? ' title="' . esc_attr( $featured_img_title ) . '" ' : '';
  230.  
  231.         //on single page replace the link with a fullscreen image
  232.         if( is_singular() )
  233.         {
  234.             if( ! $thumb_post instanceof WP_Post )
  235.             {
  236.                 $link = '';
  237.             }
  238.             else
  239.             {
  240.                 $link = avia_image_by_id( $thumb_post->ID, 'large', 'url' );
  241.  
  242.                 $lightbox_img = AviaHelper::get_url( 'lightbox', $thumb_post->ID, true );
  243.                 $lightbox_attr = Av_Responsive_Images()->html_attr_image_src( $lightbox_img, false );
  244.                 $link_lightbox = true;
  245.             }
  246.         }
  247.  
  248.        
  249.  
  250.         echo '<div class="blog-meta">';
  251.  
  252.             $blog_meta_output = '';
  253.             $icon = '<span class="iconfont" ' . av_icon_string( $post_format ) . '></span>';
  254.  
  255.             if( strpos( $blog_style, 'multi' ) !== false )
  256.             {
  257.                 $gravatar = '';
  258.                 $pf_link = get_post_format_link( $post_format );
  259.  
  260.                 if( $post_format == 'standard' )
  261.                 {
  262.                     $author_name = apply_filters( 'avf_author_name', get_the_author_meta( 'display_name', $post->post_author ), $post->post_author );
  263.                     $author_email = apply_filters( 'avf_author_email', get_the_author_meta('email', $post->post_author), $post->post_author );
  264.  
  265.                     $gravatar_alt = esc_html( $author_name );
  266.                     $gravatar = get_avatar( $author_email, '81', 'blank', $gravatar_alt );
  267.                     $pf_link = get_author_posts_url( $post->post_author );
  268.                 }
  269.  
  270.                 $blog_meta_output = "<a href='{$pf_link}' class='post-author-format-type'><span class='rounded-container'>" . $gravatar . $icon . '</span></a>';
  271.             }
  272.             else if( strpos( $blog_style, 'small' ) !== false )
  273.             {
  274.                 if( false === $ignore_image_links )
  275.                 {
  276.                     if( $link_lightbox )
  277.                     {
  278.                         $attr = $lightbox_attr;
  279.                     }
  280.                     else
  281.                     {
  282.                         $attr = "href='{$link}'";
  283.                     }
  284.  
  285.                     $blog_meta_output = "<a {$attr} class='small-preview' {$featured_img_title} " . avia_markup_helper( array( 'context' => 'image', 'echo' => false ) ). ">{$slider}{$icon}</a>";
  286.                 }
  287.                 else
  288.                 {
  289.                     $blog_meta_output = "<div class='small-preview no-image-link' {$featured_img_title} " . avia_markup_helper( array( 'context' => 'image', 'echo' => false ) ). ">{$slider}</div>";
  290.                 }
  291.             }
  292.  
  293.             echo apply_filters( 'avf_loop_index_blog_meta', $blog_meta_output );
  294.  
  295.         echo '</div>';
  296.  
  297.         echo "<div class='entry-content-wrapper clearfix {$post_format}-content'>";
  298.             echo '<header class="entry-content-header" ' . $aria_label . '>';
  299.  
  300.                 if( $blog_style == 'bloglist-compact' )
  301.                 {
  302.                     $format = get_post_format();
  303.                     echo '<span class="fallback-post-type-icon" ' . av_icon_string( $format ) . '></span>';
  304.                 }
  305.  
  306.                 $close_header = '</header>';
  307.  
  308.                 $content_output  = '<div class="entry-content" ' . avia_markup_helper( array( 'context' => 'entry_content', 'echo' => false ) ) . '>';
  309.                 $content_output .=      $content;
  310.                 $content_output .= '</div>';
  311.  
  312.  
  313.                 $taxonomies = get_object_taxonomies( get_post_type( $the_id ) );
  314.                 $cats = '';
  315.  
  316.                 $excluded_taxonomies = array_merge( get_taxonomies( array( 'public' => false ) ), array( 'post_tag', 'post_format' ) );
  317.  
  318.                 /**
  319.                  *
  320.                  * @since ????
  321.                  * @since 4.8.8                     added $context
  322.                  * @param array $excluded_taxonomies
  323.                  * @param string $post_type
  324.                  * @param int $the_id
  325.                  * @param string $context
  326.                  * @return array
  327.                  */
  328.                 $excluded_taxonomies = apply_filters( 'avf_exclude_taxonomies', $excluded_taxonomies, get_post_type( $the_id ), $the_id, 'loop-index' );
  329.  
  330.                 if( ! empty( $taxonomies ) )
  331.                 {
  332.                     foreach( $taxonomies as $taxonomy )
  333.                     {
  334.                         if( ! in_array( $taxonomy, $excluded_taxonomies ) )
  335.                         {
  336.                             $cats .= get_the_term_list( $the_id, $taxonomy, '', ', ', '' ) . ' ';
  337.                         }
  338.                     }
  339.                 }
  340.  
  341.                 //elegant blog
  342.                 //prev: if( $blog_global_style == 'elegant-blog' )
  343.                 if( strpos( $blog_global_style, 'elegant-blog' ) !== false )
  344.                 {
  345.                     $cat_output = '';
  346.  
  347.                     if( ! empty( $cats ) )
  348.                     {
  349.                         $cat_output .= '<span class="blog-categories minor-meta">';
  350.                         $cat_output .=      trim( $cats );
  351.                         $cat_output .= '</span>';
  352.                         $cats = '';
  353.                     }
  354.  
  355.                     if ( in_array( $blog_style, array( 'bloglist-compact', 'bloglist-excerpt' ) ) )
  356.                     {
  357.                         echo $title;
  358.                     }
  359.                     else
  360.                     {
  361.                         // The wrapper div prevents the Safari reader from displaying the content twice  ¯\_(ツ)_/¯
  362.                         echo '<div class="av-heading-wrapper">';
  363.  
  364.                         if( strpos( $blog_global_style, 'modern-blog' ) === false )
  365.                         {
  366.                             echo $cat_output . $title;
  367.                         }
  368.                         else
  369.                         {
  370.                             echo $title . $cat_output;
  371.                         }
  372.  
  373.                         echo '</div>';
  374.                     }
  375.  
  376.                     echo $close_header;
  377.                     $close_header = '';
  378.  
  379.                     if( ! in_array( $blog_style, array( 'bloglist-simple', 'bloglist-compact', 'bloglist-excerpt' ) ) )
  380.                     {
  381.                         echo '<span class="av-vertical-delimiter"></span>';
  382.  
  383.                         //echo preview image
  384.                         if( strpos( $blog_style, 'big' ) !== false )
  385.                         {
  386.                             if( $slider && false === $ignore_image_links )
  387.                             {
  388.                                 if( $link_lightbox )
  389.                                 {
  390.                                     $slider = '<a ' . $lightbox_attr . ' ' . $featured_img_title . '>' . $slider . '</a>';
  391.                                 }
  392.                                 else
  393.                                 {
  394.                                     $slider = '<a href="' . $link . '" ' . $featured_img_title . '>' . $slider . '</a>';
  395.                                 }
  396.                             }
  397.  
  398.                             if( $slider )
  399.                             {
  400.                                 echo '<div class="big-preview ' . $blog_style . '" ' . avia_markup_helper( array( 'context' => 'image', 'echo' => false ) ) . '>' . $slider . '</div>';
  401.                             }
  402.                         }
  403.  
  404.                         if( ! empty( $before_content ) )
  405.                         {
  406.                             echo '<div class="big-preview ' . $blog_style . '">' . $before_content . '</div>';
  407.                         }
  408.  
  409.                         echo $content_output;
  410.                     }
  411.  
  412.                     $cats = '';
  413.                     $title = '';
  414.                     $content_output = '';
  415.                 }
  416.  
  417.                 echo $title;
  418.  
  419.                 if( ! in_array( $blog_style, array( 'bloglist-simple', 'bloglist-compact', 'bloglist-excerpt' ) ) )
  420.         {
  421.             //echo preview image
  422.             if( strpos( $blog_global_style, 'elegant-blog' ) === false )
  423.             {
  424.                 if( strpos( $blog_style, 'big' ) !== false )
  425.                 {
  426.                     if( $slider && false === $ignore_image_links )
  427.                     {
  428.                         if( $link_lightbox )
  429.                         {
  430.                             $slider = '<a ' . $lightbox_attr . ' ' . $featured_img_title . '>' . $slider . '</a>';
  431.                         }
  432.                         else
  433.                         {
  434.                             $slider = '<a href="' . $link . '" ' . $featured_img_title . '>' . $slider . '</a>';
  435.                         }
  436.                     }
  437.  
  438.                     if( $slider )
  439.                     {
  440.                         echo '<div class="big-preview ' . $blog_style . '" ' . avia_markup_helper( array( 'context' => 'image', 'echo' => false ) ) . '>' . $slider . '</div>';
  441.                     }
  442.                 }
  443.  
  444.                 if( ! empty( $before_content ) )
  445.                 {
  446.                     echo '<div class="big-preview ' . $blog_style . '">' . $before_content . '</div>';
  447.                 }
  448.             }
  449.         }
  450.  
  451.                 if( $blog_style !== 'bloglist-compact' )
  452.                 {
  453.                     echo '<span class="post-meta-infos">';
  454.  
  455.                         $meta_info = array();
  456.  
  457.                         /**
  458.                          * @since 4.8.8
  459.                          * @param string $hide_meta_only
  460.                          * @param string $context
  461.                          * @return string
  462.                          */
  463.                         $meta_separator = apply_filters( 'avf_post_metadata_seperator', '<span class="text-sep">/</span>', 'loop-index' );
  464.  
  465.                         if( 'blog-meta-date' == avia_get_option( 'blog-meta-date' ) )
  466.                         {
  467.                             $meta_time  = '<time class="date-container minor-meta updated" ' . avia_markup_helper( array( 'context' => 'entry_time', 'echo' => false ) ) . '>';
  468.  
  469.                             /**
  470.                              * Modify date displayed for meta data of blog
  471.                              *
  472.                              * @used_by                enfold\config-events-calendar\config.php  avia_events_modify_event_publish_date()    10
  473.                              * @since 5.3
  474.                              * @param string $published_time
  475.                              * @param int $current_post['the_id']
  476.                              * @param string $date_format
  477.                              * @return string
  478.                              */
  479.                             $meta_time .=       apply_filters( 'avf_loop_index_meta_time', get_the_time( get_option( 'date_format' ) ), $current_post['the_id'], get_option( 'date_format' ) );
  480.  
  481.                             $meta_time .= '</time>';
  482.  
  483.                             $meta_info['date'] = $meta_time;
  484.                         }
  485.  
  486.                         if( 'blog-meta-comments' == avia_get_option( 'blog-meta-comments' ) )
  487.                         {
  488.                             if( get_comments_number() != '0' || comments_open() )
  489.                             {
  490.                                 $meta_comment = '<span class="comment-container minor-meta">';
  491.  
  492.                                 ob_start();
  493.                                 comments_popup_link(
  494.                                                 "0 " . __( 'Comments', 'avia_framework' ),
  495.                                                 "1 " . __( 'Comment' , 'avia_framework' ),
  496.                                                 "% " . __( 'Comments', 'avia_framework' ),
  497.                                                 'comments-link',
  498.                                                 __( 'Comments Disabled', 'avia_framework' )
  499.                                             );
  500.  
  501.                                 $meta_comment .= ob_get_clean();
  502.                                 $meta_comment .= '</span>';
  503.  
  504.                                 $meta_info['comment'] = $meta_comment;
  505.                             }
  506.                         }
  507.  
  508.                         if( 'blog-meta-category' == avia_get_option( 'blog-meta-category' ) )
  509.                         {
  510.                             if( ! empty( $cats ) )
  511.                             {
  512.                                 $meta_cats  = '<span class="blog-categories minor-meta">' . __( 'in', 'avia_framework') . ' ';
  513.                                 $meta_cats .=   trim( $cats );
  514.                                 $meta_cats .= '</span>';
  515.  
  516.                                 $meta_info['categories'] = $meta_cats;
  517.                             }
  518.                         }
  519.  
  520.                         /**
  521.                          * Allow to change theme options setting for certain posts
  522.                          *
  523.                          * @since 4.8.8
  524.                          * @param boolean $show_author_meta
  525.                          * @param string $context
  526.                          * @return boolean
  527.                          */
  528.                         if( true === apply_filters( 'avf_show_author_meta', 'blog-meta-author' == avia_get_option( 'blog-meta-author' ), 'loop-index' ) )
  529.                         {
  530.                             $meta_author  = '<span class="blog-author minor-meta">' . __( 'by', 'avia_framework' ) . ' ';
  531.                             $meta_author .=     '<span class="entry-author-link" ' . avia_markup_helper( array( 'context' => 'author_name', 'echo' => false ) ) . '>';
  532.                             $meta_author .=         '<span class="author">';
  533.                             $meta_author .=             '<span class="fn">';
  534.                             $meta_author .=                 get_the_author_posts_link();
  535.                             $meta_author .=             '</span>';
  536.                             $meta_author .=         '</span>';
  537.                             $meta_author .=     '</span>';
  538.                             $meta_author .= '</span>';
  539.  
  540.                             $meta_info['author'] = $meta_author;
  541.                         }
  542.  
  543.                         if( ! is_single() )
  544.                         {
  545.                             /**
  546.                              * Allow to show/hide tags meta data of post. Overrule default behaviour prior 5.4
  547.                              *
  548.                              * @since 5.4
  549.                              * @param boolean $show_meta_tags
  550.                              * @param string $context
  551.                              * @return boolean
  552.                              */
  553.                             $show_meta_tags = apply_filters( 'avf_show_tags_meta', false, 'loop-index' );
  554.  
  555.                             if( $show_meta_tags && has_tag() )
  556.                             {
  557.                                 $meta_tags  = '<span class="blog-tags-header minor-meta">';
  558.                                 $meta_tags .=       get_the_tag_list( __( 'Tags:', 'avia_framework' ) . ' <span> ', ', ', '</span>' );
  559.                                 $meta_tags .= '</span>';
  560.  
  561.                                 $meta_info['tags'] = $meta_tags;
  562.                             }
  563.                         }
  564.  
  565.                         /**
  566.                          * Modify the post metadata array
  567.                          *
  568.                          * @since 4.8.8
  569.                          * @param array $meta_info
  570.                          * @param string $context
  571.                          * @return array
  572.                          */
  573.                         $meta_info = apply_filters( 'avf_post_metadata_array', $meta_info, 'loop-index' );
  574.  
  575.                         echo implode( $meta_separator, $meta_info );
  576.  
  577.                         if( $blog_style == 'bloglist-simple' )
  578.                         {
  579.                             echo '<div class="read-more-link"><a href="' . get_permalink() . '" class="more-link">' . __( 'Read more', 'avia_framework' ) . '<span class="more-link-arrow"></span></a></div>';
  580.                         }
  581.  
  582.                     echo '</span>';
  583.  
  584.                 } // display meta-infos on all layouts except bloglist-compact
  585.  
  586.                 echo $close_header;
  587.  
  588.  
  589.                 // echo the post content
  590.                 if ( $blog_style == 'bloglist-excerpt' )
  591.                 {
  592.                     the_excerpt();
  593.  
  594.                     echo '<div class="read-more-link">';
  595.                     echo    '<a href="' . get_permalink() . '" class="more-link">' . __( 'Read more', 'avia_framework' );
  596.                     echo        '<span class="more-link-arrow"></span>';
  597.                     echo    '</a>';
  598.                     echo '</div>';
  599.                 }
  600.  
  601.                 if ( ! in_array( $blog_style, array( 'bloglist-simple', 'bloglist-compact', 'bloglist-excerpt' ) ) )
  602.                 {
  603.                     echo $content_output;
  604.                 }
  605.  
  606.                 echo '<footer class="entry-footer">';
  607.  
  608.                     $avia_wp_link_pages_args = apply_filters( 'avf_wp_link_pages_args', array(
  609.                                                                         'before'    => '<nav class="pagination_split_post">' . __( 'Pages:', 'avia_framework' ),
  610.                                                                         'after'     => '</nav>',
  611.                                                                         'pagelink'  => '<span>%</span>',
  612.                                                                         'separator' => ' ',
  613.                                                                     ) );
  614.  
  615.                     wp_link_pages( $avia_wp_link_pages_args );
  616.  
  617.                     if( is_single() && ! post_password_required() )
  618.                     {
  619.                         //tags on single post
  620.                         if( 'blog-meta-tag' == avia_get_option( 'blog-meta-tag' ) && has_tag() )
  621.                         {
  622.                             echo '<span class="blog-tags minor-meta">';
  623.                                     the_tags( '<strong>' . __( 'Tags:', 'avia_framework' ) . '</strong><span> ' );
  624.                             echo '</span></span>';
  625.                         }
  626.  
  627.                         //share links on single post
  628.                         avia_social_share_links_single_post();
  629.                     }
  630.  
  631.                     do_action( 'ava_after_content', $the_id, 'post' );
  632.  
  633.             echo '</footer>';
  634.  
  635.             echo "<div class='post_delimiter'></div>";
  636.  
  637.         echo '</div>';
  638.  
  639.         echo '<div class="post_author_timeline"></div>';
  640.         echo av_blog_entry_markup_helper( $current_post['the_id'] );
  641.  
  642.         echo '</article>';
  643.  
  644.         $post_loop_count++;
  645.     }
  646. }
  647. else
  648. {
  649.     $default_heading = 'h1';
  650.     $args = array(
  651.                 'heading'       => $default_heading,
  652.                 'extra_class'   => ''
  653.             );
  654.  
  655.     /**
  656.      * @since 4.5.5
  657.      * @return array
  658.      */
  659.     $args = apply_filters( 'avf_customize_heading_settings', $args, 'loop_index::nothing_found', array() );
  660.  
  661.     $heading = ! empty( $args['heading'] ) ? $args['heading'] : $default_heading;
  662.     $css = ! empty( $args['extra_class'] ) ? $args['extra_class'] : '';
  663.  
  664.     $aria_label = 'aria-label="' . __( 'No Posts Found', 'avia_framework' ) . '"';
  665.  
  666.     /**
  667.      * @since 6.0.3
  668.      * @param string $aria_label
  669.      * @param string $context
  670.      * @param array $nothing_found
  671.      * @return string
  672.      */
  673.     $aria_label = apply_filters( 'avf_aria_label_for_header', $aria_label, __FILE__, [] );
  674.  
  675. ?>
  676.     <article class="entry">
  677.         <header class="entry-content-header" <?php echo $aria_label; ?> >
  678. <?php
  679.             echo "<{$heading} class='post-title entry-title {$css}'>" . __( 'Nothing Found', 'avia_framework' ) . "</{$heading}>";
  680. ?>
  681.         </header>
  682.  
  683.         <p class="entry-content" <?php avia_markup_helper( array( 'context' => 'entry_content' ) ); ?>><?php _e( 'Sorry, no posts matched your criteria', 'avia_framework' ); ?></p>
  684.  
  685.         <footer class="entry-footer"></footer>
  686.     </article>
  687.  
  688. <?php
  689. }
  690.  
  691. if( empty( $avia_config['remove_pagination'] ) )
  692. {
  693.     echo "<div class='{$blog_style}'>" . avia_pagination( '', 'nav' ) . '</div>';
  694. }
  695.  
  696.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement