How do I format this echo statement using wordpress’ do_shortcode and a value from user input?

I’m running wordpress multi-site where users can signup for a free blog. I’ve purchased and enabled the wordpress options framework kit to allow custom options for the user to configure their blog.

Using the nextgen gallery plugin I’m using the shortcode in the blog template file:

Read More
<?php echo do_shortcode("[jj-ngg-jquery-slider html_id='about-slider' directionnav='true' controlnav='false' gallery='1' effect='fade' ]"); ?>

In the do_shortcode it will only get the gallery with an id of 1 (gallery=”1″). That shortcode works fine except when a user deletes the gallery with id 1 or they create a new gallery and want to use it instead of gallery id 1.

In the backend I have an option for enter the gallery id they want to use. I’m using the options framework to configure the backend theme options. The options framework uses the following code to output the user’s input:

of_get_option('home_slideshow', 'Default');

My question is how do I replace the single digit “1” from the shortcode where it says gallery=”1″ with the of_get_option? I can’t figure out the proper format to achieve this.
Thank you in advance.

Related posts

Leave a Reply

1 comment

  1. So the answer is:

    $galleryid=of_get_option('home_slideshow', 'Default'); 
    echo do_shortcode("[jj-ngg-jquery-slider html_id='about-slider' directionnav='true' controlnav='false' gallery='".$galleryid."' effect='fade' ]");