WordPress.org

Support

Support » Plugins and Hacks » [Resolved] [Plugin: OptionTree] Using the Upload type

[Resolved] [Plugin: OptionTree] Using the Upload type

  • 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/

Viewing 2 replies - 1 through 2 (of 2 total)
  • 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”.

    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 "\" />";
    	}
    ?>
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] [Plugin: OptionTree] Using the Upload type’ is closed to new replies.