Support » Theme: Fragrance » First post different in homepage Fragrance

  • Resolved Sirventes



    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.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Theme Author wpart


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

    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(); ?>
    <?php endforeach; ?>

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

    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.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘First post different in homepage Fragrance’ is closed to new replies.