Support » Plugin: A-Z Listing » Show Custom Taxonomy Fields

  • visaoativa

    (@visaoativa)


    Hi, I created a Product page with post type and within that page I added Product Type and Category, both using taxonomy.

    But I can’t display either his Product Type or his Category.

    Example:

    THE
    Title: Aldijet
    Product type:
    Category:

    <div>Title: <?php $a_z_query->the_title(); ?></div>

    Would you help me ?

Viewing 2 replies - 1 through 2 (of 2 total)
  • <?php $a_z_query = get_the_category(); echo $a_z_query[0]->cat_name; ?> (dont work)

    Plugin Author Daniel Llewellyn

    (@diddledan)

    Hi,

    Try adding $a_z_query->get_the_item_object() as below. This will force the plugin to load the full post object from the database. By default a very minimal amount of information is pulled to improve speed and memory usage:

    <?php
    
    // snipped for brevity
    
    while ( $a_z_query->have_letters() ) :
        $a_z_query->the_letter();
    
        // snipped for brevity
    
        while ( $a_z_query->have_items() ) :
            $a_z_query->the_item();
            $post = $a_z_query->get_the_item_object();
    
            echo get_the_category_list( ', ', '', $post->ID );
    
            // snipped for brevity
    
        endwhile;
    
        // snipped for brevity
    
    endwhile;
    
    // snipped for brevity
    
Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.