Forum Replies Created

Viewing 15 replies - 676 through 690 (of 927 total)
  • Plugin Author Dani Llewellyn

    (@diddledani)

    I’ve released a minor update that should allow you to hide the “empty” letters. Version 1.9.1 includes two classes on the letters, one for when there are associated posts, and the other for when there aren’t:

    has-posts and no-posts. You should now be able to use the following CSS snippet to hide the empty ones:

    .az-letters ul.az-links li.no-posts {
        display: none;
    }
    
    Plugin Author Dani Llewellyn

    (@diddledani)

    I do not understand the question, sorry 🙁

    Could you try to expand your question with more details so that I may be better able to help you? Also, sharing your website address might help me to better understand how the homepage works.

    Plugin Author Dani Llewellyn

    (@diddledani)

    Any characters that are not included in the alphabet used for categorisation will be added to the group entitled with #. Or, at least, that is how it is supposed to work. If it doesn’t then I will look further into why, but as far as I can see it works as designed.

    I have checked your site and there are no posts beginning with a symbol in your A-Z page. Are you stating that there are posts which are being omitted when they begin with a symbol and thus aren’t visible in that listing? Can you confirm that you definitely have posts beginning with a symbol that isn’t in the alphabet used for sorting and categorisation?

    The default alphabet, unless overridden by translations from glotpress or by yourself, is:

    AÁÀÄÂaáàäâ,Bb,Cc,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
    

    You have added into this alphabet, via usage of the shortcode numbers="before" attribute, the numerals 0 thru 9 at the beginning of the alphabet grouped into a single group. The symbols group will always be last and will be omitted entirely if there are no titles beginning with a symbol in the listing.

    Plugin Author Dani Llewellyn

    (@diddledani)

    How does the importing of the global $post cause error?
    What is the behaviour that you perceive as incorrect?
    What does the “subtitles” plugin do?
    Where can I get the “subtitles” plugin from to test?
    Have you customised the default template used by the A-Z Listing plugin in any way?

    Removing the import of the global $post will almost certainly lead to problems. It is there for the very precise reason that the plugin is designed to overwrite that variable and then restore it once complete.

    Plugin Author Dani Llewellyn

    (@diddledani)

    It doesn’t look like you have the A-Z listing output on that page at all? It looks like WordPress is displaying that URL as an archive listing, not a single page or post. You likely want to customize your archive-a-o.php template to add an A-Z Listing onto that URL.

    WordPress has issues with pages using the same URL as in-built archive listings, so I expect difficulties if you try to override the default mechanisms. It will require some PHP coding but even then it is likely to end with strange behaviour. The simplest fix to use a post-type archive URL is to edit the archive’s template in your theme to change the output from the archive query to an A-Z Listing call.

    Plugin Author Dani Llewellyn

    (@diddledani)

    I’m glad you managed to get it sorted with CSS.

    This appears to be a common ask, so I’ll make a note to allow disabling it in the next release.

    Plugin Author Dani Llewellyn

    (@diddledani)

    The first problem sounds like a bug that will need a new release. If you’re comfortable with theme building and the WP_Query mechanism you can work-around it by calling the listing directly instead of using the shortcode, but that does require quite a bit of knowledge in how WordPress queries are constructed to format the correct taxonomy query.

    Back to top links can be removed in two ways:

    1. copy the template from
      wp-content/plugins/a-z-listing/templates/a-z-listing.php
      

      into your theme’s folder and editing it to remove the line

      <div class="back-to-top"><a href="#letters">Back to top</a></div>
      

      or

    2. use a custom css addition, such as via the theme customizer’s custom css feature, which includes the rule:
      #az-slider div.letter-section div.back-to-top { display: none; }
      
    Plugin Author Dani Llewellyn

    (@diddledani)

    I’m glad you got it working 🙂

    I’ve marked this topic as resolved, but please come back if you encounter any more problems.

    Plugin Author Dani Llewellyn

    (@diddledani)

    You’re right, the multi-column is broken. I’ve worked-up a fix for it which will land in version 1.9.0. If you’ve already copied the template into your theme you will want to check with the new version to either merge with your copy if you’ve made customisations or overwrite the copy in your theme if you haven’t.

    Plugin Author Dani Llewellyn

    (@diddledani)

    This is possible in one of two ways:

    1. If you want the full listing on every lawyer page, then you will need to edit or create an appropriate theme file with a call to the_a_z_listing() or run the shortcode. The proper encantation might be:
      <?php echo do_shortcode('[a-z-listing post-type="post" taxonomy="category" terms="lawyer"]'); ?>
      
    2. If you only want the letters, which link to the listing page, then you could try using the widget in conjunction with another plugin, like “widget visibility” from the JetPack plugin by Automattic, to limit the pages the widget is shown upon. However, the configuration for the widget is currently very limited when compared to the full functionality the plugin is capable of elsewhere.
    Forum: Plugins
    In reply to: [A-Z Listing] Back to top
    Plugin Author Dani Llewellyn

    (@diddledani)

    I’m adding a back-to-top feature in the upcoming 1.9.0 which will change the templates in the plugin. If you’ve modified the template or copied it into your theme then either:

    • check the changes when the release lands to merge with your copy,
    • replace with the newer template, or
    • remove the template from your theme to revert to the stock one from the plugin.
    Plugin Author Dani Llewellyn

    (@diddledani)

    Can you elaborate a bit more on what the problem is, as the page you linked shows the listing output as far as I can see? If you could let me know how the plugin is misbehaving I might be better able to help. I do see there’s a post-type called “team”, which I believe you’re trying to display in the listing but not all the posts are included in the output of the plugin; is this the issue you’re talking of?

    Could you also paste the short-code as it is saved in your page, please? This might help me to be able to advise better if I can see how you’re using the code.

    Plugin Author Dani Llewellyn

    (@diddledani)

    Hi,

    The following short code should work, I think:

    [a-z-listing post-type="post" taxonomy="category" terms="obituary"]
    

    post-type defaults to page so you need to override it to post so that the plugin prints blog posts. I see that the readme.txt doesn’t explicitly state this in the example for filtering by category, so that needs fixing; note-to-self :-).

    Plugin Author Dani Llewellyn

    (@diddledani)

    My plugin has no mention of entry-title-primary so those tags aren’t coming from here 🙂 Try disabling other plugins and switching to a default theme (named twentysomething e.g. twentyseventeen) to see if the problem persists. If the problem goes away then try enabling everything you disabled one-at-a-time until the problem reoccurs; the last thing you enabled is the likely incompatibility. Once we find that we can look further to try to diagnose why the two are interacting badly.

    Plugin Author Dani Llewellyn

    (@diddledani)

    Hi,

    You can achieve this with a bit of custom code to support your use. You will need to add something similar to the following into your theme of child-theme’s functions.php (I hope I’ve written it correctly, but do test it first if you can, because I’m not certain it’s perfect):

    function ignore_articles_in_az_index( $indices, $item ) {
        // all the articles we want to strip
        $articles = array( 'a', 'an', 'the' );
    
        // save the title for quicker access
        $title = $item->post_title;
    
        foreach( $article in $articles ) {
            // get the length of the 'article'
            $len =  mb_strlen( $article );
    
            //check whether this 'article' starts the title (+1 added to length to 
            //include space to ensure we don't match partial words like 'another'
            //would match 'an', but won't match 'an ')
            if ( mb_substr( $title, 0, $len + 1, 'UTF-8' ) === $article . ' ' ) {
                //get the true first letter to index by after the 'article'
                $index = mb_substr( $title, $len, $len + 1 );
                //return the new index - this is needlessly complex, I'll fix it one day
                return array(
                    $index => array( array(
                        'title' => $title,
                        'item' => $item,
                    ) ),
                );
            }
        }
    
        //if we get here then we didn't change the index letter so we return the
        //unmodified original to not break anything
        return $indices;
    }
    
    //hook the correct plugin-provided filter
    add_filter( 'a_z_listing_item_indices', 'ignore_articles_in_az_index', 10, 2 );

    References:
    https://developer.wordpress.org/reference/functions/add_filter/
    https://secure.php.net/manual/en/function.mb-strlen.php
    https://secure.php.net/manual/en/function.mb-substr.php
    https://a-z-listing.com/reference/hooks/a_z_listing_item_indices/

Viewing 15 replies - 676 through 690 (of 927 total)