Dani Llewellyn
Forum Replies Created
-
Forum: Plugins
In reply to: [A-Z Listing] How to show specific category Woo-commerce ProductsHi,
To filter the list to a products in a specific category, you can use:
[a-z-listing display="posts" post-type="product" taxonomy="product_cat" terms="cat-slug"]You can find the appropriate slug to use in place of
cat-slugby navigating to/wp-admin/edit-tags.php?taxonomy=product_cat&post_type=product. You should see the slug for each category on the fourth column of the list of categories.Forum: Plugins
In reply to: [A-Z Listing] Letters in the back groundHi,
This is unexpected behaviour. Without seeing your site I can’t determine what might be happening. However, you can hide any part of the listing by either customising the template or using CSS with a
display: nonerule.To customise the template you should copy the file from
wp-content/plugins/a-z-listing/templates/a-z-listing.phpinto your theme alongside the theme’sstyle.cssfile. Once it is in your theme at the correct location the file will override the default listing template from the plugin.Forum: Plugins
In reply to: [A-Z Listing] Limit Display of Posts to CategoryHi,
To limit to a specific category (a term in the “categories” taxonomy) you can use a shortcode similar to:
[a-z-listing display="posts" post-type="post" taxonomy="category" terms="term-slug"]To find the
term-slugfor your term/category navigate to wp-admin -> posts -> Categories and then find the column labelledSlug(it’sslugin the English locale – if you are using a different language you might have a translated label. It is likely to be the third column in the list of terms/categories.) Once you’ve found theslugfor your term copy and paste it into the shortcode above.Forum: Plugins
In reply to: [A-Z Listing] Brand New Article/post or Recently posted postHi,
If you know the logic you want to define when there is a “new” entry you can add it into the template. Copy the file from
wp-content/plugins/a-z-listing/templates/a-z-listing.phpinto your theme alongside the theme’s style.css. You can customise the inner-most loop between line 53 and 61.I don’t know the exact PHP you will need for your scenario so I don’t feel confident giving any more advice than the above.
Forum: Plugins
In reply to: [A-Z Listing] parent category in brackets?Hi,
To omit the brackets when there are no parents, you can store the parents list or immediate parent in a variable and then test whether that variable has any content:
For the full list of parents:
<a href="<?php $a_z_query->the_permalink(); ?>"> <?php $a_z_query->the_title(); ?> </a> <?php $parents_list = get_term_parents_list( $a_z_query->get_the_item_id(), 'category', array( 'separator' => ', ' ) ); if ( ! empty( $parents_list ) ) : echo '(' . $parents_list . ')'; endif; ?>For the immediate parent only:
<a href="<?php $a_z_query->the_permalink(); ?>"> <?php $a_z_query->the_title(); ?> </a> <?php $all_parents = get_ancestors( $a_z_query->get_the_item_id(), 'category', 'taxonomy' ); $immediate_parent = array_shift( $all_parents ); if ( $immediate_parent ) : $immediate_parent_term = get_term( $immediate_parent, 'category' ); echo '(' . $immediate_parent_term->name . ')'; endif; ?>Forum: Plugins
In reply to: [A-Z Listing] parent category in brackets?You can customise the listing by copying the file from
wp-content/plugins/a-z-listing/templates/a-z-listing.phpinto your theme’s top-level folder alongsidestyle.css. You can then edit to suit your requirements. For this example you can try changing lines 57 to 59. Currently thes lines read as below:<a href="<?php $a_z_query->the_permalink(); ?>"> <?php $a_z_query->the_title(); ?> </a>You can include the parent terms with
get_term_parents_list():<a href="<?php $a_z_query->the_permalink(); ?>"> <?php $a_z_query->the_title(); ?> </a> (<?php echo get_term_parents_list( $a_z_query->get_the_item_id(), 'category', array( 'separator' => ', ' ) ); ?>)This will add the list of parent-terms as a comma-separated list of their names inside parentheses after the title of the current term. You might not want all the parents, so you could try to use
get_ancestors()directly to pull only the immediate parent:<a href="<?php $a_z_query->the_permalink(); ?>"> <?php $a_z_query->the_title(); ?> </a> (<?php $all_parents = get_ancestors( $a_z_query->get_the_item_id(), 'category', 'taxonomy' ); $immediate_parent = array_shift( $all_parents ); $immediate_parent_term = get_term( $immediate_parent, 'category' ); echo $immediate_parent_term->name; ?>)- This reply was modified 6 years, 4 months ago by Dani Llewellyn. Reason: add missing example code
Forum: Plugins
In reply to: [A-Z Listing] How to order Product_cat by slug and no by term?It’s not possible, currently, because I simply didn’t think about using the slug in that way :-). Sorry I can’t help you right now, but I will add this idea to my list of things to add in the next version once I’ve figured out performance issues.
Forum: Plugins
In reply to: [A-Z Listing] Again about UTF-8 and the display at #You could try replacing
substr()withmb_substr(), which requires that your PHP installation has the multibyte string (mbstring) extension enabled. You did indicate that it is enabled, but I just wanted to double check that..Forum: Plugins
In reply to: [A-Z Listing] A-Z Is Displayed — But Without LinksHi,
You appear to have some custom code for your non-dev site, because the plugin doesn’t do single letter pages out of the box. There is a “tabbed” display that loads all the posts into the page and then switches between each letter using javascript. This can be enabled with a line of code in your theme’s functions.php file, but your non-dev site isn’t doing this.
To replicate what your non-dev site is doing, you’ll need to find out what customisations were applied and copy those to your dev site.
Forum: Plugins
In reply to: [A-Z Listing] Again about UTF-8 and the display at #Both of those variants look like they should work. Is it possible that the added letters with diacritics are a different unicode code-point to the first letter of your pages? To be sure you could try copying the first letter of an affected page’s title from the edit-page screen and then paste that into the alphabet. If that still fails, I’m unsure what the problem is…
Forum: Plugins
In reply to: [A-Z Listing] Again about UTF-8 and the display at #Hi,
Please copy and paste the exact shortcode from your site. Make sure when you paste the shortcode into the reply box that you use the editor’s “code” feature to correctly mark your input as code. This will ensure that the editor does not mangle the characters you input, such as changing
"to“, which it has done in your original post.Forum: Plugins
In reply to: [A-Z Listing] A-Z Is Displayed — But Without LinksHi,
Are you sure your taxonomy has the slug of
tags? The default WordPress-provided tags taxonomy has a slug ofpost_tag.Forum: Plugins
In reply to: [A-Z Listing] Showing Thirstylink Affiliate links per categoryHi,
To display
thirstylinkposts that are categorised with the termclothingin the taxonomythirstylink-categoryyou would want the following shortcode:[a-z-listing display="posts" post-type="thirstylink" taxonomy="thirstylink-category" terms="clothing"]Forum: Plugins
In reply to: [A-Z Listing] How to order Product_cat by slug and no by term?Hi,
You cannot order by slug with this plugin out of the box.
However, I have a paid product called “Proper Nouns Extension” which handles most western names. I think that should achieve what you desire.
If you want to code support for yourself, then you will want to investigate the filter hook provided by the plugin called a_z_listing_item_index_letter.
Forum: Plugins
In reply to: [A-Z Listing] Filter by sub-categoryHi,
You can display the terms from a taxonomy who are each subordinates of a specified term with the following:
[a-z-listing display="terms" taxonomy="category" parent-term="category-to-show-children-of" get-all-children="yes"]You can set
get-all-childrentonoif your categories are directly children of the parent term. With it set toyesthen the listing will also include grand-children and their children ad infinitum.