This topic has 9 replies, 3 voices, and was last updated 9 years by Abe.

  • Author

    Tagged: 

  • #18869
     Nudrica
    Participant

    Hi

    Nice theme – I need to remove Date, Author and amount of comments from my posts.

    I have searched but cant really find anything that helps me

    #19211
     Abe
    Keymaster

    Hi, Thank you.
    You have to copy sweetdate_entry_meta function from sweetdate/functions.php into your sweetdate-child/functions.php and comment the lines that generate that

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

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #19270
     Nudrica
    Participant

    Hi Abe

    That blow the site – Dont know what i wrote wrong cause I just copied it in.

    #19271
     Abe
    Keymaster

    You copied something wrong. copy just the function to the child theme functions.php

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

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #19272
     Nudrica
    Participant

    and the function is not 25 lines I guess 🙂 sry for being all newbie here

    #19274
     Abe
    Keymaster

    well this should be the function:

    COPY CODE
    
    function sweetdate_entry_meta() {
    	// 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 class="url fn n" 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()
    	);
    
    	// Translators: 1 is category, 2 is tag, 3 is the date and 4 is the author's name.
    	if ( $categories_list ) {
                    echo '<li><i class="icon-calendar"></i> '.$date.'</li>';
                    echo '<li><i class="icon-user"></i> '.$author.'</li>';
                    echo '<li><i class="icon-heart"></i> '.$categories_list.'</li>';
                    if ($tag_list) echo '<li><i class="icon-tags"></i> '.$tag_list.'</li>';
                    echo '<li><i class="icon-comments"></i> <a href="'.get_permalink().'#comments">'.sprintf( _n( 'One comment', '%1$s comments', get_comments_number(), 'kleo_framework' ),number_format_i18n( get_comments_number() ) ).'</a></li>';
            }
            else {
                    echo '<li><i class="icon-calendar"></i> '.$date.'</li>';
                    echo '<li><i class="icon-user"></i> '.$author.'</li>';
                    if ($tag_list) echo '<li><i class="icon-tags"></i> '.$tag_list.'</li>';
                    echo '<li><i class="icon-comments"></i> <a href="'. get_permalink().'#comments">'.sprintf( _n( 'One comment', '%1$s comments', get_comments_number(), 'kleo_framework' ),number_format_i18n( get_comments_number() ) ).'</a></li>';
    	}
    
    }
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #19276
     Nudrica
    Participant

    Mine looked like this:

    COPY CODE
    
    function sweetdate_entry_meta() {
    	// 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()
    	);
    
    	// Translators: 1 is category, 2 is tag, 3 is the date and 4 is the author's name.
    	if ( $categories_list ) {
                    echo '<li><i class="icon-calendar"></i> '.$date.'</li>';
                    echo '<li><i class="icon-user"></i> '.$author.'</li>';
                    echo '<li><i class="icon-folder-close"></i> '.$categories_list.'</li>';
                    if ($tag_list) echo '<li><i class="icon-tags"></i> '.$tag_list.'</li>';
                    echo '<li><i class="icon-comments"></i> <a href="'.get_permalink().'#comments">'.sprintf( _n( 'One comment', '%1$s comments', get_comments_number(), 'kleo_framework' ),number_format_i18n( get_comments_number() ) ).'</a></li>';
            }
            else {
                    echo '<li><i class="icon-calendar"></i> '.$date.'</li>';
                    echo '<li><i class="icon-user"></i> '.$author.'</li>';
                    if ($tag_list) echo '<li><i class="icon-tags"></i> '.$tag_list.'</li>';
                    echo '<li><i class="icon-comments"></i> <a href="'. get_permalink().'#comments">'.sprintf( _n( 'One comment', '%1$s comments', get_comments_number(), 'kleo_framework' ),number_format_i18n( get_comments_number() ) ).'</a></li>';
    	}
    
    }
    
    #19511
     Nudrica
    Participant

    Thx – I got it to work now.

    #41365
     MattAdams
    Participant

    Sorry, I am trying to comment out the date, but I’m just not getting it right. Can someone please show the final code for removing the date, where you commented out the right part/s of the code?

    Thank you.

    ~Matt

    #41964
     Abe
    Keymaster

    To hide the date you can just do it via CSS

    COPY CODE
    
    .link-list li:first-child {
        display: none;
    }
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

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

You must be logged in to reply to this topic.

Log in with your credentials

Forgot your details?