SOHO创业

wordpress调用随机文章和随机推荐文章

wordpress调用随机文章的代码如下:

<?php
$query = array(
'post_type' => 'post',
'orderby' => 'rand'
);
$posts = new WP_Query( $query );
if ( $posts->have_posts() ) {
while( $posts->have_posts() ) :
$posts->the_post();
the_content();
endwhile;
}
wp_reset_query();
?>

wordpress随机调用置顶推荐的文章代码:

<?php
//获取置顶文章的ID串
$rand_id = get_option( 'sticky_posts' );
$query = array(
'post__in' => $rand_id,
'post_type' => 'post',
'orderyby' => 'rand',
'numberposts' => 2
);
$posts = new WP_Query( $query );
if ( $posts->have_posts() ) {
while( $posts->have_posts() ) :
$posts->the_post();
the_content();
endwhile;
}
wp_reset_query();
?>
Published
Categorized as 建站知识 Tagged ,

By SOHO

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

年入百万的跨境电商独立站都有哪些共同点

希望本文的深度分析能够为跨境电商从业者提供有价值的参考,助力他们在竞争激烈的市场中脱颖而出,实现年入百万的目标。

为wordpress核心functions文件瘦身

这个方法的好处是,把不同的扩展文件,分别存放,极大的降低了直接修改functions.php文件出错的概率。

我用过的Google SEO方面效果最满意的主题

记住,SEO是一个长期的过程,需要耐心和持续的努力。如果您需要更多关于SEO的建议或帮助,请随时提问。

为不同的页面调用不同的头部文件

将以上代码加入调用的header中,会根据不同页面调用不同的header文件,分别为header-home.php与header-about.php,默认为header.php

东南亚跨境电商的发展潜力

东南亚跨境电商市场凭借其快速成长的市场规模、年轻且多元化的消费群体、政府政策支持以及完善的基础设施建设,展现出巨大的发展潜力。

Создание сайтов на русском языке

Китайская компания WordPress Services JianzhanPress.com… Continue reading Создание сайтов на русском языке