Dani Llewellyn
Forum Replies Created
-
Forum: Plugins
In reply to: [A-Z Listing] Delete some links and keep titleHi, @rayshman ,
Sorry I didn’t get to you before you found a fix yourself. I’m glad you found the right code to get it working – I would have advised a similar (probably identical) solution, so you’ve done well 🙂
Forum: Plugins
In reply to: [A-Z Listing] Woocommerce product tagsThis should show the product tags:
[a-z-listing display="terms" taxonomy="product_tag"]Forum: Plugins
In reply to: [A-Z Listing] Display custom fields after post name@garyupham I think I made a mistake in my above code. The line:
$a_z_query->get_the_item_object( 'I understand the issues!' );Needs to be directly after BOTH of these TWO lines (not the ONE I wrote originally):
while ( $a_z_query->have_items() ) : $a_z_query->the_item();Without the
$a_z_query->the_item();the “loop” isn’t forwarded onto the correct item so you’re always “one item behind”.Forum: Plugins
In reply to: [A-Z Listing] Displaying tags from a specific categoryHi,
Yes the short-code will display all tags by default. I’m not sure whether WordPress provides the facility to filter tags in the way you want, so I’ll need to have a think about how to do it entirely within the plugin. (The plugin reuses the inbuilt WordPress functionality as much as possible.)
Unfortunately that means it’s not possible right now, but I’ll see if I can get it working.
Forum: Plugins
In reply to: [A-Z Listing] Display tags from a specific category onlyHi,
I don’t understand what you mean by “tags of a particular category only”. Categories and Tags are separate things that are unrelated, unless you have a plugin that is somehow linking them.
Forum: Plugins
In reply to: [A-Z Listing] Letters not showing horizontallyAs it shows correctly when you are logged-in you need to find out what is different between the logged-in and logged-out page content to narrow down why it’s failing.
Try disabling all other plugins temporarily and switch to a default twenty-something theme. This will help us to identify if another plugin or your theme is conflicting.
Forum: Plugins
In reply to: [A-Z Listing] Displaying tags from a specific categoryHi,
To display the tags you want a short-code similar to:
[a-z-listing display="terms" taxonomy="post_tag"]Forum: Plugins
In reply to: [A-Z Listing] Style IssueHi,
I’m unsure what you mean by “there being no space left between the lines of the separate listings/rows”. Could you expand a bit more to help me understand your issue better?
Forum: Plugins
In reply to: [A-Z Listing] Letters not showing horizontallyYou are using autoptimize to bundle your stylesheets and javascript. Try clearing the cache that it generates.
Forum: Plugins
In reply to: [A-Z Listing] Fatal error: Allowed memory size exhaustedHi,
Does the listing work with
WP_DEBUGturned off, or are you usingWP_DEBUGto determine why the plugin isn’t working? The nature of the plugin is that it needs to load all the posts into memory to generate the listing. Unfortunately that means it needs a lot of memory on larger listings. I’m trying to design a better method of loading that reduces the memory load while still being backwards-compatible.Forum: Plugins
In reply to: [A-Z Listing] Count post in category and not count in postHi,
You may create a template specific to your taxonomy (in this example
category) by naming ita-z-listing-category.php. This allows you to separate the code for the taxonomy vs the posts listing.Forum: Plugins
In reply to: [A-Z Listing] Filter by tagsHi,
Apologies for the delay in replying. Are you asking about a function to use in a template that will do the same as the short-code? If so, then yes, you can do this easily with:
<?php do_shortcode( '[a-z-listing]' ); ?>You will want to add the complete short-code that you’d use on a post content inside the quotes. This is how the widget does it, which you can see on line 434 of
wp-content/plugins/a-z-listing/widgets/class-a-z-listing-widget.php.The problem with this approach is the plugin cannot detect that the short-code is being used and so will not apply the default styling. You can fix that deficiency by adding the following to your theme’s
functions.phpfile:<?php add_action( 'init', 'a_z_listing_force_enable_styles' );Forum: Plugins
In reply to: [A-Z Listing] Show taxonomy, but link to postHi,
At the moment the best way to achieve this is to copy the template from the plugin at
wp-content/plugins/a-z-listing/templates/a-z-listing.phpinto your theme or child theme atwp-content/themes/<your-theme>/a-z-listing.phpand customise line 57 to output the correct link instead of$a_z_query->the_permalink().I’m unsure the exact PHP you need to add, however.
Forum: Plugins
In reply to: [A-Z Listing] List style typeOops, the leading
.shouldn’t be there:div.letter-section > ul.az-columns { margin: initial; } div.letter-section > ul.az-columns > li { display: initial; list-style: initial; padding: initial; }Forum: Plugins
In reply to: [A-Z Listing] Display custom fields after post nameYou 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.phpinto your theme (i.e. to the folderwp-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_objectfunction. 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 wantget_fieldorget_the_fieldor 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 5 years, 6 months ago by Dani Llewellyn. Reason: Fix broken code formatting block