Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8371223
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T14:06:47+00:00 2026-06-09T14:06:47+00:00

I am trying to create a conditional that echoes something when a custom field

  • 0

I am trying to create a conditional that echoes something when a custom field is not “empty” (contains something)

The following is what I want to “echo”:

<div>Who is there?: <?php echo genesis_get_custom_field('FOO'); ?></div>

Which properly results in:

A) “Who is there?:” (when FOO is “empty”)

B) “Who is there?: Me” (when FOO contains “Me”)

When I add the following suggested conditional:

<?php if ( genesis_custom_field('FOO') != "") { ?>
<div>Who is there?: <?php echo genesis_get_custom_field('FOO'); ?></div>)
<?php } ?>

The result is “NULL” as expected when FOO is “empty”

BUT, when FOO = “Me” the resulting echo is:

“Me” (all “html” is stripped away including the DIV)

I am sure there is a “simple” syntax problem… I have scoured the PHP manuals and Google to no avail…

The only vague reference I could find that might work is to “echo” the entire line of HTML. If this is a good solution can someone be so kind as to share an example of how to modify my working “DIV” with embedded “echo” to code that is an “echo” with embedded “DIV”?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T14:06:48+00:00Added an answer on June 9, 2026 at 2:06 pm

    Now after I realised they’re two different functions, I would suggest replacing

    if ( genesis_custom_field('FOO') != "")
    

    with

    if ( genesis_get_custom_field('FOO') != "")
    

    this function should be returning a value, which you can then compare against ""

    further you could replace

    echo genesis_get_custom_field('FOO')
    

    with

    genesis_custom_field('FOO')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using ExpressionEngine 2.2.1 and am trying to create a conditional that will
Im trying to create a conditional statement that iterates through an array of nodes
I am trying to create an object that is capable of handling query-like conditional
I'm trying to create a basic database trigger that conditionally deletes rows from database1.table1
I'm trying to create an conditional Rewrite Rule using an .htaccess file and Apache.
I'm trying to create a cpan module that integrates Text::Haml into Template Toolkit. I
I've been trying to create a conditional where clause for my query below but
I'm trying to create a conditional sum, in order to calculate an average. The
I'm trying to create a conditional statement in an ORACLE sql code I have
I am trying to create a conditional taglib in grails to determine whether or

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.