• bubdadigger

    (@bubdadigger)


    Heya :O)

    SO here is a question.
    Was trying to edit entry_meta, to change text in it, add something etc.
    But all I found is some parts of the code pointing to <?php sela_entry_meta(); ?> & <?php sela_footer_entry_meta(); ?>. Was browsing thru all php files but couldn’t find those files/codes or any way to edit entry_meta.

    All I was able to do is added tags from post footer menu by simply copy-paste <?php sela_footer_entry_meta(); ?> right below <?php sela_entry_meta(); ?>.
    And that is it.

    Any help on where to find those files or parts of the code to edit text in it or add new line?

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • ariane98

    (@ariane98)

    Hi

    maybe you should look for the sela_entry_meta() function inside the inc/template-tags.php and see this post

    It worked for me…

    Thread Starter bubdadigger

    (@bubdadigger)

    Thanks a lot!
    I’ll take a look.

    My idea was to add few lines of text or text links to entry_meta, but I guess it will require a skills in scripting…

    Siobhan

    (@siobhyb)

    Thanks so much for your help again @ariane98. ??

    @bubdadigger: You’ll need to copy/paste the sela_entry_meta() function to your child theme’s functions.php file and edit there:

    function sela_entry_meta() {
    	// Sticky
    	if ( is_sticky() && is_home() && ! is_paged() ) {
    		echo '<span class="featured-post">' . __( 'Featured', 'sela' ) . '</span>';
    	}
    
    	// Date
    	if ( ! is_sticky() ) {
    		sela_entry_date();
    	}
    
    	// Comments
    	if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) {
    		echo '<span class="comments-link">';
    		comments_popup_link( __( 'Leave a comment', 'sela' ), __( '1 Comment', 'sela' ), __( '% Comments', 'sela' ) );
    		echo '</span>';
    	}
    
    	// Edit link
    	edit_post_link( __( 'Edit', 'sela' ), '<span class="edit-link">', '</span>' );
    }

    Depending on what you’re trying to achieve, you could also borrow code from the sela_footer_entry_meta() function:

    function sela_footer_entry_meta() {
    	/* translators: used between list items, there is a space after the comma */
    	$category_list = get_the_category_list( __( ', ', 'sela' ) );
    
    	/* translators: used between list items, there is a space after the comma */
    	$tag_list = get_the_tag_list( '', ', ' );
    
    	if ( ! sela_categorized_blog() ) {
    		// This blog only has 1 category so we just need to worry about tags in the meta text
    		if ( '' != $tag_list ) {
    			$meta_text = '<span class="tags-links">' . esc_html__( 'Tagged: %2$s', 'sela' ) . '</span>';
    		} else {
    			$meta_text = __( '<a href="%3$s" title="Permalink to %4$s" rel="bookmark">Permalink</a>.', 'sela' );
    		}
    
    	} else {
    		// But this blog has loads of categories so we should probably display them here
    		if ( '' != $tag_list ) {
    			$meta_text = '<span class="cat-links">' . esc_html__( 'Posted in: %1$s', 'sela' ) . '</span><span class="sep"> | </span><span class="tags-links">' . esc_html__( 'Tagged: %2$s', 'sela' ) . '</span>';
    		} else {
    			$meta_text = '<span class="cat-links">' . esc_html__( 'Posted in: %1$s', 'sela' ) . '</span>';
    		}
    
    	} // end check for categories on this blog
    
    	printf(
    		$meta_text,
    		$category_list,
    		$tag_list,
    		esc_url( get_permalink() ),
    		the_title_attribute( 'echo=0' )
    	);
    }

    Hope that helps out!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Edit entry_meta’ is closed to new replies.