WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How modify function the_meta (3 posts)

  1. Erfo
    Member
    Posted 2 years ago #

    Hi...
    I want to edit function the_meta()

    post-template.php

    function the_meta() {
    	if ( $keys = get_post_custom_keys() ) {
    		echo "<ul class='post-meta'>\n";
    		foreach ( (array) $keys as $key ) {
    			$keyt = trim($key);
    			if ( is_protected_meta( $keyt, 'post' ) )
    				continue;
    			$values = array_map('trim', get_post_custom_values($key));
    			$value = implode($values,', ');
    			echo apply_filters('the_meta_key', "<li><span class='post-meta-key'>$key:</span> $value</li>\n", $key, $value);
    		}
    		echo "</ul>\n";
    	}
    }

    I want delete "
    <li><span class='post-meta-key'>...", but I don't want to edit the file post-template.php

    How?
    Thanks...

    [please do not bump]

  2. fonglh
    Member
    Posted 2 years ago #

    Add a filter for 'the_meta_key' to your theme's functions.php file, or write a plugin that does the same thing.

    See the Codex page below for more information on using filters.
    http://codex.wordpress.org/Function_Reference/add_filter

  3. Erfo
    Member
    Posted 2 years ago #

    Thanks, I wrote another function in functions.php ...

Topic Closed

This topic has been closed to new replies.

About this Topic