SOHO创业

WordPress调用指定分类文章

wordpress按分类ID调用指定分类的文章代码

<?php
    $args=array(
        'cat' => 1,   // 分类ID
        'posts_per_page' => 10, // 显示篇数

    );
    query_posts($args);

    if(have_posts()) : while (have_posts()) : the_post();
?>
    <li>
        <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> 
    </li>
<?php  endwhile; endif; wp_reset_query(); ?>
Published
Categorized as 建站知识 Tagged

By SOHO

wowsoho.com是一个关注跨境电商、创业话题的网站。

打造专业WP外贸建站平台功能全面解析

  在全球化的商业环境中,拥有一个专业且高效的外贸网站对于企业的成功至关重要。WordPress作为一款强大而… Continue reading 打造专业WP外贸建站平台功能全面解析

GGD独立站的10大优势

GGD独立站,即Google独立站,是一种依托Google生态系统进行营销推广的跨境电商独立站模式。

wordpress调用当前页面ID

在wordpress调用当前页面ID代码

非插件纯代码方式实现WordPress SMTP邮件功能

非插件纯代码方式实现WordPressSMTP邮件功能

The best independent website building platform for foreign trade

The best template website building platform

如何在WordPress中通过post文章ID获取分类名称

这是个简单的方法,在WordPress中列出一篇文章的所属类别名称。通过以下这段代码就可以实现。