shortcode for array?
-
Is there a way to create a shortcode to print the output of an array? like the following?
<?php
if ( function_exists( ‘ot_get_option’ ) ) {/* get the slider array */
$slides = ot_get_option( ‘test_testimonials_list’, array() );if ( ! empty( $slides ) ) {
echo ‘- ‘;
foreach( $slides as $slide ) {
echo ‘-
<img src=”‘ . $slide[‘image’] . ‘” alt=”‘ . $slide[‘title’] . ‘” />
<div class=”description”>’ . $slide[‘description’] . ‘</div>
‘;
}
echo ‘
‘;
}}
-
<img src=”‘ . $slide[‘image’] . ‘” alt=”‘ . $slide[‘title’] . ‘” />
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘shortcode for array?’ is closed to new replies.