WordPress.org

Ready to get started?Download WordPress

Forums

Fragrance
[resolved] First post different in homepage Fragrance (3 posts)

  1. Sirventes
    Member
    Posted 1 year ago #

    Hi.

    I am playing with the template Fragrance and I would like to show the last post in full in the homepage, while leaving the rest in the grid style.

    My coding skils are not good at all. I have understood that the grid is created from line 205 in style.css.

    I wondered if I change those "newpost" and start on newpost2, then I can style newpost1 in its own style.

    Is this the right approach? Should I instead try to code in index.php with some sort of conditional to separate the last post from the rest?

    All help is really apreciated here as I am going to put some hours in it and I really need some guidance.

    Just last bit of info, I am working on a child theme, so I can undo everything I mess up.

    Thanks in advance.

    http://wordpress.org/extend/themes/fragrance/

  2. wpart
    Member
    Theme Author

    Posted 1 year ago #

    Maybe you can add the latest post out of the loop like this:

    <?php
    global $post;
    $args = array( 'numberposts' => 1, 'offset'=> 1, 'category' => 1 );
    $myposts = get_posts( $args );
    foreach( $myposts as $post ) :	setup_postdata($post); ?>
    	<div class="the_latest_post"><h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
        <div class="entry">
                <?php the_content(); ?>
                </div></div>
    <?php endforeach; ?>

    You can put it before <?php $i=1;if (have_posts().
    Thanks for your supportHave fun.

  3. Sirventes
    Member
    Posted 1 year ago #

    Thanks wpart.

    I used it and worked well. I am sorry I did not reply earlier to this. I actually did, but the reply seems to have vanished. Thanks for your help.

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic

Tags