Forum Replies Created
Viewing 4 posts - 1 through 4 (of 4 total)
-
AuthorPosts
-
academyadmin
ParticipantThanks a lot, it works like a charm.
academyadmin
ParticipantThank you for your answer, it solved my problem.
BTW,
I got the code for using this type of metabox from your demo.php file here:
https://github.com/rilwis/meta-box/tree/master/demo
Maybe you should consider removing this setting from that file as well.
Thanks againacademyadmin
ParticipantHello,
thank you. I think I might still need your help in the thread:
this is the code (comments show the problem):<?php /* Template name: Categories */ ?> <?php get_header(); $categories = get_categories(); foreach ($categories as $cat) { echo $cat->name; //yields category name echo '<br><br>'; $images = get_term_meta( $cat->term_id, 'image_advanced', false ); //yields an array of strings, i.e. "4" echo '<br><br>'; if ( $images ) { foreach ( $images as $image ) { echo "<a href='{$image['full_url']}' rel='lightbox'><img src='{$image['url']}' width='{$image['width']}' height='{$image['height']}' alt='{$image['alt']}' /></a>"; /* this echo line yields: Warning: Illegal string offset 'full_url' in categories.php on line 18 Warning: Illegal string offset 'url' in categories.php on line 18 Warning: Illegal string offset 'width' in categories.php on line 18 Warning: Illegal string offset 'height' in categories.php on line 18 Warning: Illegal string offset 'alt' in categories.php on line 18 */ } } $images2 = rwmb_meta( 'image_advanced'); //this method returns an empty string, why? var_dump($images2); } // Restore original Post Data wp_reset_postdata(); ?> <?php get_sidebar(); ?> <?php get_footer(); ?>Please advise...
Thanks!academyadmin
ParticipantHi, thank you. but...
This is my code and this is my editor:
http://prntscr.com/ap4bzu
What am I missing? -
AuthorPosts
Viewing 4 posts - 1 through 4 (of 4 total)