定制 ernilambar/wp-related-posts 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ernilambar/wp-related-posts

最新稳定版本:2.0.0

Composer 安装命令:

composer require ernilambar/wp-related-posts

包简介

WordPress related posts

README 文档

README

WordPress related posts helper class to fetch related posts based on post's taxonomies.

Requirements

  • WordPress 5.1+.
  • PHP 5.6+.
  • Composer for managing PHP dependencies.

Installation

First, you'll need to open your command line tool and change directories to your theme folder.

cd path/to/wp-content/themes/<your-theme-name>

Then, use Composer to install the package.

composer require ernilambar/wp-related-posts

Assuming you're not already including the Composer autoload file for your theme and are shipping this as part of your theme package, you'll want something like the following bit of code in your theme's functions.php to autoload this package (and any others).

The Composer autoload file will automatically load up the package for you and make its code available for you to use.

if ( file_exists( get_parent_theme_file_path( 'vendor/autoload.php' ) ) ) {
  require_once get_parent_theme_file_path( 'vendor/autoload.php' );
}

Usage

You can fetch related post using posts method.

use Nilambar\WPRelatedPosts\RelatedPosts;

$args = array(
  'number'     => 3,
  'taxonomies' => array( 'post_tag' ),
);

$related_posts = RelatedPosts::posts( get_the_ID(), $args );

Copyright and License

This project is licensed under the MIT.

2022 © Nilambar Sharma.

统计信息

  • 总下载量: 158
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-10-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固