Theme Support Forum

Support Forum for Free and Premium Themes. Premium Theme Forums are Private! Please log in first to see the Premium forums

Viewing 23 posts - 1 through 23 (of 23 total)

Different layout for latest post in home page (featured images)

Home Forums Free Theme Support Zenon Lite Different layout for latest post in home page (featured images)

  • #91341

    Rafael Dalago Algauer


    I know it’s possible to have the latest post displayed in the front page, but I would like to get only the 3 latest post’s featured images in the front page. What code must I change?

    Thank you very much!


    Towfiq I.

    so no matter how many posts you display you want to display the first 3 posts’s featured images?


    Rafael Dalago Algauer

    Yes, I only want to show the last 3 posts, but only their featured image.


    Rafael Dalago Algauer

    I mean the last 3 I added to the blog.


    Towfiq I.

    Try replacing your layout1.php with this:


    Rafael Dalago Algauer

    It didn’t work! =/ Changed all the layout.

    Here’s what I’m trying to get:

    I want to change nothing but the front page with these 3 featured images, which are the latest posts.

    Thank you!


    Towfiq I.

    Sorry I though you were using Asteria.

    to only display the thumbnails on frontpage of zenon. add this to the very bottom of your stylesheet:

    .lay1 .post_content{display:none;}
    .lay1 .hentry{width: 314px!important;padding: 0px!important; }
    .lay1 .imgwrap img, .lay1 .imgwrap{width: 314px!important;}

    Rafael Dalago Algauer


    Yes, that’s exactly what I want, but only in the front page. Let me try to explain it better.

    When I select a category (let’s say “Weddings) 9 posts are displayed per page. That’s perfetc. Now I want only 3 being displayed only in the front page. If I enable the option that allows me to display the latest posts in the front page, I’m also going to have 9 posts, but I only want the 3. I could change this in the “Reading” options, but it would change the way all the thumbnails are displayed when I select a category.

    This last code you gave me worked perfectly, but I should change only the thumbnails in the front page.

    Is it possible?


    Towfiq I.

    replace those css lines with this:

    .home .lay1 .post_content{display:none;}
    .home .lay1 .hentry{width: 314px!important;padding: 0px!important; }
    .home .lay1 .imgwrap img, .lay1 .imgwrap{width: 314px!important;}

    And then open u layout1.php and add this:

    <?php if(is_front_page()) { 
    	 $args = array(
    				   'post_type' => 'post',
    				   'paged' => ( get_query_var('paged') ? get_query_var('paged') : 1),
    				   'posts_per_page' => '3');
    } ?>

    before this:

    <?php if(have_posts()): ?><?php while(have_posts()): ?><?php the_post(); ?>


    Rafael Dalago Algauer

    Thank you so much!!! Worked exactly as expected. =)

    Let me just ask one last questions: is it possible to add a code so that when the mouse is over the thumbnail, it gets 50% transparent and the title appears over the image?

    Thanks again!


    Towfiq I.

    whats your site address?


    Rafael Dalago Algauer

    But that option to have 3 featured images on front page is still disabled, because I’m waiting for the last cade I asked you.


    Towfiq I.

    can you add them so that i can take a look.


    Rafael Dalago Algauer

    Take a look:

    Is it also possible to disable pagination for the latest post on front page?


    Towfiq I.

    Add this to your Stylesheet:

    .home .lay1 .hentry{position:relative;}
    .home .lay1 .post_content{position: absolute;z-index: 99;color: #fff;height: auto;bottom: 15px;left: 5px;}
    .home .lay1 .post_content p{ display:none;}
    .home .lay1 .post_content h2 a{color: #fff;}
    .home .lay1 .hentry:hover .post_content{display:block;}


    Rafael Dalago Algauer

    Thanks! =)

    And is it possible to disable pagination for the latest posts?


    Towfiq I.

    add this to your the very bottom of your Stylesheet:

    .home .znn_paginate{display:none;}


    Rafael Dalago Algauer

    Thank you. It worked perfectly!

    Do you know how I can translate to portuguese the words that appear in the comment area (Leave a reply, name, e-mail, Post Comment, etc)? I tried everything I knew but nothing worked.


    Towfiq I.

    Open up comments.php and replace this line:

    <?php comment_form(); ?>

    with this and change the English text strings with Portuguese:

    $args = array(
      'id_form'           => 'commentform',
      'id_submit'         => 'submit',
      'title_reply'       => __( 'Leave a Reply' ),
      'title_reply_to'    => __( 'Leave a Reply to %s' ),
      'cancel_reply_link' => __( 'Cancel Reply' ),
      'label_submit'      => __( 'Post Comment' ),
      'comment_field' =>  '<p class="comment-form-comment"><label for="comment">' . _x( 'Comment', 'noun' ) .
        '</label><textarea id="comment" name="comment" cols="45" rows="8" aria-required="true">' .
      'must_log_in' => '<p class="must-log-in">' .
          __( 'You must be <a href="%s">logged in</a> to post a comment.' ),
          wp_login_url( apply_filters( 'the_permalink', get_permalink() ) )
        ) . '</p>',
      'logged_in_as' => '<p class="logged-in-as">' .
        __( 'Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s" title="Log out of this account">Log out?</a>' ),
          admin_url( 'profile.php' ),
          wp_logout_url( apply_filters( 'the_permalink', get_permalink( ) ) )
        ) . '</p>',
      'comment_notes_before' => '<p class="comment-notes">' .
        __( 'Your email address will not be published.' ) . ( $req ? $required_text : '' ) .
      'comment_notes_after' => '<p class="form-allowed-tags">' .
          __( 'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes: %s' ),
          ' <code>' . allowed_tags() . '</code>'
        ) . '</p>',
      'fields' => apply_filters( 'comment_form_default_fields', array(
        'author' =>
          '<p class="comment-form-author">' .
          '<label for="author">' . __( 'Name', 'domainreference' ) . '</label> ' .
          ( $req ? '<span class="required">*</span>' : '' ) .
          '<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) .
          '" size="30"' . $aria_req . ' /></p>',
        'email' =>
          '<p class="comment-form-email"><label for="email">' . __( 'Email', 'domainreference' ) . '</label> ' .
          ( $req ? '<span class="required">*</span>' : '' ) .
          '<input id="email" name="email" type="text" value="' . esc_attr(  $commenter['comment_author_email'] ) .
          '" size="30"' . $aria_req . ' /></p>',
        'url' =>
          '<p class="comment-form-url"><label for="url">' .
          __( 'Website', 'domainreference' ) . '</label>' .
          '<input id="url" name="url" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) .
          '" size="30" /></p>'
    comment_form($args); ?>

    Rafael Dalago Algauer

    Thank you so much for all the support! =)


    Towfiq I.

    Can you rate this theme:



    Rafael Dalago Algauer

    Done =)



    Is it possible to change the size of the pictures displayed on the front page that get pulled from the blog posts? They seem to be cut off. I am using Asteria light.

Reply To: Different layout for latest post in home page (featured images)