Skip to content

Commit

Permalink
fix:fixed related post error with default post format
Browse files Browse the repository at this point in the history
  • Loading branch information
bigfa committed Sep 13, 2024
1 parent 4f7bc83 commit 93ac111
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@ Farallon is a simple single column wordpress theme with perfect performace and e

[中文说明](https://github.com/bigfa/Farallon/blob/develop/README_CN.md)

latest version : `0.7.3`
latest version : `0.7.4`

[Simple User Guide(Chinese)](https://fatesinger.com/101971)

## Changelog

### 0.7.4

- fixed related post error with default post format

### 0.7.3

- stable release
Expand Down
6 changes: 5 additions & 1 deletion README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@

![Wordpress 主题 Farallon](https://static.fatesinger.com/2023/06/u1ak8xgmyn9ec24r.png)

最新版本: `0.7.3`
最新版本: `0.7.4`

本主题禁止各种修改作者链接打包重新发布的行为。

[简单的使用文档](https://fatesinger.com/101971)

## 更新日志

### 0.7.4

- 修复默认文章格式下相关文章错误的问题

### 0.7.3

- 稳定版发布
Expand Down
2 changes: 1 addition & 1 deletion style.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ Theme URI: https://github.com/bigfa/Farallon
Author: bigfa
Author URI: https://github.com/bigfa
Description: theme 2024
Version: 0.7.3
Version: 0.7.4
Tags: Minimalism, Responsive
*/
4 changes: 2 additions & 2 deletions template-parts/single-related.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
'post__not_in' => array(get_the_ID()),
'posts_per_page' => 6,
'category__in' => wp_get_post_categories(get_the_ID()),
'tax_query' => array( // same post format
'tax_query' => get_post_format(get_the_ID()) ? array( // same post format
array(
'taxonomy' => 'post_format',
'field' => 'slug',
'terms' => array('post-format-' . get_post_format(get_the_ID())),
'operator' => 'IN'
)
)
) : array()
));
while ($the_query->have_posts()) : $the_query->the_post(); ?>
<?php if (get_post_format(get_the_ID()) == 'status') : ?>
Expand Down

0 comments on commit 93ac111

Please sign in to comment.