Dani Llewellyn
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Login 404It looks like you might be running a plugin or theme feature that intercepts logins and redirects to a page on your site – this is not default WordPress behaviour. The configuration is seemingly set to a page that does not exist in your installation (with ID of 3911).
Try turning off plugins and using a default twenty* theme to see if you can isolate which plugin is causing the redirect or whether it is your theme. You could also look into your settings pages to see if you can identify a configuration option to set the destination of logins and logouts.
Forum: Fixing WordPress
In reply to: How to fix 503 Error for WordPress Theme503 errors should leave logging traces in your server’s error_log file. You can likely find this file in your hosting control panel. The last few lines should contain messages indicating what the problem is, which we can use to try to determine possible fixes.
Forum: Plugins
In reply to: [A-Z Listing] Filter by Category does not workHi,
You can find the slug of your category by going to wp-admin -> projects -> categories. The list on the right will show you the slug in the column labelled “Slug”. I’m surmising that you speak the Switzerland dialect of German based on your post and WordPress.org profile, in which case I believe the column will be translated to “Titelform” in your locale. Please forgive me if I am mistaken 🙂
If your taxonomy is not called “projects” then you can find the slug for it by going to wp-admin -> projects -> [name here] and finding the address in your browser of the form https://example.com/wp-admin/edit-tags.php?taxonomy=category. Here the taxonomy is called
category, which is what you will enter into the short-code.- This reply was modified 6 years, 5 months ago by Dani Llewellyn. Reason: highlight the taxonomy slug
Forum: Plugins
In reply to: [A-Z Listing] Fatal error: Allowed memory size of 536870912 bytes exhausted…Hi,
I suspect that your taxonomy and terms aren’t named the same, so you likely want to adjust your taxonomy name to something like
categoryto reference a term calledpromotionin the taxonomy calledcategory; the wp-admin area calls thecategorytaxonomy “Categories”. See the taxonomies documentation for information on the difference between a taxonomy and terms within a taxonomy.Specifying
termsandparent-termis likely to cause the plugin to get into an unusual state; it might work correctly, but there are no guarantees. Ideally you would use one or the other, not both.The issue with memory limits being hit is known and I’m working through various experiments to try to reduce the memory requirements of the plugin. You might find that it is intermittent, or that some settings work while others hit the memory limit. The issue stems from the requirement to load all the relevant posts/terms into memory to sort them by their title.
Forum: Plugins
In reply to: [A-Z Listing] I’m getting error after upgrade the pluginHi,
It appears that somehow the plugin has an empty alphabet. This can happen if you don’t have the PHP extension called
mbstringenabled on your server. If enablingmbstringdoes not fix it, or your server already hasmbstringenabled, you can try to force the plugin to recreate the alphabet by adding onto your shortcode the following (this is the default alphabet before localisation/translation from glotpress is applied so will reset the plugin to a latin alphabet – this might be undesirable if you’re using, for example, a cyrillic or hebrew or other non-latin alphabet):[a-z-listing ... alphabet="AÁÀÄÂaáàäâ,Bb,CÇcç,Dd,EÉÈËÊeéèëê,Ff,Gg,Hh,IÍÌÏÎiíìïî,Jj,Kk,Ll,Mm,Nn,OÓÒÖÔoóòöô,Pp,Qq,Rr,Ssß,Tt,UÚÙÜÛuúùüû,Vv,Ww,Xx,Yy,Zz"]Forum: Plugins
In reply to: [A-Z Listing] The letters of the alphabet are replaced by #Hi,
You can force a Latin alphabet instead of the Russian alphabet by adding to your shortcode the following:
alphabet="AÁÀÄÂaáàäâ,Bb,CÇcç,Dd,EÉÈËÊeéèëê,Ff,Gg,Hh,IÍÌÏÎiíìïî,Jj,Kk,Ll,Mm,Nn,OÓÒÖÔoóòöô,Pp,Qq,Rr,Ssß,Tt,UÚÙÜÛuúùüû,Vv,Ww,Xx,Yy,Zz"Forum: Plugins
In reply to: [A-Z Listing] Exclude non alphanumeric charactersHi,
Each item in the list is passed through a filter called
a_z_listing_item_index_letterwhich allows you to change the detected index letter. For this example you can do something like below:<?php add_filter( 'a_z_listing_item_index_letter', 'ignore_quotes_in_a_z' 10, 3 ); function ignore_quotes_in_a_z( $indices, $item, $item_type ) { $title = get_the_title( $item ); for ( $i = 0; $i < strlen( $title ); $i++ ) { $letter = substr( $title, $i, 1 ); switch ( $letter ) { // add all the characters you want to ignore here - switch falls-through // so if any one of these are matched we hit the break; and continue // to the next letter in the title. case '"': case '\'': case '(': case '[': break; // if none of the above match then we use the character as the index default: return [ $letter ]; } } // This is here to handle the case of the above code not giving an index return $indices; }Forum: Plugins
In reply to: [A-Z Listing] Only Filtering Throuhg ONE Category From WooCommerceHi,
For your first question you want
display="posts"instead of what you currently have (display="terms").The second question will require some custom theming depending on your site’s requirements. There is a template in the plugin which you can copy into your theme and edit to suit. This template is at
wp-content/plugins/a-z-listing/templates/a-z-listing.php.One caveat is that the post (product) is not loaded fully by the plugin in an attempt to improve performance and reduce memory load. However, this means you are likely going to miss some WordPress functionality such as excerpts until you change this:
while ( $a_z_query->have_items() ) : $a_z_query->the_item();to this:
while ( $a_z_query->have_items() ) : $a_z_query->the_item(); $a_z_query->get_the_item_object( 'I understand the issues!' );If you have lots of products in your listing this could potentially cause loading the page to hit your server’s time or memory limits.
Forum: Plugins
In reply to: [A-Z Listing] Display is jumbledThis is due to your theme setting the CSS for
.columnstofloat: left;. You can rectify by using the customiser’s additional css feature via your admin screen to add the following rule:.letter-section ul.columns { float: initial; }To access the custom css feature navigate to wp-admin, then appearance, then customize and on the customiser page go to “additional css”. I will add this rule in a future update of the plugin to fix this particular incompatibility more long-term.
Forum: Plugins
In reply to: [A-Z Listing] Display only #You might be missing the PHP extension on your server called
mbstring, which could account for the problem. Otherwise I’m unsure what the problem might be…The javascript is shipped as part of the plugin. The
add_filterline above should be all that is needed to ensure that the javascript is loaded.Forum: Plugins
In reply to: [A-Z Listing] Question about tags.Hi,
This isn’t possible right now. I’m not sure at the moment how to enable such a feature.
Forum: Plugins
In reply to: [A-Z Listing] What’s the short code for Products in WooCommerce?Hi,
The following should get you a list of WooCommerce products:
[a-z-listing display="posts" post-type="product"]Forum: Plugins
In reply to: [A-Z Listing] Display Category in brackets after Post nameHi,
You will need to copy the template file from
wp-content/plugins/a-z-listing/templates/a-z-listing.phpinto your theme at the root folder e.g.wp-content/themes/your-theme/a-z-listing.php. Once you’ve copied the template you can customise to suit. I haven’t checked whether you need the WP_Post object loaded, but if it isn’t needed I believe the following modification to lines 57-59 will do the job:<a href="<?php $a_z_query->the_permalink(); ?>"> <?php $a_z_query->the_title(); ?> </a> <?php the_terms( $a_z_query->get_the_item_id(), 'year', '(', ', ', ')' ); ?>This will print the terms linked to their own page (according to the ‘the_terms’ documentation). An alternative, if you want the terms linked to the post is to use
get_the_terms, which returns an array that you’ll need to iterate over to build the list. You can then place the output either inside the<a>to link the whole list to the post, or after the<a>to leave the list unlinked:<a href="<?php $a_z_query->the_permalink(); ?>"> <?php $a_z_query->the_title(); ?> </a> <?php $terms = get_the_terms( $a_z_query->get_the_item_id(), 'year', '(', ', ', ')' ); if ( ! empty( $terms ) ) { print '('; $first_iteration = true; foreach ( $terms as $term ) { if ( $first_iteration ) { $first_iteration = false; } else { print ', '; } print $term->term_name; } print ')'; } ?>Forum: Plugins
In reply to: [A-Z Listing] Title of the postsHi,
You can customise the title before indexing by adding a filter function hooked onto
a_z_listing_pre_index_item_title. The function will need to return the new title for each post. It is called once per post with the title, the corresponding WP_Post object, and the type of listing (termsorpost. In this case it will bepost).