WordPress.org

Ready to get started?Download WordPress

Forums

Formatting Custom Fields (9 posts)

  1. hughshields
    Member
    Posted 9 months ago #

    I am having a problem with the format of my custom fields which I have attached to the quote post format. In my theme the custom field displays on two lines instead of on the same line. Below is an example of a movie quote:

    Mama always said “Life is like a box of chocolates”.

    Movie
    : Forrest Gump
    Character
    : Forrest Gump
    Actor
    : Tom Hanks

    I used the following CSS to get rid of the bullets and padding for each custom field but did not get each custom field to display on the same line.

    /* Style post-meta-lists*/
    ul.wpuf_customs {
    list-style-type: none;
    margin: 0;
    padding-left: 0;
    }

    Any idea how to get this to display inline?

  2. esmi
    Forum Moderator
    Posted 9 months ago #

    Unless you provide a link to a page demonstrating the problem, no one will be able to offer much in the way of assistance. All we can currently suggest is that you try using Firefox with the Firebug add-on for this kind of CSS troubleshooting. Or use whatever developer tool is available in your web browser.

  3. hughshields
    Member
    Posted 9 months ago #

    Here is the link to my quote format post:

    Movie Quote

    I have firebug. The odd thing about this is that in the default theme the custom fields display on the same line. So somewhere in my theme the custom fields are being separated into two lines

  4. hughshields
    Member
    Posted 9 months ago #

    I found the wp-includes/post-template.php file where custom fields are coded. I tried changing the ul to div tags and the li to p tags but it had no effect on the posts custom fields.

    Here is the code:

    /**
     * Display list of post custom fields.
     *
     * @internal This will probably change at some point...
     * @since 1.2.0
     * @uses apply_filters() Calls 'the_meta_key' on list item HTML content, with key and value as separate parameters.
     */
    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 "\n";
    	}
    }

    So I am still looking for where the custom fields are formatted.

  5. esmi
    Forum Moderator
    Posted 9 months ago #

    label {
        color: #333333;
        display: block;
        font-size: 90%;
    }

    style.css line 1234

  6. hughshields
    Member
    Posted 9 months ago #

    Hi esmi,
    Thanks for the response. The above CSS exists as you wrote it above already on line 1234 of my theme's style sheet. Are you just showing me the location of the css? Any help on how to style it to make the custom fields appear on the same line?

  7. esmi
    Forum Moderator
    Posted 9 months ago #

    Are you just showing me the location of the css?

    Correct. Try removing display: block;.

  8. hughshields
    Member
    Posted 9 months ago #

    I tried it and the formatting doesn't change. This is an issue with my theme (suffusion). When I go to the buddypress default theme the formatting is fine.
    I have posted on the suffusion forum but no resolution yet.
    Thanks for trying
    Hugh

  9. hughshields
    Member
    Posted 9 months ago #

    Hi esmi
    It turns out that
    display:inline
    ended up fixing the issue.
    Thanks again for your help!

Reply

You must log in to post.

About this Topic