17th April 2010

Sticky Posts format

Filed under: Reviews - Tags: , , , , , - jola @ 10:36

About this feature article on the home page, articles in Sticky posts on the front page or the article are known as fixed-Home. So that they are also highlighted, you must define a class in the CSS file.

Select the respective article this article on the home in publishing:

sticky1

Enable this function

If an item is marked as sticky, so that the class receives .sticky assigned. This class can be the CSS file style.css freely define. Example of light-gray background and dividing line below:

.sticky {
background: #E1E1E1;
border-bottom: 1px dotted #CCCCCC;
}

In the Theme you need the index.php file in the code in the loop to adjust. Change the line

<div id="post-<?php the_ID(); ?>" class="post">

<div id="post-<?php the_ID(); ?>" class="post">

<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>

The loop begins like this:

<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>

Save the style.css and the index.css and download both files to the server.

The code as text file Download: Code_sticky_post

No Comments »

No comments.

RSS feed for comments on this article. TrackBack URL

Leave a comment

Up

J. Belik © 2010 All rights reserved. My WordPress book runs on WordPress . Theme by Jola