Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End WordPress – If Statement

  • This topic is empty.
Viewing 9 posts - 16 through 24 (of 24 total)
  • Author
    Posts
  • #105547
    TheDoc
    Member

    If you completely take the code out, does it still display something? It’s an easy way to check if you’re editing the right file.

    #105548
    chrisburton
    Participant

    @TheDoc No, it doesn’t output anything if I remove the code. Although, when I was speaking with Jamy, he had me firebug it and it showed quotes in the markup but not in view source. I’ll screenshot.

    #105549
    TheDoc
    Member

    A link would also be fantastic!

    #105550
    chrisburton
    Participant
    #105551
    TheDoc
    Member

    It looks like it’s working fine!

    #105553
    chrisburton
    Participant

    @TheDoc, That’s because I put the code back that I had before. If I use @ChrisxClash’s solution, I get this: http://i46.tinypic.com/2q9j8de.png

    #105628
    chrisburton
    Participant

    I’m really close on this (I think).

    
    $meta = $custom_metabox->the_meta('description', TRUE);
    if ($meta):
    echo '

    '.$meta.'

    '; ?>

    Returns

    Array

    Instead of the actual content but if I don’t have any content in the metabox, it doesn’t return anything, which is exactly what I wanted.

    All I need is help figuring out why it returns “Array” instead of the actual content.

    #105633
    chrisburton
    Participant

    I had someone on the WordPress forums help me further.

    Solution:

    
    $meta = $custom_metabox->the_meta('description', true);
    if (!empty($meta)):
    echo '

    '.$meta.'

    '; ?>

    Thanks everyone for your help. I owe you one.

    #105663
    chrisburton
    Participant

    @ChrisxClash Thanks for explaining. Much appreciated.

Viewing 9 posts - 16 through 24 (of 24 total)
  • The forum ‘Back End’ is closed to new topics and replies.