Toolset Types
[resolved] [Plugin: Types - Custom Fields and Custom Post Types Management] Add content before or after date fi (2 posts)

  1. Eckstein
    Posted 3 years ago #

    I am wondering if it's possible to include html before or after the output of a date field. Specifically, I'm trying to at a "-" before a certain date but ONLY if that date is filled in, otherwise I don't want the dash.

    Is that possible? Even if someone has some php I can use outside of the scope of Types.



  2. Amir Helzer
    Plugin Author

    Posted 3 years ago #

    If you're using Types API functions to display fields, you can certainly output any text/HTML before and after field values.

    To make this conditional upon field values, you'll need to load the field via the standard WordPress API (get_post_meta - http://codex.wordpress.org/Function_Reference/get_post_meta ), check its value and do whatever other processing you want.

    You can also use Views to do all this output. This way, you can create elaborate output without any PHP. With Views, you can use conditional output to achieve what you're asking here. See this for conditional output using Views:

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Toolset Types
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.