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
On February 5, 2014 at 4:38 pmHi,
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!
#91458On February 5, 2014 at 10:39 pmso no matter how many posts you display you want to display the first 3 posts’s featured images?
#91630
Rafael Dalago Algauer
On February 6, 2014 at 4:38 pmYes, I only want to show the last 3 posts, but only their featured image.
#92285On February 7, 2014 at 9:25 pmTry replacing your layout1.php with this:
http://pastebin.com/raw.php?i=h2XMx0k6#98195
Rafael Dalago Algauer
On February 25, 2014 at 7:24 pmIt didn’t work! =/ Changed all the layout.
Here’s what I’m trying to get: http://www.rafaeldalago.com.br/wp-content/uploads/2014/02/Layout.jpg
I want to change nothing but the front page with these 3 featured images, which are the latest posts.
Thank you!
#98398On February 26, 2014 at 9:23 amSorry 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;}
#98497
Rafael Dalago Algauer
On February 26, 2014 at 3:34 pmHi,
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?
#98781On February 27, 2014 at 9:20 amreplace 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'); query_posts($args); } ?>
before this:
<?php if(have_posts()): ?><?php while(have_posts()): ?><?php the_post(); ?>
#98805
Rafael Dalago Algauer
On February 27, 2014 at 10:28 amThank 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!
#99109
Rafael Dalago Algauer
On February 28, 2014 at 9:22 amhttp://www.rafaeldalago.com.br
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.
#99693On March 2, 2014 at 12:40 amcan you add them so that i can take a look.
#101340
Rafael Dalago Algauer
On March 6, 2014 at 6:38 pmTake a look: http://www.rafaeldalago.com.br/
Is it also possible to disable pagination for the latest post on front page?
#101404On March 6, 2014 at 8:54 pmAdd 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;}#101497
Rafael Dalago Algauer
On March 7, 2014 at 1:53 amThanks! =)
And is it possible to disable pagination for the latest posts?
#101798On March 7, 2014 at 6:50 pmadd this to your the very bottom of your Stylesheet:
.home .znn_paginate{display:none;}
#102761
Rafael Dalago Algauer
On March 9, 2014 at 11:27 pmThank 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.
#102862On March 10, 2014 at 6:52 amOpen up comments.php and replace this line:
<?php comment_form(); ?>
with this and change the English text strings with Portuguese:
<?php $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">' . '</textarea></p>', 'must_log_in' => '<p class="must-log-in">' . sprintf( __( '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">' . sprintf( __( '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' ), $user_identity, 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 : '' ) . '</p>', 'comment_notes_after' => '<p class="form-allowed-tags">' . sprintf( __( '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); ?>
#103073
Rafael Dalago Algauer
On March 10, 2014 at 5:24 pmThank you so much for all the support! =)
#103297On March 11, 2014 at 7:04 am#650129
Claudia
On December 8, 2018 at 6:51 pmIs 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.
You must be logged in to reply to this topic.