Home › Forums › Calendar Products › Events Calendar PRO › Pulling a variable into a link
- This topic has 20 replies, 4 voices, and was last updated 10 years, 9 months ago by
Support Droid.
-
AuthorPosts
-
March 6, 2012 at 8:01 am #16278
Darren
ParticipantI’m not sure whats happened here as it was working but not now. I have made a child of single.php so I can add a link to a contact form that drops a ref code into the subject field but its broken and I cannot see why.
I have
<a href="http://highamhall.com/contact?1subject=Enquiry+regarding+course+”>Make an enquiry about this course.
Any php/tribe wizzards able to spot what’s gone wrong.
March 6, 2012 at 8:08 am #16279Darren
ParticipantIt may be helpful to see the error on a live page – just under the facebook logo you can see Ref C1646 Make an enquiry. The Ref C1646 shouldn’t be part of the visible link.
March 6, 2012 at 8:24 am #16280Darren
Participantah juts noticed the message board has edited my code. Has this worked?
<a href="http://highamhall.com/contact?1subject=Enquiry+regarding+course+”>Make an enquiry about this course.
March 6, 2012 at 8:24 am #16281Darren
Participantarghhh – cant even paste the code!
March 6, 2012 at 8:27 am #16285Darren
Participant
<a href="http://highamhall.com/contact?1subject=Enquiry+regarding+course+">Make an enquiry about this course.
</codeMarch 6, 2012 at 8:29 am #16286Darren
Participant
<a href="http://highamhall.com/contact?1subject=Enquiry+regarding+course+">Make an enquiry about this course.
March 6, 2012 at 8:29 am #16287Darren
ParticipantI give up!
March 6, 2012 at 8:55 am #16288Darren
ParticipantMaybe this time it will work?
[sourcecode language=”css”]
<a href="http://highamhall.com/contact?1subject=Enquiry+regarding+course+">Make an enquiry about this course.</a>
[/sourcecode]March 6, 2012 at 9:17 am #16303Rob
MemberHey Darren. Sorry about the inconvenience; if using the
tag isn't working, would you mind dropping the code into pastie.org (or a related service) and sharing the link with us here? We can definitely take a look and try to help you out from there.March 6, 2012 at 9:20 am #16304Darren
ParticipantThanks Rob at least I can now get the code seen 🙂
March 7, 2012 at 12:58 am #16342Darren
ParticipantTo make this thread less confused I shall explain my problem again.
I’m not sure whats happened here as it was working but not now. It coudl be an update as custom field now seems to pull css markup where previously it was only the actual variable in the custom field.
I have made a child of single.php so I can add a link to a contact form that drops a ref code (custom field) into a subject field of a contact form but its broken and I cannot see why.
The code is posted here http://pastie.org/3534943
The page with the error – http://www.highamhall.com/course/westmorland-quilt/ – just under the facebook logo you can see ‘Ref C1646 Make an enquiry’. The Ref C1646 shouldn’t be part of the visible link it should be passed to through the link to the contact form.
Any ideas what’s happened to break it?
Thanks
March 7, 2012 at 9:26 am #16374Rob
MemberThanks Darren! I’ve asked Jonah from our dev team to take a look here today and respond accordingly. Stay tuned and thanks for your patience thus far.
March 7, 2012 at 10:37 am #16389Jonah
ParticipantHi Darren,
Using tribe_the_custom_fields() is probably not working for you because this returns a definition list or all custom fields for an event. I think what you want to use is: echo tribe_get_custom_field(‘Label’, $post->ID) or tribe_custom_field(‘Label’, $post->ID) – where “Label” is the label of your custom field.
Let me know whether or not that works.
March 7, 2012 at 12:57 pm #16404Darren
ParticipantHi Jonah
Tried both of those examples and they show the link correctly but doesnt grab the custom field. I’ve set the custom field label to Ref as it is in Additional Fields on the settings page – is that correct?
March 8, 2012 at 10:01 am #16443Darren
ParticipantIts not showing as a fault any more but the new code isn’t pulling any variable from the custom field. I’ve searched the mySQL db but cant see where it may be so I can only assume I’m using the correct name as I’ve set up in the calendar settings page.
Any suggestions?
-
AuthorPosts
- The topic ‘Pulling a variable into a link’ is closed to new replies.
