Flavita 酷炫美观 wordpress 博客主题 免费主题推荐

WP主题21,1854字数 1957阅读模式

今天,给大家推荐一款 wordpress 主题:Flavita,分为免费版和付费版两种,界面美观酷炫,配置简单省心,兼容性很好。如果你正在寻找一款免费的 wordpress 主题,那么,Flavita 或许是一个不错的选择。在主题界面搜索 Flavita,在线安装即可。

Flavita 酷炫美观 wordpress 博客主题 免费主题推荐-图片1

关于主题

Flavita 主题是 Gradiant 主题的子主题,安装 Flavita 的时候会自动安装 Gradiant 主题,另外,安装 Flavita 主题后会提示安装 Clever Fox 插件。

主题介绍

以下的内容来自官网原话,以便大家更好地了解这款主题。

A powerful next generation theme for upcoming generations and traditional UI that focuses on the color combinations of solid and gradient colors, along with cool animations and attractive features. It's perfect for any type of business.

翻译如下:

这是面向下一代和传统用户界面的强大下一代主题,重点关注纯色和渐变色的颜色组合,以及酷动画和吸引人的功能。它非常适合任何类型的业务。

演示地址

官网地址:https://www.nayrathemes.com/

演示地址:https://www.nayrathemes.com/demo/pro/?theme=flavita

效果预览

Flavita 酷炫美观 wordpress 博客主题 免费主题推荐-图片2

自定义修改

列表页面会显示每篇文章的全部内容,而没有对内容进行截取,比如显示文章内容的前100个字。可以按以下方式进行修改。

1、新建 content-pieruo.php

新建 content-pieruo.php 文件,位置:wp-content/themes/gradiant/template-parts/content/,内容复制同目录下 content-page.php 中的内容,找到下面这段代码:

<div class="post-footer">
    <?php 
        the_content( 
            sprintf( 
                __( 'Read More', 'gradiant' ), 
               '<span class="screen-reader-text"> '.esc_html(get_the_title()).'</span>' 
            ) 
        ); 
    ?>
</div>

将其替换为:

<div class="post-footer">
    <?php if (has_excerpt('')){ 
        echo wp_trim_words( get_the_excerpt(), 100, '...' ); 
    } else { 
        $content = get_the_content();
        $content = wp_strip_all_tags(str_replace(array('[',']'),array('<','>'),$content));
        echo wp_trim_words( $content, 150, '...' ); 
    } ?> 
    <a href="<?php echo esc_url( get_permalink()); ?>" class="more-link">Read More</a> 
    <span class="post-count">
        <?php 
            $idx = $args[0] + 1; 
            if($idx < 10) {
                echo '0' . $idx;
            }else {
                echo $idx;
            }
        ?>
    </span> 
</div>

2、修改 index.php

编辑 index.php 文件,位置:wp-content/themes/gradiant/index.php,找到:

get_template_part('template-parts/content/content','page');

将其替换为:

get_template_part('template-parts/content/content','pieruo',array($idx++));

3、修改 archive.php

编辑 archive.php 文件,位置:wp-content/themes/gradiant/archive.php,找到:

get_template_part('template-parts/content/content','page');

将其替换为:

get_template_part('template-parts/content/content','pieruo',array($idx++));

结束语

Flavita 是一款功能非常强大的 wordpress 博客主题,提供免费版和专业版两种服务,大家如果有兴趣的话可以尝试一下,如果感兴趣的话可以去购买专业版支持一下主题开发者。如果你也很喜欢这一款 wordpress 主题的话,那么赶快来跟我分享使用经验吧!

本文已通过「原本」原创作品认证,转载请注明文章出处及链接。

夏日阳光
  • 本文由 夏日阳光 发表于 2022年7月12日
  • 本文为夏日阳光原创文章,转载请务必保留本文链接:https://www.pieruo.com/218.html
评论  2  访客  1  作者  1
    • maqingxi
      maqingxi 2

      这种分免费版和专业版两种服务的主题,会让人比较纠结,自己做出来的网站和演示网站差别很大。

        • 夏日阳光
          夏日阳光

          @ maqingxi 免费版基本的功能都有了,如果喜欢折腾的话,完全可以自己优化,具体看个人需求吧。

      匿名

      发表评论

      匿名网友
      :?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:
      确定

      拖动滑块以完成验证