Tagged: x
-
AuthorPosts
-
June 6, 2016 at 4:29 am #1027678
Catherine RParticipanthi, I love the way the Index Featured Post Layout looks, but my client is really set on including a short excerpt. Is this possible?
Ethos stackthanks!
June 6, 2016 at 7:31 am #1027892
Paul RModeratorHi,
Thanks for writing in!
Yes, it’s possible.
To achieve that, create file content-image.php in wp-content/themes/x-child/framework/views/ethos
and copy the code below into that file<?php // ============================================================================= // VIEWS/ETHOS/CONTENT-IMAGE.PHP // ----------------------------------------------------------------------------- // Image post output for Ethos. // ============================================================================= $is_index_featured_layout = get_post_meta( get_the_ID(), '_x_ethos_index_featured_post_layout', true ) == 'on' && ! is_single(); ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <?php if ( $is_index_featured_layout ) : ?> <?php x_ethos_featured_index(); ?> <div class="excerpt"><?php the_excerpt(); ?></div> <?php else : ?> <?php if ( has_post_thumbnail() ) : ?> <div class="entry-featured"> <?php if ( ! is_single() ) : ?> <?php x_ethos_featured_index(); ?> <?php else : ?> <?php x_featured_image(); ?> <?php endif; ?> </div> <?php endif; ?> <div class="entry-wrap"> <?php x_get_view( 'ethos', '_content', 'post-header' ); ?> <?php x_get_view( 'global', '_content' ); ?> </div> <?php endif; ?> </article>Hope that helps
June 7, 2016 at 8:06 am #1029843
Catherine RParticipanthi themeco, thank you for your advice. child theme/.php all set up, but I see no difference.
the page is made up of one category out of the posts;
index featured post layout is checked
skinny is checked
excerpt is filled in.in the customiser under Blog, full post comment on index is off, with an excerpt length of 30.
advice? thank you!
June 7, 2016 at 10:49 am #1030141
RupokMemberWould you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:
– Link to your site
– WordPress Admin username / password
– FTP credentialsDon’t forget to select Set as private reply. This ensures your information is only visible to our staff.
June 7, 2016 at 3:42 pm #1030642
Catherine RParticipantDear Themeco,
I’m going to send this on in about 2 weeks time. the site is now on a localhost and I’ll be moving & testing it around the 20th.
Please keep the thread open, I’ll definitely send on the information! thank you.June 8, 2016 at 2:11 am #1031372
Paul RModeratorYou’re welcome! 🙂
June 20, 2016 at 6:21 am #1050397
Catherine RParticipantThis reply has been marked as private.June 20, 2016 at 7:09 am #1050469
ChristopherModeratorHi there,
Please copy _index-featured.php from framework/views/ethos and put it in the same path inside child theme, replace existing code with following :
<?php // ============================================================================= // VIEWS/ETHOS/_INDEX-FEATURED.PHP // ----------------------------------------------------------------------------- // Featured content output for the index pages. // ============================================================================= $index_layout = get_post_meta( get_the_ID(), '_x_ethos_index_featured_post_layout', true ); $class = ( $index_layout == 'on' ) ? 'featured' : ''; $background_image_style = x_ethos_entry_cover_background_image_style(); $categories = x_ethos_post_categories(); ?> <a href="<?php the_permalink(); ?>" class="entry-thumb <?php echo $class; ?>" style="<?php echo $background_image_style; ?>"> <?php if ( $index_layout == 'on' && ! is_single() ) : ?> <span class="featured-meta"><?php echo $categories; ?> / <?php echo get_the_date( 'F j, Y' ); ?></span> <h2 class="h-featured"><span><?php the_title(); ?></span></h2> <div class="excerpt"><?php the_excerpt(); ?></div> <span class="featured-view"><?php _e( 'View Post', '__x__' ); ?></span> <?php else : ?> <span class="view"><?php _e( 'View Post', '__x__' ); ?></span> <?php endif; ?> </a>Hope it helps.
June 21, 2016 at 8:06 am #1052462
Catherine RParticipanthi, I tried this, but it is still not pulling up. I also deleted (but saved on my computer) the _index-featured.php file in the X portion. The above file is in child > framework > views > ethos.
thank you for your help.
June 21, 2016 at 4:18 pm #1053251
FriechModeratorHi There,
Please add this on your child theme’s functions.php file instead.
// Featured Index Content // ============================================================================= if ( ! function_exists( 'x_ethos_featured_index' ) ) : function x_ethos_featured_index() { $entry_id = get_the_ID(); $index_featured_layout = get_post_meta( $entry_id, '_x_ethos_index_featured_post_layout', true ); $index_featured_size = get_post_meta( $entry_id, '_x_ethos_index_featured_post_size', true ); $index_featured_layout_class = ( $index_featured_layout == 'on' ) ? ' featured' : ''; $index_featured_size_class = ( $index_featured_layout == 'on' ) ? ' ' . strtolower( $index_featured_size ) : ''; $is_index_featured_layout = $index_featured_layout == 'on' && ! is_single(); ?> <a href="<?php the_permalink(); ?>" class="entry-thumb<?php echo $index_featured_layout_class; echo $index_featured_size_class; ?>" style="<?php echo x_ethos_entry_cover_background_image_style(); ?>"> <?php if ( $is_index_featured_layout ) : ?> <span class="featured-meta"><?php echo x_ethos_post_categories(); ?> / <?php echo get_the_date( 'F j, Y' ); ?></span> <h2 class="h-featured"><span><?php x_the_alternate_title(); ?></span></h2> <div class="excerpt"><?php the_excerpt(); ?></div> <span class="featured-view"><?php _e( 'View Post', '__x__' ); ?></span> <?php else : ?> <span class="view"><?php _e( 'View Post', '__x__' ); ?></span> <?php endif; ?> </a> <?php } endif;Hope it helps, Cheers!
June 22, 2016 at 12:13 pm #1054662
Catherine RParticipantthank you, this did work.
I initially replaced the functions.php instead of adding. Once I added all went fine.One very detailed question: is it possible to define the excerpt (ONLY for this, one category, and not for the entire news section)?
I can add it in the excerpt with this <span style=”color: #fff; font-size: 17px;”> but that is not a user-friendly for my client. thank you.
June 22, 2016 at 6:26 pm #1055257
RadModeratorHi there,
You mean that excerpt shouldn’t display at all, except on a specific category? If yes, then you may change this line,
<div class="excerpt"><?php the_excerpt(); ?></div>to this
<div class="excerpt"><?php if ( is_category( array( 12, 13, 212) ) ) the_excerpt(); ?></div>Where 12, 13, 212 are the category IDs.
As for styling, you can add something like this on your customizer’s custom CSS.
a .excerpt { color: #fff; font-size: 17px; }Hope this helps.
June 23, 2016 at 6:35 am #1056158
Catherine RParticipantyou guys are the best. thank you!
June 23, 2016 at 8:49 am #1056327
Paul RModeratorYou’re welcome! 🙂
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1027678 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
