Home › Forums › Basel support forum › Blog feature/ Add date and category by Author instead of on feature image
Blog feature/ Add date and category by Author instead of on feature image
- This topic has 9 replies, 2 voices, and was last updated 8 years ago by Artem Temos.
-
AuthorPosts
-
December 13, 2016 at 6:01 pm #7897
Shawn GrayParticipantWith custom coding I turned off the date and the category block that overlaid on the feature image due to the fact that it covered up some of my lettering on my feature images. When I click into my blog on the single loop I would like the category and the date to be displayed beside the author name instead of on the feature image. I’m sure that is possible. I just can figure out how to relocate it to this position. P.S. I am going now to rate and review this theme. Best ever. Along with your customer support. I am dumb founded by the support I have received by you guys.
December 13, 2016 at 7:11 pm #7904
Artem TemosKeymasterHello,
Thank you for your question.
You need to override
content.php
file in your child theme and findbasel_post_meta
function call in this file (a few times). And change its argument'date' => 0,
to be
'date' => 1,
Kind Regards
XTemos StudioDecember 13, 2016 at 8:06 pm #7908
Shawn GrayParticipantThat worked. I just need the category to display there too.
December 13, 2016 at 8:30 pm #7909
Artem TemosKeymasterIn this case try to put the categories code after function that displays meta data
<?php if ( get_the_category_list( ', ' ) ): ?> <div class="meta-post-categories"><?php echo get_the_category_list( ', ' ); ?></div> <?php endif ?>
Regards
December 13, 2016 at 9:08 pm #7910
Shawn GrayParticipant<?php /** * The default template for displaying content * * Used for both single and index/archive/search. */ global $basel_loop; // Partrs config array $parts = array( 'media' => true, 'title' => true, 'meta' => true, 'text' => true, 'btn' => true, ); if ( ! empty( $basel_loop['parts'] ) ) $parts = wp_parse_args( $basel_loop['parts'], $parts ); // Store loop count we're currently on if ( empty( $basel_loop['loop'] ) ) $basel_loop['loop'] = 0; // Increase loop count $basel_loop['loop']++; if ( empty( $basel_loop['blog_design'] ) ) $basel_loop['blog_design'] = basel_get_opt( 'blog_design' ); $blog_design = $basel_loop['blog_design']; $classes = array('blog-design-' . $blog_design ); $classes[] = 'blog-post-loop'; if ( empty( $basel_loop['columns'] ) ) $basel_loop['columns'] = basel_get_opt( 'blog_columns' ); $columns = $basel_loop['columns']; if( in_array( $blog_design, array( 'masonry', 'mask' ) ) && ! is_single() ) $classes[] = basel_get_grid_el_class($basel_loop['loop'], $columns, false, 12 ); if( is_single() ) $classes[] = 'post-single-page'; if( get_the_title() == '' ) $classes[] = 'post-no-title'; $gallery_slider = apply_filters( 'basel_gallery_slider', true ); $gallery = array(); if( get_post_format() == 'gallery' && $gallery_slider ) { $gallery = get_post_gallery(false, false); //ar(get_post_format() == 'gallery' && $gallery_slider && ! empty( $gallery['src'] )); } // Get video $video_html = ''; $video = get_post_meta(get_the_ID(), '_xz_post_video', true); $format_video = get_post_format() == 'video'; if( $format_video && ! empty( $video ) ) { $video_html = do_shortcode('[vc_video link="' . $video . '"]'); } $random = 'carousel-' . rand(100,999); ?> <article id="post-<?php the_ID(); ?>" <?php post_class( $classes ); ?>> <?php if ($format_video && is_single()): ?> <div style="padding:0 0 0 15px;"> <?php echo $video_html; ?> </div> <?php endif ?> <?php if ( $blog_design == 'default-alt' ): ?> <?php if ( get_the_category_list( ', ' ) ): ?> <div class="meta-post-categories"><?php echo get_the_category_list( ', ' ); ?></div> <?php endif ?> <?php if ( is_single() && $parts['title'] ) : ?> <h3 class="entry-title"><?php the_title(); ?></h3> <?php elseif( $parts['title'] ) : ?> <h3 class="entry-title"> <a>" rel="bookmark"><?php the_title(); ?></a> </h3> <?php endif; // is_single() ?> <?php if ( $parts['meta'] ): ?> <div class="entry-meta"> <?php basel_post_meta(array( 'date' => 1, 'labels' => 1, 'short_labels' => ( in_array( $blog_design, array( 'masonry', 'mask' ) ) ) )); ?> </div><!-- .entry-meta --> <?php endif ?> <?php endif ?> <header class="entry-header"> <?php if ( ! ( is_single() && $format_video ) && ( has_post_thumbnail() || ! empty( $gallery['src'] ) ) && ! post_password_required() && ! is_attachment() && $parts['media'] ) : ?> <figure id="<?php echo esc_attr( $random ); ?>" class="entry-thumbnail"> <?php if($blog_design == 'default-alt' ) basel_post_date(); ?> <?php if( get_post_format() == 'gallery' && $gallery_slider && ! empty( $gallery['src'] ) ): ?> <ul class="post-gallery-slider owl-carousel"> <?php foreach ($gallery['src'] as $src) { ?> <li> <img />"> </li> <?php } ?> </ul> <?php basel_owl_carousel_init( array( 'carousel_id' => $random, 'slides_per_view' => 1, 'hide_pagination_control' => 'yes' ) ); ?> <?php elseif ( ! is_single() ): ?> <div class="post-img-wrapp"> <a>"> <?php echo basel_get_post_thumbnail( 'large' ); ?> </a> </div> <div class="post-image-mask"> <a>"><?php _e("Read More", 'basel'); ?></a> </div> <?php else: ?> <?php the_post_thumbnail( 'full' ); ?> <?php endif ?> </figure> <?php endif; ?> <?php if ( $blog_design != 'default-alt' ): ?> <?php basel_post_date(); ?> <div class="post-mask"> <?php if ( get_the_category_list( ', ' ) ): ?> <div class="meta-post-categories"><?php echo get_the_category_list( ', ' ); ?></div> <?php endif ?> <?php if ( is_single() && $parts['title'] ) : ?> <h3 class="entry-title"><?php the_title(); ?></h3> <?php elseif( $parts['title'] ) : ?> <h3 class="entry-title"> <a>" rel="bookmark"><?php the_title(); ?></a> </h3> <?php endif; // is_single() ?> <?php if ( $parts['meta'] ): ?> <div class="entry-meta"> <?php basel_post_meta(array( 'date' => 1, 'labels' => 1, 'short_labels' => ( in_array( $blog_design, array( 'masonry', 'mask' ) ) ) )); ?> </div><!-- .entry-meta --> <?php endif ?> </div> <?php endif ?> </header><!-- .entry-header --> <?php if ( is_search() && $parts['text'] && get_post_format() != 'gallery' ) : // Only display Excerpts for Search ?> <div class="entry-summary"> <?php the_excerpt(); ?> </div><!-- .entry-summary --> <?php elseif( $parts['text'] ) : ?> <div class="entry-content"> <?php basel_get_content( $parts['btn'], is_single() ); ?> <?php wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . esc_html__( 'Pages:', 'basel' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) ); ?> </div><!-- .entry-content --> <?php endif; ?> <div class="liner-continer"> <span class="left-line"></span> <?php if( function_exists( 'basel_shortcode_social' ) ) echo basel_shortcode_social( array( 'style' => 'circle', 'size' => 'small' ) ); ?> <span class="right-line"></span> </div> <?php if ( is_single() && get_the_author_meta( 'description' ) ) : ?> <footer class="entry-meta"> <?php get_template_part( 'author-bio' ); ?> </footer><!-- .entry-meta --> <?php endif; ?> </article><!-- #post -->
December 13, 2016 at 9:37 pm #7913
Artem TemosKeymasterAfter this code
<?php basel_post_meta(array( 'date' => 1, 'labels' => 1, 'short_labels' => ( in_array( $blog_design, array( 'masonry', 'mask' ) ) ) )); ?>
Regards
December 15, 2016 at 11:57 pm #7991
Shawn GrayParticipantThis may not be possible. What I am trying to do is this.
1. I want the categories to the right of the date separated by a dash
2. I want them to be without gray square block around it
3. I want them to be the same size and color as the date
4. I want them to only sho on single blog page. Not on masonry view.December 16, 2016 at 9:03 am #8008
Artem TemosKeymasterHello,
We just made a few changes in your child theme. Now it should look ok. Please check.
Regards
December 16, 2016 at 5:06 pm #8023
Shawn GrayParticipantAbsolutely perfect.
December 16, 2016 at 9:40 pm #8036
Artem TemosKeymasterYou are welcome 🙂
-
AuthorPosts
- You must be logged in to create new topics. Login / Register