• Hello,

    I want to ask, Can custom content shortcodes use if conditionals based on post status? I want to hide some content if the post status is publish, I use this shortcode but not working,[if field=post-status value=publish] Can you help me

    Thank You

Viewing 3 replies - 1 through 3 (of 3 total)
  • You are comparing to the wrong value – try:

    [if field=post-status value=published]

    Thread Starter milarosa

    (@milarosa)

    Hello @polarracing

    Thank you it’s working now, but I have 1 question.
    if I have a post with the status “Expired”, so the value that I should add in the shortcode is from the value on the database or name on the status on a post?
    like status “publish” on the database is “publish” but we use published for value in the shortcode.

    I have already tried this :
    [if field=post-status value=gd-expired] : value gd_expired (on database)
    [if field=post-status value=expired] : value expired (on status post)
    but is still not working

    Thank You

    Thread Starter milarosa

    (@milarosa)

    @polarracing it’s already working and resolved Thank You

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

The topic ‘IF conditional using post status’ is closed to new replies.