Support » Plugin: A-Z Listing » Including the_content in a-z list

  • Resolved visualnoise

    (@visualnoise)


    I’m trying to add the_content to the list

    I have tried both adding the following to a-z-listing.php:
    <?php $a_z_query->the_title(); ?> and <?php the_content(); ?>

    I’m adding the code below <?php $a_z_query->the_title(); ?> in ‘a-z-listing.php’

    • This topic was modified 2 months, 1 week ago by  visualnoise.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Any help would be greatly appreciated

    • This reply was modified 2 months, 1 week ago by  visualnoise.
    • This reply was modified 2 months, 1 week ago by  visualnoise.
    Plugin Author Daniel Llewellyn

    (@diddledan)

    You’re nearly there. The missing ingredient is that you don’t have the Post loaded when you call the_content() because I am keenly aware of the slowness and breakage it can cause on large listings. You can load the Post by adjusting the loop’s first few lines:

    Change:

    while ( $a_z_query->have_items() ) :
    	$a_z_query->the_item();

    To:

    while ( $a_z_query->have_items() ) :
    	$a_z_query->the_item();
    	$a_z_query->get_the_item_object( 'I understand the issues!' );

    Note that the argument passed to get_the_item_object must read exactly I understand the issues! to indicate to the plugin that you have understood that it might be slow, use a lot of resources, or break due to resource constraints (memory and time).

    Once you have called get_the_item_object you can use all the usual WordPress post-related functionality such as the_content().

    That did it. Thank you so much for your excellent plugin and support

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.