tdschrock
Member
Posted 1 year ago #
I'm trying to use the Upload type for an image on the front page of my site. I've uploaded the file, and clicked on "Add to Option Tree", but I don't see any filename in the box, and I cannot figure how to get the picture displayed on the page. I'm using the code:
<?php
if ( function_exists( 'get_option_tree') ) {
echo get_option_tree( 'lbbc_sermon_series_picture' );
} ?>
to display the picture file.
http://wordpress.org/extend/plugins/option-tree/
tdschrock
Member
Posted 1 year ago #
I figured out something here. I was not echoing the right info into the img src tag. So my code is now...
if ( function_exists( 'get_option_tree') ) {
echo "<img src=";
echo get_option_tree( 'lbbc_sermon_series_picture' );
echo " />";
} ?>
Then, for the uploading problem I figured out that you have to leave the link url in place for the file url. I was clicking on "None".
Daniel Craig Jallits
Member
Posted 1 year ago #
For anyone else who may come across this. The double quotes need to be escaped in the first and last echo statements. So the code would be as follows:
<?php
if ( function_exists( 'get_option_tree') )
{
echo "<img src=\"";
echo get_option_tree( 'lbbc_sermon_series_picture' );
echo "\" />";
}
?>