GG谷歌电商做新手入门AMZ123 - 第一推荐源头

前言:在WordPress外贸建站项目中,我们经常需要灵活调用特定分类的文章内容。本文将分享一个实用的解决方案。 Introduction: For WordPress foreign trade websites, we ofte

WordPress建站教程:如何在任意位置调用分类文章

前言:在WordPress外贸建站项目中,我们经常需要灵活调用特定分类的文章内容。本文将分享一个实用的解决方案。

Introduction: For WordPress foreign trade websites, we often need to flexibly display posts from specific categories. This tutorial shares a practical solution.

问题背景

Background

在改版一个老旧WordPress外贸网站时,需要在指定位置显示特定分类的文章。常用的YARPP插件只能实现相关文章推荐,无法满足首页等页面的定制需求。

While revamping an old WordPress foreign trade website, we needed to display posts from specific categories in designated locations. The popular YARPP plugin only works for related posts, not meeting our customization needs for homepage etc.

解决方案:News & Blog Designer Pack插件

Solution: News & Blog Designer Pack Plugin

经过测试,我们发现News & Blog Designer Pack插件能完美解决这个问题。它不仅可以设计博客样式,还能通过Shortcode Generator功能灵活调用文章。

After testing, we found the News & Blog Designer Pack plugin perfectly solves this issue. It not only designs blog layouts but also flexibly displays posts via its Shortcode Generator.

详细操作步骤

Step-by-Step Guide

步骤1:安装插件

Step 1: Install Plugin

在WordPress后台搜索"News & Blog Designer Pack"并安装激活。

Search for "News & Blog Designer Pack" in WordPress dashboard and install it.

步骤2:设置Shortcode Generator

Step 2: Configure Shortcode Generator

1. 进入插件设置 → Shortcode Generator
2. 选择样式和每行显示数量
3. 设置需要显示的分类
4. 复制生成的短代码

1. Go to plugin settings → Shortcode Generator
2. Select layout and posts per row
3. Set target categories
4. Copy the generated shortcode

示例短代码:
[bdp_post design="design-2" grid="5" show_author="false" show_tags="false" show_comments="false" limit="10" category="1196,1195"]

Sample shortcode:
[bdp_post design="design-2" grid="5" show_author="false" show_tags="false" show_comments="false" limit="10" category="1196,1195"]

步骤3:嵌入代码

Step 3: Implement Code

现代WordPress版本:直接在古腾堡编辑器添加简码模块

For modern WordPress: Simply add a shortcode block in Gutenberg editor

老旧版本解决方案:编辑主题文件添加PHP代码

For old versions: Edit theme files to add PHP code

 <?php echo do_shortcode('[bdp_post design="design-2" grid="5" show_author="false" show_tags="false" show_comments="false" limit="10" category="1196,1195"]'); ?> 

SEO优化提示

SEO Tips

1. 合理使用分类调用可以提升网站内部链接结构
2. 保持文章调用的相关性有助于降低跳出率
3. 定期更新调用的分类内容有利于SEO

1. Proper category display improves internal linking
2. Maintaining content relevance helps reduce bounce rate
3. Regularly updating displayed categories benefits SEO

WordPress建站教程:如何在任意位置调用分类文章