Forum Replies Created
Viewing 4 posts - 1 through 4 (of 4 total)
-
AuthorPosts
-
agenciaball
ParticipantThanks, it's perfect!
agenciaball
Participantwhat's up guys. I have a little problem and I wonder if there is such possibility.
"I created" a plugin with metabox with flexslider, and I need to catch the alt or image titiulo to print in a caption on the image, note how I call the images of the field:
<div class="flex-container-eventos"> <div class="flexslider"> <ul class="slides"> <?php global $wpdb; $images = get_post_meta( get_the_ID(), 'capa_evento', false ); $images = implode( ',' , $images ); // Re-arrange images with 'menu_order' $images = $wpdb->get_col( " SELECT ID FROM {$wpdb->posts} WHERE post_type = 'attachment' AND ID in ({$images}) ORDER BY menu_order ASC " ); foreach ( $images as $att ) { // Get image's source based on size, can be 'thumbnail', 'medium', 'large', 'full' or registed post thumbnails sizes $src = wp_get_attachment_image_src($att, 'large'); $src = $src[0]; // Show image echo "<li><img src='{$src}' /></li>"; } ?> </ul> </div>agenciaball
ParticipantThis form does not work, did the following for her to work:
<?php $rows = rwmb_meta( 'my_text_list', array( 'type' => 'text_list' ) ); ?> <div class="indices"> <span>2015</span> <img src="<?php echo site_url().'/';?>files/img/servicos/base-tabela.png" alt="" /> <?php if ( ! empty( $rows ) ): foreach ( $rows as $row ){ ?> <ul> <li style="width:115px;"><?php echo $row[0] ?></li> <li style="width: 114px;"><?php echo $row[1] ?></li> <li style="width: 116px;"><?php echo $row[2] ?></li> <li style="width: 114px;"><?php echo $row[3] ?></li> <li style="width: 114px;"><?php echo $row[4] ?></li> <li style="width: 105px; border:none;"><?php echo $row[5] ?></li> </ul> <?php } endif; ?> <?php $rows = rwmb_meta( 'my_text_list_2', array( 'type' => 'text_list' ) ); ?> <ul class="indice-total"> <?php if ( ! empty( $rows ) ): foreach ( $rows as $row ){ ?> <li style="width:115px;">Acumulado</li> <li style="width: 114px;"><?php echo $row[0] ?></li> <li style="width: 116px;"><?php echo $row[1] ?></li> <li style="width: 114px;"><?php echo $row[2] ?></li> <li style="width: 114px;"><?php echo $row[3] ?></li> <li style="width: 105px; border:none;"><?php echo $row[4] ?></li> </ul> <?php } endif; ?>but from the second call where to find the term "Acumulado" it returns me error
Warning: Invalid argument supplied for foreach() in /home/storage/b/a3/bf/impacto/public_html/wp-content/themes/theme-impacto/single-indices.php on line 46
agenciaball
ParticipantI think there's something wrong in your code, I can not close the tag and make it work
-
AuthorPosts
Viewing 4 posts - 1 through 4 (of 4 total)