You will need to customise the template that drives the output of the list to the page. To do this, copy the file from wp-content/plugins/a-z-listing/templates/a-z-listing.php
into your theme (i.e. to the folder wp-content/themes/your-theme-name
– it needs to be in the theme’s top-most folder, not a subfolder).
Once you have the template in your theme, you need to edit it to change the title output line. On line 53 is the following:
while ( $a_z_query->have_items() ) :
On a new line directly after that line you want to add:
$a_z_query->get_the_item_object( 'I understand the issues!' );
Note the text “I understand the issues!”: this must read exactly as is to indicate to the plugin that you accept that your listing may be slower or run out of memory and break due to using the get_the_item_object
function. This is because it will load the whole post from your database for every post in your listing, which is not done by default because of the speed and memory overhead in doing that.
Once you’ve called get_the_item_object()
you can then use the Advanced Custom Fields functions, which I believe for this case you want get_field
or get_the_field
or similar (I don’t know much about ACF so can’t advise on the correct function). You’ll want to add a print/echo of the custom field’s value on line 59 either inside the <a>
tags to make it part of the post’s link or after </a>
to make it unlinked text.
-
This reply was modified 4 years, 5 months ago by
Dani Llewellyn. Reason: Fix broken code formatting block