Support Forum ยป User Profile

Forum Replies Created

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • in reply to: Can't get terms' meta values in frontend #2698
    academyadminacademyadmin
    Participant

    Thanks a lot, it works like a charm.

    in reply to: WYSIWYG rich-text has no Heading support #2694
    academyadminacademyadmin
    Participant

    Thank 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 again

    in reply to: Can't get terms' meta values in frontend #2693
    academyadminacademyadmin
    Participant

    Hello,
    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!

    in reply to: WYSIWYG rich-text has no Heading support #2687
    academyadminacademyadmin
    Participant

    Hi, thank you. but...
    This is my code and this is my editor:
    http://prntscr.com/ap4bzu
    What am I missing?

Viewing 4 posts - 1 through 4 (of 4 total)