<?php /** * Template Name: wordpress * Description: A Page Template that adds a sidebar to pages * * @package WordPress * @subpackage Twenty_Eleven * @since Twenty Eleven 1.0 */ get_header(); ?> <div id=”primary”> <div id=”content” role=”main”> <?php //for each category, show 3 posts $cat_args=array( ‘orderby’ => ‘name’, ‘order’ => ‘ASC’ ); $categories=get_categories($cat_args); foreach($categories as … Continue reading
Tag Archives: Post
How To Avoid Duplicate Posts
I’m developing a new theme and I’m having trouble getting duplicate posts from showing when running two loops (one standard loop and one from a specific category). Even when I copied the specific code from directly from the codex, it was not working. The Codex article the reader mentioned was regarding the Loop. Although the … Continue reading
How to Disable Comment Feeds for Individual Posts
By default, WordPress generates a RSS feed for the comments on every post. Many sites take advantage of this by offering the feed next to the comments area, enabling anyone to stay current with conversation. A typical feed menu for many blogs includes the following items: Main Content Feed (posts, articles, etc.) Main Comments Feed … Continue reading
Display Blog Posts on any Page (with navigation)
By default, your latest WordPress posts are displayed on the home page, with older posts available via post navigation on /page/2/, /page/3/, and so on. In this DigWP post, we’ll explain how to display your blog posts on any static page using a custom WP_Query loop that works beautifully with post navigation. For example, if … Continue reading
How to Display the Latest Sticky Posts in WordPress
WordPress has this very cool feature called stick posts. When you make a post sticky, it shows up above your new posts, but only if your theme is set to be that way. In this tutorial we will show you a trick that will let you display latest sticky posts anywhere in your WordPress theme. … Continue reading
How to Display Random Posts in WordPress
Due to the natural structure of blogs, articles end up being buried down once they get old. Most new users join and pick up from the moment they join, and they never bother going back to one of your good posts. One of the easiest way to give a new life to your older posts … Continue reading
How to Display Related Posts in WordPress
If you know anything about bounce rate, you are probably already showing related posts in WordPress. Bounce rate essentially represents the percentage of initial visitors to a site who “bounce” away to a different site, rather than continue on to other pages within the same site. This can have a significant impact on your adsense … Continue reading
Display Popular Posts by Day, Week, Month, and All Time in WordPress
A user in our facebook community asked if we could show how to make a page that display popular posts by day, week, month, and all time in WordPress. We have decided to take it a notch higher and decided to add the tabber aspect in it as well. So in this article, we will … Continue reading
How to Display Related Posts by Same Author in WordPress
In the past, we have shown you how to display related WordPress posts by categories or tags without a plugin. We have also shown you how to display related posts with a WordPress plugin YARPP which has its own formula of determining which posts is related or not. Some of our users asked us if … Continue reading
How to Sort Posts by Post Expiration Date in WordPress
In the past, we have shared how to expire posts in WordPress using the Post Expirator Plugin. Well, when creating an event listing site, we found this plugin to be super helpful. We can easily delete the event listings that are expired. Secondly, thanks to this plugin, it is really easy to sort posts by … Continue reading
How to Display Popular Posts by Views in WordPress without a Plugin
In the past we have shown you how to create a popular post tabber in WordPress using a plugin. That plugin works great out the box for tabbers. However, we wanted more customization in our layout, so we decided to do it without a plugin. In this article, we will show you how to track … Continue reading
Display Different Sidebar for Each Post and Page for WordPress
If you have been using WordPress, you probably have noticed that WordPress displays the same sidebar all across the site for most themes unless the designer himself created a custom homepage in which case the sidebar will be displayed on all pages but the homepage. In this article we will share a tutorial that will … Continue reading
How to Display Post Excerpts in WordPress Themes
Some of our users wanted us to post a tutorial on how to display Post Excerpts in WordPress Themes. This is a very simple tutorial that anyone can implement and take advantage of this built-in feature. The benefit of implementing this tutorial is that it decreases page load time and it increases the pageview count. … Continue reading