Есть форма ввода для ключа, помогите пожалуйста PHP: $of_options[] = array( "name" => "", "desc" => __('Укажите, ключ Google карты', 'iwebtheme'), "id" => "maps", "std" => "", "fold" => "map_enable", "type" => "textarea"); Как вывести сюда PHP: // Ключ для google карты if(is_page_template('templates/page-contact.php')) { wp_enqueue_script('maps','https://maps.google.com/maps/api/js?sensor=true;language=ru&key=Как вывести ключ сюда ','jquery', '1.3', TRUE); wp_enqueue_script('gmap', get_template_directory_uri() . '/js/jquery.gmap.min.js','jquery', '2.1.2', TRUE); }
в переменную $of_options[] записываются множество массивов? или только данный который вижу ? PHP: wp_enqueue_script('maps','https://maps.google.com/maps/api/js?sensor=true;language=ru&key=' . $of_options['desc'],'jquery', '1.3', TRUE);
PHP: //Contact Settings $of_options[] = array( "name" => "Contact Settings", "type" => "heading" ); $of_options[] = array( "name" => __('Включение или отключение карты на странице контактов', 'iwebtheme'), "desc" => __('Поставьте галочку, чтобы активировать карту на странице контактов', 'iwebtheme'), "id" => "map_enable", "std" => 1, "folds" => 1, "type" => "checkbox"); $of_options[] = array( "name" => "", "desc" => __('Укажите, ключ Google карты', 'iwebtheme'), "id" => "maps", "std" => "", "fold" => "map_enable", "type" => "textarea"); $of_options[] = array( "name" => "", "desc" => __('Введите ваш адрес', 'iwebtheme'), "id" => "map_address", "std" => "Level 13, 2 Elizabeth St, Melbourne Victoria 3000 Australia", "fold" => "map_enable", /* the checkbox hook */ "type" => "textarea"); $of_options[] = array( "name" => "Адрес электронной почты", "desc" => "Введите ваш адрес электронной почты", "id" => "contact_email", "std" => "name@email.com", "type" => "text" ); $of_options[] = array( "name" => "Сообщение об успешном выполнении", "desc" => "Это образец, скрытый вариант 2", "id" => "contact_success", "std" => "Спасибо! Ваше сообщение успешно отправлено.", "type" => "text" );
Так вывожу количество записей, но с картой как-то не получается PHP: $of_options[] = array( "name" => __('Новые записи', 'iwebtheme'), "desc" => __('Укажите, сколько новых записей будут в сайтбаре', 'iwebtheme'), "id" => "posts_per_page", "type" => "text"); PHP: <?php if(iwebtheme_smof_data('have_posts') != 0) { ?> <?php { $posts_per_page = iwebtheme_smof_data('posts_per_page'); $caller_get_posts = '1'; $args=array( 'caller_get_posts' => $caller_get_posts, 'posts_per_page' => $posts_per_page); query_posts($args); } ?> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <div class="widget"><a href="<?php the_permalink(); ?>"> <h5><?php the_title();?> </h5> </a> <a href="<?php the_permalink(); ?>"><?php if ( has_post_thumbnail()) {the_post_thumbnail(array(),array("class"=>"alignleft post_thumbnail"));} ?></a> </div> <?php endwhile; else: ?> <?php endif; wp_reset_query(); ?> <?php } ?>