Dani Llewellyn
Forum Replies Created
-
Forum: Plugins
In reply to: [A-Z Listing] listing only show after clicking on letterThe plugin doesn’t provide any way to display only partial listings. You can potentially modify the template, or use javascript to hide the “other” letters. Perhaps some javascript like this will work, though it’s untested?
function hide_azlisting_sections() { if ( typeof window.location.hash !== "undefined" ) { const elements = document.getElementsByClassName( 'letter-section' ); for ( const element of elements ) { element.style.display = 'none'; } const active_letter = document.getElementById( window.location.hash.substring( 1 ) ); active_letter.style.display = 'initial'; } } if (document.readyState === "loading") { document.addEventListener( 'DOMContentLoaded', hide_azlisting_sections); } else { hide_azlisting_sections(); }Forum: Plugins
In reply to: [A-Z Listing] Displaying Custom Fields$a_z_query->the_item()doesn’t take arguments. That method is analogous to the WordPress inbuilt function calledthe_post()– it sets up the next iteration of “The Loop”. To get your post_meta you want something like:$a_z_query->the_item(); // revert this to how it was before your modifications $post = $a_z_query->get_the_item_object( 'I understand the issues!' ); ... echo get_post_meta( $post->ID, '_staff_member_email', true );I will add a new method on
$a_z_listingto pull the metadata directly in the next version, which won’t require loading the full post object thereby allowing you to remove the second line of the code above.The argument
I understand the issues!is required to be exactly that text. It signifies that you’re aware that large listings might run up against your server’s memory or time limits.Forum: Plugins
In reply to: [A-Z Listing] After WP Update AZ LIST BUGHi @coolerhase59,
From the image it looks like you have some CSS rules that are causing the listing elements to
float: left, which results in them stacking weirdly. This CSS will be either from your theme or another plugin. Try using thehealth-checkplugin to turn off other plugins and test against a “twenty*” theme such astwentyseventeen. Once you isolate where the CSS is coming from we can think about whether it is feasible to remove or override the rogue styles.Forum: Fixing WordPress
In reply to: WP 5.0 with no CSS in admin panelThe first thing to check is that all your caches have been cleared. This includes any server-side caches and performance plugins that might be using old CSS. To find out how to do this you will need to consult the instructions of any performance plugins or server software that you use. There might be a nice friendly “clear cache” button in your WordPress admin screen which would do the job from WordPress’ perspective. If you have server software such as Varnish which also caches things you will need to clear that, too.
If clearing the caches does not fix the problem then you might find that disabling plugins and reverting to a default theme fixes it. To do this without affecting your site visitors while you investigate, use the health check plugin to disable and enable specific plugins, which will only change things for you and not your visitors. If you can isolate a specific plugin or your theme as affecting the problem then we can use that information to try to diagnose what about that plugin or your theme is causing the issue.
Also worth checking once your caches are cleared is your web browser’s development console. Specifically the network tab of the console, which will highlight any failed network requests. Armed with the knowledge of which URLs of CSS files are failing to load, and what the error is when they fail, we can again start investigating more in-depth as to what is causing those specific URLs to fail to load.
Forum: Networking WordPress
In reply to: Multisite websites all reference the same absolute urlTo achieve this with WordPress Multisite you will need to map the domain for the individual sites. There is a guide explaining the process here, which I’ve copied some text from below: https://codex.wordpress.org/WordPress_Multisite_Domain_Mapping
In the network admin dashboard, click on Sites to show the listing of all the subsites, and then click on edit for the subsite you want to map to. In our example, this is subsite1.mynetwork.com.
In the Site Address (URL) field, enter the full URL to the domain name youβre mapping – https://mappeddomain.org – and click save.
Forum: Plugins
In reply to: [A-Z Listing] PHP ErrorThanks for the update. I see where the error is, and I’ll get the notice squashed in the next update.
Forum: Plugins
In reply to: [A-Z Listing] PHP ErrorWhile PHP
noticemessages are not necessarily indicative of a problem I’d still like to understand the reason for it. There should be a bit more to the message before the path toclass-a-z-listing-widget.php, which should tell us a bit more about why it is notifying us.Forum: Plugins
In reply to: [A-Z Listing] Adding Excerpt to listingyes, it only works since 2.0
Forum: Plugins
In reply to: [A-Z Listing] multi-column template not foundI’m adding a bit of margin to the bottom of each entry to provide vertical separation in the next version.
Forum: Plugins
In reply to: [A-Z Listing] Adding Excerpt to listingThe correct way to get more post information than the title and permalink is to use something similar to below in your
a-z-listing.phptemplate file (this is not a complete template):while ( $a_z_query->have_items() ) : $a_z_query->the_item(); $a_z_query->get_the_item_object( 'I understand the issues!' ); ?> <li> <h2><a href="<?php $a_z_query->the_permalink(); ?>"> <?php $a_z_query->the_title(); ?> </a></h2> <p><?php the_excerpt(); ?></p> </li> <?php endwhile; ?>Please be aware that on a large list of posts this will cause slowness or hit your memory limit. You need to pass the text
I understand the issues!to$a_z_listing->get_the_item_object()exactly as written above to confirm that you understand and accept this could be slow or break due to hitting a memory limit.Forum: Plugins
In reply to: [A-Z Listing] Links to A – Z Listing page not correctly output by widgetThe
a-z-listing.phptemplate is specific to my plugin, so renaming an existing page template won’t work correctly (or at all). If you need a custom page template and you need to customise the output from my plugin, then you will need two template files: one for your page to wrap around the plugin, and the other to customise the plugin output (it is this second one that is calleda-z-listing.php).After updating to 2.0.* you should re-save your widget settings to ensure that it is correctly referencing the page you want links to point at. I recommend selecting a random page from the widget configuration and then re-selecting the correct page before hitting save. This will ensure that any wonkiness should be eliminated. If it still doesn’t point at the page once you’ve done that I’ll need to take another look.
Forum: Plugins
In reply to: [A-Z Listing] A-Z directory not linking to anywhere on clickThe code I showed you for sorting by second-name should be placed into your theme’s
functions.phpfile so that it applies irrespective of the template in use. It sounds like you added the customisation into your copy of thea-z-listing.phptemplate, which then disappeared when you reverted to the inbuilt template.You can either copy the template from the plugin again and customise as you did before, using the template at
wp-content/plugins/a-z-listing/templates/a-z-listing.phpas your base, or you can add the custom code into your theme’sfunctions.php. I prefer adding it tofunctions.phprather than thea-z-listing.phptemplate.Forum: Plugins
In reply to: [A-Z Listing] change coloursThanks for picking this up, @yashitamittal11 π
That code should indeed change the letters to the colour #2e0819. Also, there are two other colours that might need adjusting: the border and the background. These can be added to the CSS that Yashitamittal11 posted (a complete example including that code is below):
.az-letters ul.az-links li, .a-z-listing-widget .az-letters ul.az-links li, .a-z-listing-widget.widget .az-letters ul.az-links li { background-color: #000000; /* example only */ border-color: #ff0000; /* another example only */ } .az-letters ul.az-links li a, .a-z-listing-widget .az-letters ul.az-links li a, .a-z-listing-widget.widget .az-letters ul.az-links li a { color: #2e0819; /* the colour you suggested */ }Feel free to play with the colours to adapt the style to your theme. Provided that your CSS is loaded in the HTML page below the CSS that the plugin ships then your code will override the plugin. π
Forum: Plugins
In reply to: [A-Z Listing] Display Pages, not PostsYou can review the plugin on the plugin page (https://wordpress.org/plugins/a-z-listing/#reviews)
Forum: Plugins
In reply to: [A-Z Listing] Documentation and Posts By CategoryI’ll add some clarification to explain the relationship between
taxonomyandcategoryin the readme.txt for the next version, which will also update the plugin entry on WordPress.org.