Dani Llewellyn
Forum Replies Created
-
Forum: Plugins
In reply to: [A-Z Listing] Change “0-9” heading to “#”If any of your posts begin with a symbol (i.e. not A-Z nor 0-9) then a new letter will show labelled
#, which would conflict with your numbers letter. However, you can do this by hooking thethe-a-z-letter-titlefilter. You could add something like this to your theme’s (or child theme’s)functions.phpfile:add_filter( 'the-a-z-letter-title', 'replace_a_z_numbers_title' ); function replace_a_z_numbers_title( $letter ) { // The numbers letter is '0' when the numbers are grouped into one letter. if ( '0' === $letter ) { return '#'; } // We're not working on the numbers group so return the original letter unchanged return $letter; }Forum: Plugins
In reply to: [A-Z Listing] No results displaying.Yes, I suspect this is a server resources issue where the server is running out of memory while building the list. I still haven’t worked-out a way to mitigate this problem, but I have been working on it. For now, the only way forward (besides getting a different or bigger server, which is not acceptable :-)) is to try to limit your listing’s size via adding further terms to the posts and filtering to a smaller subset (again this is really not desirable, but it’s all I’ve got for now :-().
Forum: Plugins
In reply to: [A-Z Listing] Second level of filter possible ?Hi,
If your “book” posts are assigned a the “biography” category then you can restrict the list by adding
taxonomy="category" terms="biography"into your shortcode. For example, it might leave you with a shortcode like this:[a-z-listing display="posts" post-type="book" taxonomy="category" terms="biography"]The
termsattribute takes one or more term “slugs”, which you can find by navigating in wp-admin to the categories list where you should see a table with a “slug” column with the slugs of each category in your database.Forum: Plugins
In reply to: [A-Z Listing] shortcode does not workIt looks like you don’t have WooCommerce enabled, so the
product_cattaxonomy is not available. You likely meant to use a different taxonomy name.Forum: Plugins
In reply to: [A-Z Listing] remove az letter andYes, the short titles is because the plugin is making room for potentially adding more columns. You can avoid this by customising a copy of
a-z-listing.example.phpfrom the plugin’stemplatesfolder, which does not have any columnar code.Alternatively you can override the CSS with this to remove all columns:
.letter-section ul.columns { column-width: unset; } .letter-section ul.columns.max-0-columns, .letter-section ul.columns.max-1-columns, .letter-section ul.columns.max-2-columns, .letter-section ul.columns.max-3-columns, .letter-section ul.columns.max-4-columns, .letter-section ul.columns.max-5-columns, .letter-section ul.columns.max-6-columns, .letter-section ul.columns.max-7-columns, .letter-section ul.columns.max-8-columns, .letter-section ul.columns.max-9-columns, .letter-section ul.columns.max-10-columns, .letter-section ul.columns.max-11-columns, .letter-section ul.columns.max-12-columns, .letter-section ul.columns.max-13-columns, .letter-section ul.columns.max-14-columns, .letter-section ul.columns.max-15-columns { column-count: unset; max-width: unset; }You can add this either via your theme’s CSS or by using the Theme Customizer’s “Custom CSS” option.
Forum: Plugins
In reply to: [A-Z Listing] How to use tabs version and default wersionThe filter will try to detect the usage of the short code in the loaded page. When you call
do_shortcodedirectly you are bypassing that detection. For those instances, you can, instead of callingadd_filter( 'a-z-listing-tabify', '__return_true' );replace it with:add_action( 'init', 'a_z_listing_force_enqueue_tabs' );To target one specific listing to be tabbed is more difficult. You need to call the
add_actionoradd_filterappropriately depending upon the page being created. One way to do this is to ensure you’re using a unique template in your theme for each of the pages and before the call towp_head();run theadd_actionoradd_filterin the template that is applied to the specific page you want to be tabbed.Another method is to use the global
$wp_queryobject to determine the page being loaded and run theadd_actionoradd_filterwhen you’re sure you’re loading the relevant page to be tabbed. You would want to perform this in an action that occurs before the template is loaded, for examplepre_get_posts.Forum: Plugins
In reply to: [A-Z Listing] shortcode does not workHi,
WooCommerce product categories are in the taxonomy called
product_cat, so you likely want a short code like this:[a-z-listing display="terms" taxonomy="product_cat" parent-term="26"]You might also want, depending on whether your categories are multiple-levels or not, to also add
get-all-children="yes", which will show all descendants (children and their children etc) rather than just immediate children.Forum: Plugins
In reply to: [A-Z Listing] remove az letter andHmm, I’m not sure why the updated name on the template isn’t being recognised. It should match. :'(
Forum: Plugins
In reply to: [A-Z Listing] remove az letter andDon’t forget to clear any server-side caching mechanisms when you make changes. I suspect your litespeed server is responding with an old copy of the page, tho I’m not certain.
Forum: Plugins
In reply to: [A-Z Listing] remove az letter andYou should be able to use the “slug” of the post that you have your short-code on to target the custom template. To do this, you will rename the
a-z-listing.phpfile in your theme that you’ve been customising to something that follows the format:a-z-listing-$slug.phpwhere you insert the slug of your post where$slugis. The post slug is found by navigating to the block editor screen for your post and finding theURL Slugfield in thePermalinkbox on the right-hand side of the edit screen (this post shows a few screenshots to help find it: https://wptavern.com/wordpress-5-0-beta-5-released-adds-permalink-editing-to-the-document-sidebar).Forum: Plugins
In reply to: [A-Z Listing] remove az letter andYes, this is possible by copying the default template from the plugin and removing the extra bits you don’t need. The template can be found at
wp-content/plugins/a-z-listing/templates/a-z-listing.phpand should be copied to your theme or child-theme’s top-level folder, e.g.wp-content/themes/$themename/a-z-listing.php.You will want to remove lines 24 thru 28 (the
divwith idletters), lines 45 thru 49 (thedivwith classletter-title), and lines 63 thru 67 (thedivwith classback-to-top).It may be preferable to copy and customise the other file in the
templatesfolder of the plugin calleda-z-listing.example.php, which you would need to copy to your theme and rename it toa-z-listing.php. This example template does not include the columns functionality, so you might prefer it to the default template because the columns of the default template will be applied to each letter separately.Forum: Plugins
In reply to: [A-Z Listing] Not workingThe letters/alphabet link to places in the
divwith ID ofaz-slider. You’ve hidden this with CSS which means the links will have nowhere to navigate the page to.Forum: Plugins
In reply to: [A-Z Listing] Hide when no post in categoryHi,
The first problem is fixable by adding
hide-empty-terms="true"to your shortcode:[a-z-listing display="terms" taxonomy="category" hide-empty-terms="true"]Unfortunately I don’t have a solution to your second question :-(.
Forum: Plugins
In reply to: [A-Z Listing] How to make work two shortcodes working in the same page?Hi,
Sorry I didn’t get to your message sooner… Yes, multiple short-codes on the same page are problematic. I intend to improve this in the future, but for now you need to make modifications to the template.
You can copy the template into your theme so that when the plugin updates in the future your changes aren’t overwritten. The template the plugin uses by default is at
/wp-content/plugins/a-z-listing/templates/a-z-listing.php, which you should copy to your theme for modifications at/wp-content/themes/$your_theme/a-z-listing.php.Forum: Installing WordPress
In reply to: Error stablishing a database connectionWhat permissions did you give to the userid for your database? I believe the minimum required to run the install are select, insert, update, delete, and create. An example
GRANTstatement is below:GRANT select, insert, update, delete, create ON dbname.* TO userid_here@localhost