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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T17:18:15+00:00 2026-05-28T17:18:15+00:00

I’m making a custom page template in wordpress and adding an image by using

  • 0

I’m making a custom page template in wordpress and adding an image by using a custom field. Like this:

    <img src="<?php echo bloginfo('url') ?><?php echo get_post_meta($post->ID, 'main_picture', true); ?>" />

I’m putting the path to the image in a custom field.

The image is uploaded through the custom panel so the custom files will have a Name of ‘main_picture’ and a value of the upload path, like so – ‘wordpress/wp-content/uploads/2012/01/mypic.png’

I’d prefer to be able to reference the image by title, and extrapolate the image url from that title.

Is that possible?

Let me know if my question doesn’t make sense. I’m quite new to wordpress.
———————-edit———-

I realise that using the image name is not a great idea, as it won’t always be unique. I;m trying to make it as easy on the client as possible. They’re going to be wary of using custom fields, image names will be the easiest thing for them to understand.

  • 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-28T17:18:16+00:00Added an answer on May 28, 2026 at 5:18 pm

    I’d suggest ditching custom fields entirely then and creating your own metabox interface for uploading images and naming them etc. The answer to your question from unknown_guy is a good start. Custom fields are a crap user experience imho.

    And are you talking about getting the client to insert the image into the post content? If so, combine a metabox ui with a shortcode interface. Something that when the client has filled in the required fields for image, name etc, gives them some code to ‘paste’ or insert where they want it to show up.

    Metabox tutorials:

    http://www.farinspace.com/how-to-create-custom-wordpress-meta-box/
    http://wp.tutsplus.com/tutorials/plugins/how-to-create-custom-wordpress-writemeta-boxes/
    http://www.deluxeblogtips.com/2010/04/how-to-create-meta-box-wordpress-post.html

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm making a simple page using Google Maps API 3. My first. One marker
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I would like to count the length of a string with PHP. The string
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have some data like this: 1 2 3 4 5 9 2 6
link Im having trouble converting the html entites into html characters, (&# 8217;) i

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.