Mam pewien problem z kodem odpowiedzialnym za newsy mianowicie chodzi mi o to żeby na końcu newsa było tło.
<?php query_posts($query_string); $i=1; if (have_posts()) : <dl class='articles'> <?php } while (have_posts()) : the_post(); ?> <dt id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <?php if (!is_single()&&!is_page()) { ?> <h2><a href="<?php the_permalink(); ?>" title="<?php printf( $SMTheme->_( 'permalink' ), the_title_attribute( 'echo=0' ) ); ?>" class='post_ttl'><?php the_title(); ?></a></h2> <?php } else { ?> <h1><?php the_title(); ?></h1> <?php } ?> <?php if(comments_open( get_the_ID() )) { ?><img alt="" src="<?php echo get_template_directory_uri(); ?>/images/smt/comments.png"> <span class="meta_comments"><?php comments_popup_link( $SMTheme->_( 'noresponses' ), $SMTheme->_( 'oneresponse' ), $SMTheme->_( 'multiresponse' ) ); ?></span><?php } ?><?php edit_post_link( $SMTheme->_( 'edit' ), ' | <span class="edit-link">', '</span>' ); ?></p> </dt> <dd> <?php if(has_post_thumbnail()) { ?><?php if (!is_single()) { ?><a href="<?php the_permalink(); ?>" title="<?php printf( $SMTheme->_( 'permalink' ), the_title_attribute( 'echo=0' ) ); ?>"><?php the_post_thumbnail( ); ?></a><?php } else { ?> <?php the_post_thumbnail( ); ?> <?php } } if (!is_single()&&!is_page()) { smtheme_excerpt('echo=1'); ?><a href='<?php the_permalink(); ?>' class='readmore'><?php echo $SMTheme->_( 'readmore' ); ?></a><?php } else { the_content(''); } ?> <?php wp_link_pages(); ?> </dd> <?php endwhile; ?> </dl> <?php } ?> <?php endif; ?>
w css mam ustawione tak:
.articles dt { background:url('images/news-bg.jpg') no-repeat center top; padding:0; margin:0 30px; margin-top:-1px; padding-top:1px; } .articles dt:first-child { } .articles dd { }
I tak jak początek newsa ma już tło to teraz nie za bardzo wiem jak zrobić by był jeszcze na jego zakończeniu.
Z php ostatnio miałem bardzo dawno styczność i nawet nie pamiętam takich znaczników jak <dt> itd. bardziej mi przychodzi do głowy <div> ale to do html i chyba ciężko było by to tutaj wpiąć.