Forums

Conditional for no content in a post (2 posts)

  1. Pete
    Member
    Posted 4 months ago #

    I asked this same question some time ago but the answer didn't work for me...
    is there a way to make a conditional thingy so that IF there is no 'content' in a post THEN

    http://wordpress.org/support/topic/is-there-a-conditional-for-no-content

    I was wondering if someone else could test it to see if it works or if anyone has an answer for this

  2. Ajalon
    Member
    Posted 2 months ago #

    Hi Pete

    I had a similar issue and I got round it by using get_the_content()

    e.g.:
    $content = get_the_content();
    if (empty($content)) {
    /* Do something */
    } else {
    /* Do something else */
    }

    Hope this helps

    Allan

Reply

You must log in to post.

About this Topic