Dani Llewellyn
Forum Replies Created
-
Forum: Plugins
In reply to: [A-Z Listing] a-z listing by attributes woocommerce?@yasbenyas , try the following:
[a-z-listing display="terms" taxonomy="pa_brand"]I am not 100% certain this is correct. To determine the taxonomy name you need to navigate, within the WordPress admin, to the “All product attributes” listing page and find your attribute in the list. The name for the
taxonomypart of the shortcode is in the column labelledslug, which you need to prefix withpa_. To be certain of the taxonomy slug you can click the attribute name and then inspect your browser’s address bar. The address will have changed to something like https://example.com/wp-admin/edit-tags.php?taxonomy=pa_brand&post_type=product where the name for the shortcode is the text betweentaxonomy=and&post_type=product.- This reply was modified 6 years, 9 months ago by Dani Llewellyn. Reason: make url not a code block
Forum: Plugins
In reply to: [A-Z Listing] issue when using itHi,
I suspect you have a large number of posts returned by your chosen shortcode, which is leading to PHP hitting the memory limit defined by your server. There’s no way to prevent hitting the memory limit other than reducing the scope of your listing to return fewer posts. I plan to improve this in a future version but it needs the whole plugin to be redesigned to implement it, so it will take some time.
Forum: Plugins
In reply to: [A-Z Listing] How do you create a list for a certain categoryHi, @teacdan,
To show posts from the category whose slug is
red-teamyou would want the following:[a-z-listing display="posts" post-type="post" taxonomy="category" terms="red-team"]As an aside, the WordPress.org forum guidelines prefer you to start a new thread rather than replying to somebody else’s.
Forum: Plugins
In reply to: [A-Z Listing] Is it possible to display only post tags?Yes, you can show all the tags with:
[a-z-listing display="terms" taxonomy="post_tag"]Forum: Plugins
In reply to: [A-Z Listing] Last Letter is coming first.I can’t see why your page is displaying like that. Please try the shortcode on a different page and also follow the standard troubleshooting procedure using the health-check plugin to disable other plugins and try using a default theme (twenty-something) so that we can eliminate as many variables as possible. If you can identify a specific plugin or your theme as conflicting then we can work from there. Alternatively if it’s still broken when only my plugin is active then we can try to find out what about my plugin is broken 🙂
One thing that comes to mind is to check whether you have the PHP module called
mbstringenabled in your installation. I’ve added a small test to the health-check feature of WordPress that you can find at admin -> tools -> site health. On that page will be, somewhere, a bit of text that tells you whether the A-Z Listing plugin is able to findmbstringor not. (It might be behind a click to reveal feature labelled “passed tests”.)Forum: Plugins
In reply to: [A-Z Listing] Permalinks incorrectThis should be fixed as of 3.1.0.
Forum: Plugins
In reply to: [A-Z Listing] Hide Single Product CountOK, I think I see what’s happening here. You have multiple different listings that are all using the same template. The solution is to rename your
a-z-listing.phptemplate in your theme, the one you want to use for your terms listing, toa-z-listing-product_tag.php.The available template names you can use are:
- For
display=terms:
a-z-listing-[taxonomy_name].php– multiple taxonomies will be separated by underscores and listed in the order specified in the shortcode, e.g.:a-z-listing-taxonomy1_taxonomy2.phpa-z-listing.php
- For
display=posts:
a-z-listing-[section].phpwhere[section]is the top-most page in the hierarchy. This is only used whenpost-type=page.a-z-listing-[slug].phpwhere[slug]is the slug of the post containing the shortcode.a-z-listing.php
- This reply was modified 6 years, 9 months ago by Dani Llewellyn. Reason: fix lists nesting
Forum: Plugins
In reply to: [A-Z Listing] Persian Language supportYes, I think it does need to be the opposite-way in the shortcode, but I might be wrong as I am unable to read any right-to-left languages fluently enough to be able to make the correct choice. Try both to see which works best 🙂
Oh, I’m really sorry I dropped the ball on this. I completely overlooked that you had replied.
If you want a maximum of 2 columns, as an example, you can try overriding with the following: (enter the code into “custom CSS” box in your theme’s “customizer” area – navigate to wp-admin -> themes -> customize):
.letter-section ul.columns { column-gap: 0.6em; column-width: calc(50% - 0.6em); } .letter-section ul.columns.max-0-columns, .letter-section ul.columns.max-1-columns { column-count: 1; max-width: 50%; } .letter-section ul.columns.max-2-columns { column-count: 2; max-width: 100%; }Likewise, for a maximum of three columns you could try:
.letter-section ul.columns { column-gap: 0.6em; column-width: calc(33% - 0.6em); } .letter-section ul.columns.max-0-columns, .letter-section ul.columns.max-1-columns { column-count: 1; max-width: 33%; } .letter-section ul.columns.max-2-columns { column-count: 2; max-width: 66%; } .letter-section ul.columns.max-3-columns { column-count: 3; max-width: 100%; }- This reply was modified 6 years, 9 months ago by Dani Llewellyn. Reason: fix column-width in "3 columns" example
- This reply was modified 6 years, 9 months ago by Dani Llewellyn. Reason: revert last change - I think it works correctly as-is
Forum: Plugins
In reply to: [A-Z Listing] a-z listing by attributes woocommerce?Hi,
I’m glad you managed to find the solution. Sorry I didn’t get here in time to help you directly.
Forum: Plugins
In reply to: [A-Z Listing] How do I show posts from only 1 categoryHi,
I’m glad you found the solution. Sorry I didn’t manage to help promptly :-).
Forum: Plugins
In reply to: [A-Z Listing] How do you create a list for a certain categoryYou might find that your category slug is slightly different than you have specified.
Alternatively if you are expecting posts to be listed instead of page then you can add
post-type="post"to your shortcode to switch the output from displaying the post typepage. The plugin supports all post-types with this parameter, so if you are using a custom post type then you can also specify that here.A fully-fleshed-out shortcode with minimum areas for error is:
[a-z-listing display="posts" post-type="post" taxonomy="category" terms="travel-insurance"]The default behaviour when you don’t override any parameters will be the equivalent of if you had specified:
[a-z-listing display="posts" post-type="page"]Forum: Plugins
In reply to: [A-Z Listing] Hyperlink color per categoryHi,
There isn’t a direct ability to do this provided by the plugin. If I’m understanding correctly, you are showing posts in your list and want each post title to be coloured by the post’s associated terms.
You could try adding a template into your childtheme called
a-z-listing.phpcopied fromwp-content/plugins/a-z-listing/templates/a-z-listing.php. Within this file you’ll want to try usingget_the_item_object()to load the$postvariable inside thewhile( $a_z_query->have_items() )loop. Then you can usehas_term()from WordPress core to match against your list for colouring:... <?php while( $a_z_query->have_items() ) : $a_z_query->the_item(); $post = $a_z_query->get_the_item_object(); if ( has_term( 'red-term-slug', 'taxonomy-slug', $post ) { print '<li class="red">'; } elseif ( has_term( 'green-term-slug', 'taxonomy-slug', $post ) ) { print '<li class="green">'; } else { print '<li class="boring colourless">'; } ?> <a href="<?php $a_z_query->the_permalink(); ?>"> <?php $a_z_query->the_title(); ?> </a> </li> <?php endwhile; ?> ...- This reply was modified 6 years, 9 months ago by Dani Llewellyn. Reason: fix mistaken use of get_the_terms() - better to use has_term()
Forum: Plugins
In reply to: [A-Z Listing] Permalinks incorrectIt looks like I might have broken it in 3.0.0 🙂 I’ll try to get a fixed version out asap.
Forum: Plugins
In reply to: [A-Z Listing] Pagination LoadUnfortunately pagination is not a feature this plugin provides currently.
I don’t know how to provide such functionality in a useful way that is portable between sites. The plugin is architected in such a way that even with pagination it will likely not result in any performance improvements without a large redesign.