Tagged: x
-
AuthorPosts
-
February 2, 2017 at 4:20 am #1355008
KobberParticipantHi,
If you look at this page. I would like to do some changes on this blog index page.
1) Can I have the featured image next to headline (to the left – and about 120×80 px)?
2) Meta: is it possible to only have the date (and not author and category)?
3) There’s a huge gap between each post. Can that be decreased?
4) Can I avoid post content (I only want headlines)?
5) Sidebars is great, but they look so boring as standard. Do you know of any (easy) way to style them (any great plugins)?
Thanks in advance!
February 2, 2017 at 4:22 am #1355009
KobberParticipantOh and… can the date be above the headline?
February 2, 2017 at 7:04 am #1355142
Paul RModeratorHi,
1. Create content.php in wp-content/themes/x-child/framework/views/renew and copy the code below into that file
<?php // ============================================================================= // VIEWS/RENEW/CONTENT.PHP // ----------------------------------------------------------------------------- // Standard post output for Renew. // ============================================================================= ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <div class="entry-wrap"> <?php if(is_home()):?> <?php if ( has_post_thumbnail() ) : ?> <div class="entry-featured" style="float:left;"> <?php x_featured_image(); ?> </div> <?php endif; ?> <div style="float:right;" class="blog-content"> <?php x_get_view( 'renew', '_content', 'post-header' ); ?> <?php x_get_view( 'global', '_content' ); ?> </div> <?php else: ?> <?php x_get_view( 'renew', '_content', 'post-header' ); ?> <?php if ( has_post_thumbnail() ) : ?> <div class="entry-featured"> <?php x_featured_image(); ?> </div> <?php endif; ?> <?php x_get_view( 'global', '_content' ); ?> <?php endif; ?> </div> </article>2. Add this in your child theme’s functions.php file.
function x_renew_entry_meta() { // // Author. // $author = sprintf( '<span>%s</span>', get_the_author() ); // // Date. // $date = sprintf( '<span><time class="entry-date" datetime="%1$s">%2$s</time></span>', esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ) ); // // Categories. // if ( get_post_type() == 'x-portfolio' ) { if ( has_term( '', 'portfolio-category', NULL ) ) { $categories = get_the_terms( get_the_ID(), 'portfolio-category' ); $separator = ', '; $categories_output = ''; foreach ( $categories as $category ) { $categories_output .= '<a href="' . get_term_link( $category->slug, 'portfolio-category' ) . '" title="' . esc_attr( sprintf( __( "View all posts in: “%s”", '__x__' ), $category->name ) ) . '"> ' . $category->name . '</a>' . $separator; } $categories_list = sprintf( '<span>%s</span>', trim( $categories_output, $separator ) ); } else { $categories_list = ''; } } else { $categories = get_the_category(); $separator = ', '; $categories_output = ''; foreach ( $categories as $category ) { $categories_output .= '<a href="' . get_category_link( $category->term_id ) . '" title="' . esc_attr( sprintf( __( "View all posts in: “%s”", '__x__' ), $category->name ) ) . '">' . $category->name . '</a>' . $separator; } $categories_list = sprintf( '<span>%s</span>', trim( $categories_output, $separator ) ); } // // Comments link. // if ( comments_open() ) { $title = apply_filters( 'x_entry_meta_comments_title', get_the_title() ); $link = apply_filters( 'x_entry_meta_comments_link', get_comments_link() ); $number = apply_filters( 'x_entry_meta_comments_number', get_comments_number() ); $text = ( 0 === $number ) ? 'Leave a Comment' : sprintf( _n( '%s Comment', '%s Comments', $number, '__x__' ), $number ); $comments = sprintf( '<span><a href="%1$s" title="%2$s" class="meta-comments">%3$s</a></span>', esc_url( $link ), esc_attr( sprintf( __( 'Leave a comment on: “%s”', '__x__' ), $title ) ), $text ); } else { $comments = ''; } // // Output. // if ( x_does_not_need_entry_meta() ) { return; } else { printf( '<p class="p-meta">%s</p>', $date ); } }3. You can add this in Custom CSS
.hentry { margin-top: 90px; }Change 90px to adjust spacing.
4. Add this in Custom CSS
.blog .entry-content.excerpt { display:none; }5. Not sure on how you would like it to look like. Can you provide us a mock-up or a sample site.
Thanks
February 2, 2017 at 10:28 am #1355396
KobberParticipantHi,
About # 5) Look at this site (sidebars): https://www.danskhalbyggeri.dk/nyheder/
February 2, 2017 at 12:34 pm #1355532
JadeModeratorHi there,
If you want a sidebar widgets to look like the sample site, you will need a background image that will serve as the container for the widgets then we can add it through custom CSS.
February 3, 2017 at 12:40 am #1356357
KobberParticipantOk I added the files and custom css as above, but that didn’t go very well. Will you please take a look?
February 3, 2017 at 2:59 am #1356460
LelyModeratorHi Kobber,
Try to add the following too:
.uwl_widget_wrap.style4 { padding-top: 0 !important; }See this:http://screencast-o-matic.com/watch/cbnej8QWyT
Hope this helps.
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1355008 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
