I have been looking around online for a plug-in that would generate related posts for my articles. One where I didn’t have to do anything, but install it and tell the loop where to display it. Well, after many hours of searching I finally found it! The people over at WASABI WP Plugins Wiki did a fine job on this plugin.
Well here are the simple steps:
(more…)
Okay, so you want to use the category command to post a link to your category? Well its actually pretty easy to get this done. The first step would be to open up your file that you want your category list to display on. So, if you would like your categories to be on the right side than, open up your rightside.php.
Now, once you are in there, figure out where you wanted your category list to display. If you just created the page without a unorder list (ul) than you need to do so. Wordpress uses a ul for there category listing, so you need to define that in your css so it looks the way you want it to. Once you have that, you leave your opening and closing ul tags, and delete all of your li tags out of the list. Your ul should now look like this:
<ul>
<?php wp_list_categories(); ?>
</ul>
You can go to Wordpress Codex: WP List Cats page and look at the parameters list for this function. Any parameters that you use, goes in between the parentheses in this function, and then inside of single quotes. Put as many parameters in there as you want and watch how Wordpress changes what displays.
Now, once you have that in there, and you upload it to your server, you can go ahead and tell your Wordpress blog to use your new theme! That’s it you did it! You have just finished your mind-blowing Wordpress design.
So you think that you are ready for Step 3? Great! Now that you have the basic files set up lets go ahead and get things going.
Wordpress uses what is called a loop to display their content. Basically what it does is it tells the server to go into your MySQL database and display however many posts that you have. You can go into your dashboard and tell it to only disply two posts on your homepage or how ever many posts you want displayed on your homepage. It will display however many posts you tell it, unless you do not have that many yet. Go ahead and open up your file that you want all your articles to display in. If you want the articles on the right side and a sidebar on the left side, then open up the right side, otherwise open up the leftside file.
Now copy the code from your single page layout, that is just for displaying the articles, and paste it into your file that you want the article display to be in. Lets look at how to start the loop first.
<?php if ( have_posts() ) : while ( have_posts() ) :
the_post(); ?>
Okay, so this code needs to go wherever you want your loop to start. So, if you say have a div tag in your code that contains the code for every article. So, if you need to have the article in that div everytime, put the loop start there. The loop will than create the code that is inside the loop everytime that a article is displayed. Now let’s set it up to end the code.
<?php endwhile; else: ?>
<?php _e('
Sorry, no posts matched your criteria.'); ?>
<?php endif; ?>
Okay, these lines need to go wherever you want the loop to stop. So, with the example, this would after the ending div tag for your main article div. What this code is doing is telling that server that, if there is no article matching what the user is trying to get to, to display “Sorry, no posts matched your criteria.” on the page and not display anything else inside the loop. and than it tells it to end the loop if it does not meet that. That’s it. You have your basic loop set up.
Now you may be wondering why when you upload this file, your lovely Hello World post does not show up on the screen. Well, simple. All you are doing is telling the loop to display what is inside of the loop how ever many times you have set inside of your dashboard. You are not calling anything from the database to be displayed. Now, Wordpress has an awesome codex page. Visit it, read it, sleep with it, memorize that thing as much as you can! Now, go do it! Wordpress Codex Page
Look up codes on that page, and implement them until you get what you want. If you need some assistance or jsut have some basic questions, stop by and send me a email on our contact page. Stay tune and check back soon for Step 4 - Categorizing yor posts.