• This is within the loop.

    I’m trying to create an array by getting the number of tags from each post and counting them, then outputting the result (just to check that everything works)

    What am I doing wrong?

    $counttags=array();
    $posttags=array();
    
    $posttags = get_the_tags();
    $counttags[]= count($posttags);

    Then, outside the loop

    foreach( $counttags as $key => $value){
    	echo "$key, $value <br />";

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘A little code help’ is closed to new replies.