Support » Fixing WordPress » Adding Custom Codes Values in the Sidebar with their counts

  • Resolved Maz

    (@mouazzz)


    Hello Folks,

    I sincerely appreciate if anyone could help.

    I have custom codes per post, similar to Thumbnail one. I just want to present in the sidebar a list of custom codes and their counts, something similar to the list of categories and their count.

    example:
    (news agency name)(count of how many times it’s used as custom code in posts)
    BBC (3)
    NY (65)
    FoxNews (11)

    etc.

    this function listed down the custom key values per post, but could not figure out how to count all values for all posts in the site.

    <?php

    $mykey_values = get_post_custom_values(‘NewsAgency’);
    foreach ( $mykey_values as $key => $value ) {
    echo ” $value
    “;
    }

    ?>

    Thanks indeed.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Adding Custom Codes Values in the Sidebar with their counts’ is closed to new replies.