WordPress.org

Ready to get started?Download WordPress

Forums

How to Remove twentyten_posted_in() function (9 posts)

  1. LClark52
    Member
    Posted 6 months ago #

    Hi,

    I've created a twenty-ten child theme; I'm trying to remove the line which reads "Posted in ''| Comments Off ". As far as I understand, I need to remove the following function which is in functions.php file:

    function twentyten_posted_in() {
    	// Retrieves tag list of current post, separated by commas.
    	$tag_list = get_the_tag_list( '', ', ' );
    	if ( $tag_list ) {
    		$posted_in = __( 'This entry was posted in %1$s and tagged %2$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyten' );
    	} elseif ( is_object_in_taxonomy( get_post_type(), 'category' ) ) {
    		$posted_in = __( 'This entry was posted in %1$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyten' );
    	} else {
    		$posted_in = __( 'Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyten' );
    	}
    	// Prints the string, replacing the placeholders.
    	printf(
    		$posted_in,
    		get_the_category_list( ', ' ),
    		$tag_list,
    		get_permalink(),
    		the_title_attribute( 'echo=0' )
    	);
    }

    I have search everywhere, including the Codex, to see how I can override or turn off the function in a child theme, but came away empty handed.

    I'd greatly appreciate it, if someone could point me in the right direction.

    Many thanks in advance.

  2. esmi
    Forum Moderator
    Posted 6 months ago #

    No. You need to create your own customised twentyten_posted_in() function in your child theme's functions.php file. The child's version will be used automatically.

  3. bob cavanaugh
    Member
    Posted 6 months ago #

    Would this also work in style.css? .entry-utility-prep, .cat-links, .meta-sep {
    display:none;

  4. esmi
    Forum Moderator
    Posted 6 months ago #

    @bob cavanaugh: It is considered impolite to interrupt another poster's ongoing thread unless you are posting a solution or suggestion. It causes significant problems for the forum's volunteers and prevents us from being able to track issues by topic. Please post your own topic.

  5. bob cavanaugh
    Member
    Posted 6 months ago #

    Sorry maybe I should have worded my response a little differently, but that's how I would have solved the OP's problem.

  6. esmi
    Forum Moderator
    Posted 6 months ago #

    My bad. Your post referenced CSS and this is a function issue. Hence why I assumed that you were asking your own question.

  7. bob cavanaugh
    Member
    Posted 6 months ago #

    That makes sense. While wordpress.com and wordpress.org are very different, I figured the CSS code I posted above might hide that message like it does over at wordpress.com. If it doesn't, it looks like I'll have to take another look at my own child theme. If I find something wrong with style.css, I'll post the new questions here

  8. LClark52
    Member
    Posted 6 months ago #

    @esmi: Thank you for your response.

    I put the following code into functions.php of my child theme:

    function twentyten_posted_in() {
    }

    Assuming, that since the function has no values, it would return nothing; to my surprise, the line was still there.

    Any thoughts?

    Thank you.

  9. LClark52
    Member
    Posted 6 months ago #

    @esmi: Thanks again for your help.

    I've also tried the following function in my child theme's functions.php file; however, it did not work either.

    function twentyten_posted_in() {
    	return;
    }

    What am I doing wrong?

    Many Thanks.

Reply

You must log in to post.

About this Topic