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

  • SEARCH
  • Home
  • 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 6150467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:37:01+00:00 2026-05-23T19:37:01+00:00

Hi I tried to echo a image (as a part of an if/else code),

  • 0

Hi I tried to echo a image (as a part of an if/else code), but I couldn’t really do it.

Here’s my code:

echo "<a href="<?php the_permalink() ?>" rel="bookmark" ><img src="<?php bloginfo( 'template_directory' ); ?>/timthumb.php?src=<?php echo get_post_meta( $post->ID, 'image_value', true ); ?>&amp;w=225&amp;h=246&amp;zc=1" alt="<?php the_title(); ?>" /></a>";

As you can see its obviously because of the ” and ‘.
The tags attributes (by attributes I mean ‘alt’ ‘src’ etc..) require a ” while the php tags only work with ‘ .. so I didn’t really know what to do hehe..

Any suggestions?

By the way, the CMS is wordpres. If it helps..

  • 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-23T19:37:02+00:00Added an answer on May 23, 2026 at 7:37 pm

    The issue is WordPress functions like the_permalink and bloginfo use the echo function as well, so it doesn’t work when you try to put the two together. They don’t return anything. Instead, you want to use the functions that will return a string, so you can concatenate the return values with the HTML you want to output.

    Try this:

    echo "<a href='" . get_permalink() . "' rel='bookmark'><img src='" . get_bloginfo('template_directory') . "'/timthumb.php?src=";
    

    You can fill in the rest.

    Note: be wary of the rest of the answers. They appear to be answering the root of your question, but they ignore the nuances of the wordpress functions.

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

Sidebar

Related Questions

I tried to get avatar at single (post) page by these codes <?php echo
Possible Duplicate: get image from base64 string I tried header('Content-Type: image/png'); echo base64_decode($data);` But
Some weird case when I tried a simple php code to check the file
I have the following code: <?php foreach($bb['slides'] as $b): $url = domain.com/ . $b->image
I have an image: <img title=<?php echo JText::_('AEROBOT_HELLO'); ?> src=images/aerobot.png id=aerobot align=right /> And
I want to create tags using echo function but I'm stuck here; I dont
I've got this line, but I've tried adding the fade in, or fadeto part,
i have tried to copy euro symbol from Wikipedia...and echo it (in my parent
I need to echo entire content of included file. I have tried the below:
How do I run this command with subprocess? I tried: proc = subprocess.Popen( '''ECHO

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.