dtyyrt4545 2019-04-24 20:07
浏览 541

WordPress搜索结果页面自定义

Is there a way to customize the search results page to show the original text formatting in the post_text_inner class as its seen on the original post or portfolio page instead of showing everything on 1-line in plain text.

I am trying to modify the blog_search-loop.php file, but don't see what I have to add or where. Thanks.

<div class="post_text">
            <div class="post_text_inner">
                <h2 itemprop="name" class="entry_title"><span itemprop="dateCreated" class="date entry_date updated"><?php the_time('d M'); ?><meta itemprop="interactionCount" content="UserComments: <?php echo get_comments_number(qode_get_page_id()); ?>"/></span> <a itemprop="url" href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
                <div class="post_info">
                    <span class="time"><?php _e('Posted at','qode'); ?> <?php the_time('H:i'); ?><?php _e('h','qode'); ?></span>

                    <?php $category = get_the_category(get_the_ID()); ?>
                    <?php if(!empty($category)){ ?>
                            <?php _e('in','qode'); ?>
                            <?php the_category(', '); ?>
                    <?php }
                    ?>
                    <?php if($blog_hide_author == "no") { ?>
                        <span class="post_author">
                                    <?php _e('by','qode'); ?>
                            <a itemprop="author" class="post_author_link" href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>"><?php the_author_meta('display_name'); ?></a>
                                </span>
                    <?php } ?>
                    <?php if($blog_hide_comments != "yes"){ ?>
                        <span class="dots"><i class="fa fa-square"></i></span><a itemprop="url" class="post_comments" href="<?php comments_link(); ?>" target="_self"><?php comments_number('0 ' . __('Comments','qode'), '1 '.__('Comment','qode'), '% '.__('Comments','qode') ); ?></a>
                    <?php } ?>
                    <?php if( $qode_like == "on" ) { ?>
                        <span class="dots"><i class="fa fa-square"></i></span><div class="blog_like">
                            <?php if( function_exists('qode_like') ) qode_like(); ?>
                        </div>
                    <?php } ?>
                    <?php if(isset($qode_options_proya['enable_social_share'])  && $qode_options_proya['enable_social_share'] == "yes") { ?>
                        <span class="dots"><i class="fa fa-square"></i></span><?php echo do_shortcode('[social_share]'); ?>
                    <?php } ?>
                </div>
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 微信会员卡接入微信支付商户号收款
    • ¥15 如何获取烟草零售终端数据
    • ¥15 数学建模招标中位数问题
    • ¥15 phython路径名过长报错 不知道什么问题
    • ¥15 深度学习中模型转换该怎么实现
    • ¥15 HLs设计手写数字识别程序编译通不过
    • ¥15 Stata外部命令安装问题求帮助!
    • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
    • ¥15 TYPCE母转母,插入认方向
    • ¥15 如何用python向钉钉机器人发送可以放大的图片?