让WordPress友情链接只在首页显示
通过is_home()函数,可以判断当前页面是否是首页,如果是首页,就执行,完整代码如下: < ?php if(is_home()) { ?> <div> <h4>友情链接</h4> <ul> < ?php wp_list_bookmarks(‘title_li=&categorize=0′); ?>...
View ArticleHow to Exclude A WordPress Category From Search Results
Insert the code to search.php after <?php get_header(); ?> <?php $page = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; $s = get_query_var(‘s’);...
View ArticleWP Best Plugins
seo smart links all in one seo pack wp cumulus wprobot zipposter faster image insert Lightbox 2 fancybox for wordpress google xml sitemap ddsitemapgen Share and Follow sharethis onlywire autoposter...
View ArticleHow to Exclude WordPress Pages From Search Results?
In short, just add this to your theme’s functions.php file (or create the file if it doesn’t exist): <?php function mySearchFilter($query) { if ($query->is_search) { $query->set(‘post_type’,...
View ArticleUsing Google search within a WordPress site
Let’s face it; WordPress search sucks. Its harsh, I know, but its true. Google didn’t dominate the Internet because they found decent search results. They’ve built an empire upon sophisticated...
View Article利用shortcodes pro插件在post中插入一个目录下的任意图片
安装shortcodes pro插件后,新建shortcode,选php, 以下代码是显示某个目录下任意一张图片的代码 <?php $imglist=''; //用$img_folder变量保存图片所在目录,必须用“/”结尾 $img_folder = "images/"; mt_srand((double)microtime()*1000); //使用目录类 $imgs =...
View Article
More Pages to Explore .....