Setting Up The Index Page In Arthemia To Properly Display Posts

There are many free premium WordPress themes available today and Arthemia is one of those. I myself have used the Arthemia theme a few times for multiple sites as it’s magazine style layout is great for providing plenty of information with a clean and easy to navigate design. The index page provides various different sections for displaying post information such as Headline and Featured sections for displaying special posts and putting them right in front of the visitor’s eyes.

However, getting them to work properly so that the posts listed under the Headline and Featured categories only display under those sections and not the list of previous posts can be somewhat tricky. In order to correct this issue, we will be editing the index.php file of the Arthemia theme. Before we start editing the file, you need to make sure that you already created the Headline and Featured categories as well as assigning posts to them. Once you have done that, we can then begin to edit the index.php file to get the posts displayed correctly.

Editing the index.php file

Make your way into your WordPress Admin Dashboard and open up the Theme Editor which can be found under the Appearance section if you are using version 2.7 or above of WordPress. From there, click on the Main Index Template (index.php) located along the right hand side of the screen.

WordPress Theme Editor File Menu

WordPress Theme Editor File Menu

Once you have selected the index.php file, the code for the file should load up inside of the textarea to the left. Scroll down the code until you come across the following line of code

<?php
$page = (get_query_var('paged')) ? get_query_var('paged') : 1;
query_posts("cat=-27,-28&paged=$page&posts_per_page=5"); ?>

The above code determines which posts are going to be displayed on the home page that are not a part of either the Headline or Featured categories. In order to get the code to work correctly you need the ID’s of the Headline and Featured categories. In order to find the category ID, navigate to the list of categories inside of the WordPress Admin Dashboard. Hover the mouse over the appropriate category name and look at the status bar of your web browser. You should notice cat_ID= at the end of the URL along with a number which is the ID of that particular category.

After finding the ID’s of the Headline and Featured categories all that is left to do is to replace the default category ID’s with the new category ID’s. Let’s say that the category ID’s ended up being 10 and 17 as an example. All that you would need to do is to edit the above code as shown below

<?php
$page = (get_query_var('paged')) ? get_query_var('paged') : 1;
query_posts("cat=-10,-17&paged=$page&posts_per_page=5"); ?>

Notice that only the 2 numbers listed after cat= were changed in the above code. These 2 numbers refer to the Headline and Featured categories and placing a – in front of each number prevents posts from those categories being shown in the result of the query.

Click the blue Update File button located underneath the text area showing the code and you should be all set.

That was easy, right?

As a quick overview for this post, all that we did was find the category ID’s for the Headline and Featured categories and then replaced those category ID’s with the default category ID’s listed in the index.php file. Remember to place a – before each of the category ID’s in order to prevent posts from that category being displayed.

If you have any questions about the Arthemia theme or any other WordPress theme, feel free to send me an email over at the contact form.

Feedback!

If you read this post and understood it great! Let me know in the comments below. If you are still having issues and can't get it figured out, you are more than welcome to leave a comment or send me an email using the contact form and I'll do what I can to help!

Leave a Reply