Title: Comparing shortcodes within an if shortcode
Last modified: August 22, 2016

---

# Comparing shortcodes within an if shortcode

 *  Resolved [gpalowitch](https://wordpress.org/support/users/gpalowitch/)
 * (@gpalowitch)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/comparing-shortcodes-within-an-if-shortcode/)
 * Hi Elliot,
 * What I would like to do is display some content if the first letter of a field
   is a certain one.
 * If (first letter(post title)) = “A” then dosomething
 * I found that CCS has a short code for only displaying a certain length of characters,
   but I would really love to pass the result of the shortcode into the if shortcode
   to come it.
 * I would be very interested if there was a way to do this without having to create
   a custom field that just has the first letter of the post title in it.
 * Thanks,
    Garrett
 * [https://wordpress.org/plugins/custom-content-shortcode/](https://wordpress.org/plugins/custom-content-shortcode/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Eliot Akira](https://wordpress.org/support/users/miyarakira/)
 * (@miyarakira)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/comparing-shortcodes-within-an-if-shortcode/#post-5335893)
 * Hello,
 * With the latest update, you can set _start=”true”_ for the [if] shortcode, and
   it will only check the beginning of post name or field value.
 *     ```
       [if name="a" start="true"]
         This displays if the post slug starts with "a"
       [/if]
       ```
   
 *  Thread Starter [gpalowitch](https://wordpress.org/support/users/gpalowitch/)
 * (@gpalowitch)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/comparing-shortcodes-within-an-if-shortcode/#post-5335928)
 * Thanks Eliot,
 * I really appreciate the quick response and addition.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Comparing shortcodes within an if shortcode’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/custom-content-shortcode_766976.svg)
 * [Custom Content Shortcode](https://wordpress.org/plugins/custom-content-shortcode/)
 * [Support Threads](https://wordpress.org/support/plugin/custom-content-shortcode/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-content-shortcode/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-content-shortcode/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-content-shortcode/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [gpalowitch](https://wordpress.org/support/users/gpalowitch/)
 * Last activity: [11 years, 8 months ago](https://wordpress.org/support/topic/comparing-shortcodes-within-an-if-shortcode/#post-5335928)
 * Status: resolved