Friday, August 26, 2022
HomeWordPress DevelopmentTag,php - get it to show featured publish picture?

Tag,php – get it to show featured publish picture?


My weblog web page dislays publish title, featured publish picture and browse extra button. Nonetheless, the theme is restricted and there’s no solution to management tags web page. For some cause once I click on on a tag within the tag cloud, I get publish title and browse extra button, no picture. Methods to add the picture?
Right here is my tag.php

<?php
if( ! outlined( 'ABSPATH' ) ){ die(); }

international $avia_config, $extra;

/*
 * get_header is a fundamental wordpress perform, used to retrieve the header.php file in your theme listing.
 */
 get_header();


 $header_settings = avia_header_setting();
 $no_title = $header_settings['header_title_bar'] == 'hidden_title_bar' || $header_settings['header_title_bar'] == 'breadcrumbs_only';


 echo avia_title( array( 'title' => avia_which_archive() ) );

 do_action( 'ava_after_main_title' );

?>

    <div class="container_wrap container_wrap_first main_color <?php avia_layout_class( "important' ); ?>'>

        <div class="container template-blog ">

            <important class="content material <?php avia_layout_class( "content material' ); ?> models' <?php avia_markup_helper( array( 'context' => 'content material' ) );?>>

                <div class="category-term-description">
                    
                    <?php echo term_description(); ?>
                </div>

                <?php
                international $wp_query, $posts;

                $backup_query = $wp_query;

                $sorted = array( 'publish' => array() );
                $post_type_obj = array();

                foreach( $posts as $publish )
                {
                    $sorted[ $post->post_type ][] = $publish;
                    if( empty( $post_type_obj[ $post->post_type] ) )
                    {
                        $post_type_obj[ $post->post_type ] = get_post_type_object( $post->post_type );
                    }
                }

                $avia_config['blog_style'] = apply_filters( 'avf_blog_style', avia_get_option( 'blog_style', 'multi-big' ), 'tag' );

                $default_heading = 'h3';
                $args = array(
                            'heading'       => $default_heading,
                            'extra_class'   => ''
                        );

                /**
                 * @since 4.5.5
                 * @return array
                 */
                $args = apply_filters( 'avf_customize_heading_settings', $args, 'tag', array() );

                $heading = ! empty( $args['heading'] ) ? $args['heading'] : $default_heading;
                $css = ! empty( $args['extra_class'] ) ? $args['extra_class'] : '';

                if( $avia_config['blog_style'] == 'blog-grid' )
                {
                    $output="";
                    $post_ids = array();
                    foreach( $posts as $publish )
                    {
                        $post_ids[] = $post->ID;
                    }

                    if( ! empty( $post_ids ) )
                    {
                        echo "<div class="entry-content-wrapper">";

                        foreach( $sorted as $key => $post_type )
                        {
                            if( empty( $post_type ) )
                            {
                                proceed;
                            }

                            if( isset( $post_type_obj[ $key ]->labels->title ) )
                            {
                                $label = $post_type_obj[ $key ]->labels->title;
                                if( $no_title )
                                {
                                    $label = __( 'Tag Archive for:', 'avia_framework' ) . '  <span>' . single_tag_title( '', false ) . '</span>';
                                }

                                /**
                                 * @since ???
                                 * @since 4.8.8         added $label, moved $post_type_obj[ $key ]->labels->title as second, $title
                                 * @param string $label
                                 * @param string $post_type_obj[ $key ]->labels->title
                                 * @param string $title
                                 * @return string
                                 */
                                $label = apply_filters( 'avf_tag_label_names',$label, $post_type_obj[ $key ]->labels->title, $title );

                                $output .= "<{$heading} class="post-title tag-page-post-type-title {$css}">{$label}</{$heading}>";
                            }
                            else
                            {
                                $output .= '<hr />';
                            }

                            $atts = array(
                                        'kind'          => 'grid',
                                        'gadgets'         => get_option( 'posts_per_page' ),
                                        'columns'       => 3,
                                        'class'         => 'avia-builder-el-no-sibling',
                                        'paginate'      => 'sure',
                                        'use_main_query_pagination' => 'sure',
                                        'custom_query'  => array(
                                                                'post__in'  => $post_ids,
                                                                'post_type' => $key
                                                            )
                                    );

                            /**
                             * @since 4.5.5
                             * @return array
                             */
                            $atts = apply_filters( 'avf_post_slider_args', $atts, 'tag' );

                            $weblog = new avia_post_slider( $atts );
                            $blog->query_entries();

                            $output .= $blog->html();
                        }

                        echo $output;
                        echo '</div>';
                    }
                    else
                    {
                        get_template_part( 'contains/loop', 'index' );
                    }
                }
                else
                {
                    foreach( $sorted as $key => $post_type )
                    {
                        if( empty( $post_type ) )
                        {
                            proceed;
                        }

                        if( isset( $post_type_obj[ $key ]->labels->title ) )
                        {
                            $label = $post_type_obj[ $key ]->labels->title;
                            if( $no_title )
                            {
                                $label = __( 'Tag Archive for:', 'avia_framework' ) . '  <span>' . single_tag_title( '', false ) . '</span>';
                            }

                            /**
                             * @since ???
                             * @since 4.8.8         added $label, moved $post_type_obj[ $key ]->labels->title as second, $title
                             * @param string $label
                             * @param string $post_type_obj[ $key ]->labels->title
                             * @param string $title
                             * @return string
                             */
                            $label = apply_filters( 'avf_tag_label_names', $label, $post_type_obj[ $key ]->labels->title, $title );

                            echo "<{$heading} class="post-title tag-page-post-type-title {$css}">{$label}</{$heading}>";
                        }
                        else
                        {
                            echo "<hr />";
                        }

                        if( $key == 'portfolio' )
                        {
                            $args = array_merge( $wp_query->query_vars, array( 'post_type' => $key ) );
                            query_posts( $args );

                            $grid = new avia_post_grid( array(
                                            'linking'           => '',
                                            'columns'           => '3',
                                            'contents'          => 'title',
                                            'kind'              => 'no',
                                            'paginate'          => 'sure',
                                            'set_breadcrumb'    => false,
                                        ));

                            $grid->use_global_query();
                            echo $grid->html( '' );
                        }
                        else
                        {
                            $args = array_merge( $wp_query->query_vars, array( 'post_type' => $key ) );
                            query_posts( $args );

                            $extra = 0;
                            get_template_part( 'contains/loop', 'index' );
                        }

                        $wp_query = $backup_query;
                    }
                }
                ?>

            <!--end content-->
            </important>

            <?php

            //get the sidebar
            $avia_config['currently_viewing'] = 'weblog';
            get_sidebar();

            ?>

        </div><!--end container-->

    </div><!-- shut default .container_wrap factor -->

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments