This topic has 14 replies, 2 voices, and was last updated 10 years by sharmstr.

  • Author
  • #33356
     dorisarnaud
    Participant

    Hello
    How can I remove date, author and number of comment infos on posts page

    Thank you

    Attachments:
    You must be logged in to view attached files.
    #33457
     sharmstr
    Moderator

    There’s a few ways you can do it, but maybe the easiest is to just add a conditional statement in the kleo_entry_meta function that will check to see if its on a post page. If so, then display it.

    I havent tested this, but try it in your functions.php file.

    COPY CODE
    
    
    function kleo_entry_meta($echo=true, $att=array()) {
    		if (is_single()) :
    		$meta_list = array();
    		
    		// Translators: used between list items, there is a space after the comma.
    		$categories_list = get_the_category_list( __( ', ', 'kleo_framework' ) );
    
    		// Translators: used between list items, there is a space after the comma.
    		$tag_list = get_the_tag_list( '', __( ', ', 'kleo_framework' ) );
    
    		$date = sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a>',
    			esc_url( get_permalink() ),
    			esc_attr( get_the_time() ),
    			esc_attr( get_the_date( 'c' ) ),
    			esc_html( get_the_date() )
    		);
    
    		$author = sprintf( '<a href="%1$s" title="%2$s" rel="author">%3$s</a>',
    			esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
    			esc_attr( sprintf( __( 'View all posts by %s', 'kleo_framework' ), get_the_author() ) ),
    			get_the_author()
    		);
    
    		$meta_list[] = '<small class="meta-author">'.$author.'</small>';
    		$meta_list[] = '<small>'.$date.'</small>';
    		
    		$cat_tag = array();
    		
    		if ( $categories_list ) {
    			$cat_tag[] = $categories_list;
    		}
    		
    		if ($tag_list) {
    			$cat_tag[] = $tag_list;
    		}
    		if (!empty($cat_tag)) {
    			$meta_list[] = '<small class="meta-category">'.implode(", ",$cat_tag).'</small>';
    		}
    		
    		//comments
    		if (!isset($att['comments']) || (isset($att['comments']) && $att['comments'] !== false)) {
    		$meta_list[] = '<small class="meta-comment-count"><a href="'. get_permalink().'#comments">'.get_comments_number().' <i class="icon-chat-1 hover-tip" 
    			data-original-title="'.sprintf( _n( 'This article has one comment', 'This article has %1$s comments', get_comments_number(), 'kleo_framework' ),number_format_i18n( get_comments_number() ) ).'" 
    			data-toggle="tooltip" 
    			data-placement="top"></i></a></small>';
    		}
    		
    		if ($echo) {
    			echo implode(", ", $meta_list);
    		}
    		else {
    			return implode(", ", $meta_list);
    		}
    		
    	endif;
    }
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #33467
     dorisarnaud
    Participant

    Thank you

    I have to copy this in Kleo or Kleo child?

    #33472
     sharmstr
    Moderator

    You should have kleo child enabled. Then put it in kleo-child/functions.php

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #33474
     dorisarnaud
    Participant

    I was wrong I copied it in Kleo and now I no longer have access to my site.
    What should I do? I do not have access to anything

    #33481
     dorisarnaud
    Participant

    Your code doesn’t work. I’ve copied in kleo child and meta infos are there again.

    #33482
     sharmstr
    Moderator

    I just tested it and it works. It removes the meta info from blog list, but not from the actual post.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    Attachments:
    You must be logged in to view attached files.
    #33485
     dorisarnaud
    Participant

    Can you check the url http://www.escapadedeluxe.com/type_aventure/croisiere-privee/
    to understand that I would like remove : Infos to remove : Doris A., 28 octobre 2014, 0

    Thank you

    #33488
     sharmstr
    Moderator

    The code I gave you will do that. Did you see my screenshot?

    If you put my code in /kleo-child/functions.php and have Kleo Child enabled, it will work. It will even remove it when you’re using the post grid shortcode. The only place it wont remove it from this the actual post page.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #33490
     dorisarnaud
    Participant

    I was designed my website with kleo theme and not kleo child theme …
    Is it wrong?

    How can I do to transfer all the work I’ve already done to child theme?

    But I also need to remove meta info on the post page.

    What is the best solution?

    Thank you

    #33493
     sharmstr
    Moderator

    You should be using the kleo child theme. To copy all of the changes from Kleo to Kleo Child see this post https://archived.seventhqueen.com/forums/topic/newbie-mess-up-manipulating-parent-theme#post-30484

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #33494
     dorisarnaud
    Participant

    Ok thank you

    You have not answered my question
    I also need to remove meta info on the post page. How can I do ?

    #33510
     sharmstr
    Moderator

    Then just turn if off completely. WP Admin -> Theme Options -> Blog -> Display Post Meta. I wish you would have stated that early on.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #33523
     dorisarnaud
    Participant

    Thank you very much!!!

    #33534
     sharmstr
    Moderator

    Please mark resolved.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

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

The topic ‘Remove meta info’ is closed to new replies.

Log in with your credentials

Forgot your details?