-
▼
2011
(334)
-
▼
August
(18)
- How to Save Pending Reviews in WordPress
- How to Migrate From Blogspot to WordPress
- How to Change Your Theme to Default If You Can Acc...
- How to Back Up Restore a WordPress Blog
- How to Install Custom Text in WordPress
- How to Import Bulk Categories Into Wordpress
- How to Use Wufoo Form on Wordpress
- How to Move WordPress Hosting to a Different Domain
- How to Set the Dimension of a WordPress Website
- How to Format Paragraphs in WordPress Posts
- How to Add Amazon Ad Code to a Wordpress Blog
- How to Properly Change Domain Names for WordPress
- How to Display Featured Posts in WordPress
- How to Get Into a WordPress Footer
- How to Install a Theme on WordPress
- How to Remove Ads From Posts in WordPress
- How to Add Standard Text to WordPress Blog Posts
- How to Use an XML File Template on WordPress
-
▼
August
(18)
adsense
How to Display Featured Posts in WordPress
1. Open the 'index.php' file of your current WordPress theme in a code editor. WordPress calls its templates 'themes,' and you can find their files in the following location:/site-name/wp-content/themes/theme-name/Change 'site-name' to whatever you named your main WordPress folder and change 'theme-name' to the name of the theme you want to edit.
2. Copy and paste the contents of 'index.php' into a new file and save it as 'home.php'. When WordPress finds a 'home.php' file in a theme folder, it uses that file to display the first page of your blog if the blog is your home page. This is in contrast to the 'front-page.php' WordPress uses to display contents of a static home page.
3. Find the WordPress loop in the code of 'home.php'. It starts like this:
Sometimes the loop is all on one line, but sometimes you will see it broken up. Add a few blank spaces above the loop and add this code:
The code above sets a query, begins a new loop, ends the loop and then resets the query. You must reset the query to avoid effecting the second loop.
4. Write your query between the parantheses after 'query_posts'. You need to query featured posts, so use the following code:
'Featured')); ?>Save the file and upload it to your server.
5. Log into the WordPress dashboard and add the category name 'Featured' to all featured posts. Update them and then visit your website to see the results. Featured posts will display first on the first page of your blog, and then all posts will display beneath them.
9:55 AM | Filed Under | 0 Comments
Comments
Popular Posts
-
1. Log in to your Weebly account. 2. Click 'Theme Editor.' 3. Click on the 'Design' tab. 4. Select 'Edit CSS/HTM...
-
1. Sign up for a publisher account at Bidvertiser. Submit basic contact information and confirm your email address to get started. 2. Lo...
-
1. Log in to your WordPress dashboard. 2. Open the 'Appearance' section on the left side of the WordPress dashboard and then cli...
-
1. Open your WordPress Dashboard in your preferred browser. It is accessed at the '/wp-admin' location of your site. For example, ...
-
Facebook Widget 1. Create a Facebook fan page for your blog, if you don't already have one. You will have to manually share content wi...
-
1. Download and install the WordPress for BlackBerry app via BlackBerry App World. Download the version that corresponds with your BlackBe...
-
1. Go to your WordPress blog's administrative control panel. 2. Click the 'Settings' button on the left-side navigation menu...
-
1. Click the 'Add Contact' button on the 'Add New Post' page. This opens the 'Add a Contact Form' page. 2. Click...
-
1. Register an account with Amazon Web Services Cloud. If you have an existing Amazon account, enter your email address in the appropriate...
-
1. Log into your WordPress.com account using your user name and password. 2. Hover your cursor over the 'My Blogs' tab at the to...
Post a Comment