Viewing 13 replies - 16 through 28 (of 28 total)
  • This plugin is just amazing. Thanks, Hiroaki. I will be sending a donation your way for sure.

    I seem to be having some kind of problem with the CSS formatting. All the fields look the same when I see the output in a page. What could be wrong? When I take a look at the code from the output page, everything seems ok, but I can’t the CSS bit from the templates options anywhere, just the code calling the cft class.

    Anyone?

    Hi verowhite,
    You mean the css of output page which is called by the [cft] shortcode? CSS of the setting page of custom field template is for the edit post/page. It is not loaded on the output page. Well, I may add the css setting or file in the future, but currently please write down the css directly to style.css of your theme. I appreciate your support:) Thank you.

    Oh! Ok, I understand now. So i guess I would have to write my own code to customize that by defining the ctf class in my style.css file, right?

    Thanks again, Hiroaki.

    Yes, that’s right. The dl tag has cft class. Add your own css in your style.css based on that class.

    Hiroaki, I was made a spanish translation. Where I can send it?

    Great! Send me the file to webmaster[at]wordpressgogo.com. I will include it in the next release. If you have your site, I will link to it from the plugin page. So, let me know. Thank you!!

    Uh Oh! I’m using the code I posted above:

    <?php $mykey_values = get_post_custom_values('Thumbnail');
      foreach ( $mykey_values as $key => $value ) { echo "$value"; }?>

    …Which works fine where there’s a value assigned to the corresponding custom field (Thumbnail, in this example). However, though the codex documentation (https://codex.www.ads-software.com/Function_Reference/get_post_custom_values) says that a custom field left blank will return nothing, I get this error for any post that does not have content in the custom field:
    Warning: Invalid argument supplied for foreach() in path/single.php on line X
    (Actual path truncated and line number removed.) Do I need some kind of “if” piece of code, to ensure that a blank custom field will return nothing? I’m a total noob with PHP, so I’d need this spelled out for me.

    I can give practical examples if necessary. Thanks!

    @ CowboyFrank, try something like this

    It says IF your custom field key’s value == ” BLANK, then (do nothing), or you could put something here like printing “There’s not a thumbnail for this post because I forgot to put one”

    ELSE, IF it isn’t blank, then echo the value (prints your thumbnail).

    <?php
    $yourthumbnailkey_values = get_post_meta($post->ID, 'Thumbnail', true);
    if ($yourthumbnailkey_values == '')
    { ?>
    
    <?php } else { ?>
    
    <?php echo $yourthumbnailkey_values; ?>
    
    <?php } ?>

    Hope that works for ya! I found it very useful.

    WOW! Thanks so much! Works perfectly.

    You’re welcome. I was very happy too when someone showed me that type of code on here earlier.

    Great!
    Is it possible when a user mark the right answer add a point to the user profile/account?

    This is a very good plugin.
    I’m having a slightly different problem around having “blank” custom fields.

    I would like to force appending a single space into a text area to prevent the sql-data entry from disappearing.

    I have 12 posts (of a specific category) which are cleared (not deleted) via cron at midnight every day. These posts are then editable by editors through-out the day with up to the minute information via the custom-fields plugin.

    Hi C0BALT,
    I released the version 0.8. I added the blank option. If you set blank = true attribute, the value will be saved if it is blank.
    Please try it out. Thanks.

Viewing 13 replies - 16 through 28 (of 28 total)
  • The topic ‘[Plugin: Custom Field Template] Pretty Good’ is closed to new replies.