vb.net判断当前操作系统是否是64位还是32位
作者:admin 日期:2022-03-31
Ajax解决缓存的5种方法总结(推荐)
作者:admin 日期:2022-03-22
1、在ajax发送请求前加上 anyAjaxObj.setRequestHeader(“If-Modified-Since”,”0″)。
wordpress调用指定分类文章如何实现
作者:admin 日期:2022-03-13
wordpress是很强大的cms系统,你可以通过相关函数就能实现相关的功能。很多网友会问wordpress怎么调用指定分类文章的呢?其实很简单,随ythah一起来看看吧,几行代码就解决了,代码如下
1
2
3
4
5
6
|
<ul>
<?php query_posts('cat=1&showposts=5'); //cat是要调用的分类ID,showposts是需要显示的文章数量 ?>
<?php while (have_posts()) : the_post(); ?>
<li><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></li>
<?php endwhile; wp_reset_query(); ?>
</ul>
|
是不是很方便?当然css样式可以自己定义
如果想从第二篇开始调用可以加一个参数&offset=1,第三篇开始调用就用&offset=2,以此类推
WordPress函数:wp_list_categories(分类列表)
作者:admin 日期:2022-03-13
wordpress调用当前分类的全部子分类
作者:admin 日期:2022-03-13
wordpress在制作企业主题的时候比较常遇到要调用当前分类下的全部子分类。要实现这个可以按照以下步骤操作。
首先在主题的“functions.php”里面写个函数,代码如下:
- // 获取子分类
- function get_category_root_id($cat){
- $this_category = get_category($cat);
- while($this_category->category_parent) {
- $this_category = get_category($this_category->category_parent);
- }
- return $this_category->term_id;
- }
然后在需要调用的页面里写以下代码:
- <?php
- if(is_category()) {
- $cat = get_query_var('cat');
- $categoryurl = get_category_link($cat);
- if(get_category_children(get_category_root_id(the_category_ID(false)))!= "" ) {
- echo wp_list_categories("child_of=".get_category_root_id(the_category_ID(false)). "&depth=0&hide_empty=0&title_li=&orderby=id&order=ASC");
- }
- }
- ?>
最后自己调整下css就ok了。
WinHttpRequest SetProxy 方法详解,设置代理服务器信息
作者:admin 日期:2022-03-11
WinHttpRequest SetProxy 方法详解,设置代理服务器信息。
IWinHttpRequest::SetProxy Method
The SetProxy method sets proxy server information.
语法:
HRESULT SetProxy( [in] HTTPREQUEST_PROXY_SETTING ProxySetting, [in, optional] VARIANT ProxyServer, [in, optional] VARIANT BypassList );
参数:
广告位