Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I want to create a custom field, let's say Tickets in which I can store different links for each post. For example:

On a post page I have a button called "Buy ticket" which has a specific link, also on another post I have the same "Buy ticket" but with another link and so on ... How can I make this ? Thanks

share|improve this question
2  
Please revise your old questions and accept the answers where it applies (this 0% accept rate doesn't do you any good)... I checked them and most were answered by very knowledgeable folks of this site. . . . . While we are at it, please take a look at the FAQ too. –  brasofilo Jul 4 '12 at 16:36
    
From 0 to 100 in nano-moments, congrats and thx! –  brasofilo Jul 4 '12 at 17:09
    
lol, now somebody could help me with this ? –  agis Jul 4 '12 at 17:50
    
As a matter of fact, this is a very basic issue. Research this Stack and take a look at the Codex. I'm sure you'll be able to sort it out. –  brasofilo Jul 4 '12 at 17:57
    
@Alecs The downvotes you received are for the lack of any research effort (code) whatsoever. :) –  its_me Jul 5 '12 at 4:36

1 Answer 1

up vote 0 down vote accepted

Lets go with an example...

Custom Field Name: buy-ticket
Custom Field Value: http://example.com/link-to-ticket/

And you said, you want a button called "Buy ticket" linking to the Custom Field Value. This how you do it:

<a href="<?php echo get_post_meta($post->ID, 'buy-ticket', true); ?>" title="Buy a ticket right away!">
    <span>Button text or code here</span>
</a>

SOURCE: WordPress Codex Function Reference/get_post_meta

PS: You can disregard the <span> tag. I used it for cosmetic purposes. :)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.