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

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #7897

    Shawn Gray
    Participant

    With 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.

    #7904

    Artem Temos
    Keymaster

    Hello,

    Thank you for your question.

    You need to override content.php file in your child theme and find basel_post_meta function call in this file (a few times). And change its argument

    'date' => 0,

    to be

    'date' => 1,

    Kind Regards
    XTemos Studio

    #7908

    Shawn Gray
    Participant

    That worked. I just need the category to display there too.

    #7909

    Artem Temos
    Keymaster

    In 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

    #7910

    Shawn Gray
    Participant
    <?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 -->
    #7913

    Artem Temos
    Keymaster

    After this code

    <?php basel_post_meta(array(
    					'date' => 1,
    					'labels' => 1,
    					'short_labels' => ( in_array( $blog_design, array( 'masonry', 'mask' ) ) ) 
    				)); ?>

    Regards

    #7991

    Shawn Gray
    Participant

    This 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.

    #8008

    Artem Temos
    Keymaster

    Hello,

    We just made a few changes in your child theme. Now it should look ok. Please check.

    Regards

    #8023

    Shawn Gray
    Participant

    Absolutely perfect.

    #8036

    Artem Temos
    Keymaster

    You are welcome 🙂

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