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 7602095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:19:32+00:00 2026-05-30T23:19:32+00:00

I am trying to check to make sure a custom-field is not blank before

  • 0

I am trying to check to make sure a custom-field is not blank before echoing the custom-field.

This is what I have

<?php 
  $key = 'one_line_summary'; 
  $themeta = get_post_meta($post->ID, $key, TRUE); 
  if($themeta != '') {
    echo '<blockquote><?php echo get_post_meta($post->ID, one_line_summary, true); ?></blockquote>';
  }
?>

But it out puts the “get_post_meta($post->ID, one_line_summary, true);” literally rather than the contents of the variable one_line_summary.

I am a beginner but I feel like I need to either use nested echo’s somehow or change the second echo all together?

Thanks in advance.

  • 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-05-30T23:19:33+00:00Added an answer on May 30, 2026 at 11:19 pm

    You have nested <?php ?> inside an existing set of PHP tags, which is not allowed. Remove those, and concatenate in the function call to get_post_meta(). What happened here is that the inner <?php ?> tags were output as strings to the browser, but not rendered onscreen (since the browser treated them as unknown HTML tags).

    echo '<blockquote>' .  get_post_meta($post->ID, one_line_summary, true) . '</blockquote>';
    

    As a note, these kinds of issues are considerably easier to spot with proper code indentation as was done when your post was edited above.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to check to make sure an item is visible before I start
I'm trying to check a textarea to make sure it contains text phrase(s). This
I'm working on a password reset function and trying to check to make sure
I am trying to make a custom check box and radio button in pure
I'm trying to make a PHP script that will check the HTTP status of
i'm trying to make sure that all my user will not logg in during
I'm trying to create a function that will check to make sure all the
I am trying to create a validation that checks to make sure a domain/url
I am trying to make a bookmarklet that when clicked will check the URL
I am trying to make an if statement which will check whether the users

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.