Jump to content


These Forums Are Now Read-Only


For TubePress support, please post a question here or open a support ticket and we will be glad to assist.


Photo

Insert Custom Field Into The Wordpress Php Template


Best Answer SoloAnt, 25 September 2013 - 11:16 AM

I've got this figured out.

 

If anyone is looking to do something like this, this is what helped me out.

 

http://wordpress.org...in-the-template

 

http://wordpress.org...ng-do_shortcode

 

And this is the code that I inserted into the template file

<?php $var = get_post_meta($post->ID, 'CUSTOM FIELD NAME', true);
if ($var == '')
{ }
else { print TubePressPro::getHtmlForShortcode( '[tubepress mode="vimeoChannel" vimeoChannelValue="' . $var . '"]'); } ?>

Go to the full post


  • Please log in to reply
6 replies to this topic

#1 SoloAnt

SoloAnt

    Newbie

  • Members
  • Pip
  • 7 posts

Posted 18 September 2013 - 05:09 PM

Not sure if this is the correct place for this but here's my dilemma.

 

I got the video to show up fine with the using the wordpress php put into the template page like this

<?php print TubePressPro::getHtmlForShortcode('mode="vimeoChannel" vimeoChannelValue="ChannelName"'); ?>) 

But my next issue is getting the custom field to input into the correct place.

 

Example in vimeoChannelValue section:

<?php print TubePressPro::getHtmlForShortcode('mode="vimeoChannel" vimeoChannelValue="get_custom_field('team_videos')"'); ?>

And where on the edit post/page one would fill in the "team_video" field and it would out put like so

<?php print TubePressPro::getHtmlForShortcode('mode="vimeoChannel" vimeoChannelValue="Proper VideoChannel is here"'); ?>

Make sense?

 

I purchased the pro version today, thinking I could get this figured out, but I can't seem to get it.

 

Thanks

Sol



#2 SoloAnt

SoloAnt

    Newbie

  • Members
  • Pip
  • 7 posts

Posted 19 September 2013 - 09:13 PM

How long does it take for priority support if you've purchased the pro version? I've had this question here for 24hrs with no reply. Please let me know what time frame is for priority support.

 

Thanks

Sol



#3 brandon

brandon

    Advanced Member

  • TubePress Staff
  • 1989 posts

Posted 23 September 2013 - 02:49 AM

Sol,

 

I'm not quite sure I understand what it is exactly you are trying to accomplish with this shortcode:

<?php print TubePressPro::getHtmlForShortcode('mode="vimeoChannel" vimeoChannelValue="get_custom_field('team_videos')"'); ?>

Are you trying to your shortcode into a search parameter or?

 

If you could explain a little clearer exactly what it is you are trying to accomplish, I'd be more than happy to assist you.  You can also look here: http://tubepress.com...nfig:AllOptions

for more information on shortcodes, their values, and how they work.

 

As for your question regarding priority support for Pro users, the response time is 3 business days.  If you are interested in faster response, we do have a Rapid Response tier which guarantees a response within 24hrs.

 

Thanks!


Want a faster, more personalized support experience? Open a ticket with us! We will be gradually phasing out forum-based support in favor of a proper ticketing system. Please help us help you!


#4 SoloAnt

SoloAnt

    Newbie

  • Members
  • Pip
  • 7 posts

Posted 23 September 2013 - 07:15 PM

I need a custom field, that I have setup on the post edit window to populate into the wordpress template (see attached img of field) into the vimeoChannelValue="Channel Name" area. So when one enters the name it will output into that vimeoChannelValue between the quote marks and spit out correctly to the viewer of the website. Make sense?

 

The code that I have for the custom field is this

<?php print_custom_field('team_videos'); ?>

I just don't know how to get the above to insert into this this below ("NEEDS TO INSERT HERE")

<?php print TubePressPro::getHtmlForShortcode('mode="vimeoChannel" vimeoChannelValue="NEEDS TO INSERT HERE"'); ?>) 

I don't know how to get the PHP to insert into PHP.

 

Not sure if I'm explaining well enough, but I'm not sure how to explain it any better, I'm unsure of the terminology to use.

 

Custom Field from Post Edit Window.

Screen-Shot-2013-09-23-at-4.55.42-PM.png

 

Understood on the time frame for a reply.

 

Thanks

Sol

Attached Files



#5 SoloAnt

SoloAnt

    Newbie

  • Members
  • Pip
  • 7 posts

Posted 25 September 2013 - 11:16 AM   Best Answer

I've got this figured out.

 

If anyone is looking to do something like this, this is what helped me out.

 

http://wordpress.org...in-the-template

 

http://wordpress.org...ng-do_shortcode

 

And this is the code that I inserted into the template file

<?php $var = get_post_meta($post->ID, 'CUSTOM FIELD NAME', true);
if ($var == '')
{ }
else { print TubePressPro::getHtmlForShortcode( '[tubepress mode="vimeoChannel" vimeoChannelValue="' . $var . '"]'); } ?>



#6 brandon

brandon

    Advanced Member

  • TubePress Staff
  • 1989 posts

Posted 01 October 2013 - 11:06 PM

SoloAnt,

 

I'm glad that you solved this issue.

 

Thanks!


Want a faster, more personalized support experience? Open a ticket with us! We will be gradually phasing out forum-based support in favor of a proper ticketing system. Please help us help you!


#7 SoloAnt

SoloAnt

    Newbie

  • Members
  • Pip
  • 7 posts

Posted 28 July 2015 - 07:57 PM

Update to making this thread relevant. 

 

The above code will still work but then see this link to make it work.

 

http://support.tubep...press-templates