Forum Replies Created

Viewing 15 replies - 541 through 555 (of 927 total)
  • Plugin Author Dani Llewellyn

    (@diddledani)

    Hi @girdy74, it looks like the path to the javascript is wonky. I set the path to include /js/ when it should be /scripts/. The fix is coming in 2.1.0.

    Plugin Author Dani Llewellyn

    (@diddledani)

    While completely hiding the posts isn’t an out-of-the-box feature, you can use the “tab”-like functionality by adding a small bit of code into your theme’s functions.php:

    <?php
    add_filter( 'a_z_listing_tabify', '__return_true' );

    If the file already exists you won’t need to add the <?php because it will already be in the file. You need to make sure that the add_filter line appears directly after the <?php line at or near the top of the file.

    Plugin Author Dani Llewellyn

    (@diddledani)

    awesome! I’m really glad it’s working for you now 🙂

    (I’ll mark this thread as resolved, but come back if something else goes awry or you would like me to help any further)

    Plugin Author Dani Llewellyn

    (@diddledani)

    Would it be possible for you to take a screen shot of the widget configuration form for me please? I’m thinking that the “Site map A-Z page” field is confused somewhere.

    The way it works is you should type some or all of the title of the page you want to link to into the field. The plugin will show you all posts matching that title as you type. Click one of the posts when you see the one you want and that will lock-in the setting.

    Note that the field should not contain an address or post-ID.

    Plugin Author Dani Llewellyn

    (@diddledani)

    Can you expand a bit on that? I’m not sure what you are referring to. A screenshot of your site showing the problem might help me.

    I’m sure my lack of understanding is my fault, and I’m sorry I can’t help directly in this reply :-(.

    Plugin Author Dani Llewellyn

    (@diddledani)

    The code you shared in the previous post does not call the_post_thumbnail or get_the_post_thumbnail, nor does it check that there is a thumbnail with has_post_thumbnail. You still need to do those bits. They need to appear after this line:

    $post = $a_z_query->get_the_item_object( 'I understand the issues!' );
    
    Plugin Author Dani Llewellyn

    (@diddledani)

    Can you share the shortcode you’re using to exclude posts? It should be similar to:

    [a-z-listing display="posts" post-type="page" exclude-posts="5,6,7"]
    

    Versions 2.0.5 and 2.0.6 didn’t include any changes to the code that excludes posts, so I’m not sure why it would stop working for you….

    Plugin Author Dani Llewellyn

    (@diddledani)

    There’s currently a limitation that prevents using terms to filter a listing of pages. This is due to my usage of the function get_pages() from WordPress core. I am working on some code that will reduce the usage of that function, but it will still be a problem if the plugin thinks it needs to display only children and grandchildren of a specific post.

    Plugin Author Dani Llewellyn

    (@diddledani)

    You’re right – good catch. There’s a limitation with taxonomies against pages.

    I can alleviate that, partly, by updating the plugin to use get_pages on a more limited basis – currently it uses get_pages for any listing that requests pages as the post type. I’ve worked up some code which I’ll put into a new version 2.1.0 in the coming week, but there will still be an issue if the plugin thinks it needs to show child and grandchild pages of a specific post.

    Plugin Author Dani Llewellyn

    (@diddledani)

    Looking at your site, I see that you’re not using the A-Z widget from my plugin. Have you disabled it specifically because of the problem or do you have multiple A-Z widgets and might have selected one from another plugin accidentally?

    Plugin Author Dani Llewellyn

    (@diddledani)

    Hi,

    I’ve promoted the multi-column mode, with some changes, to be the default output.

    The CSS has changed, however, so the old template won’t display correctly any more, as you found out..

    If you haven’t modified the template when you copied it into your theme, you can just delete the file and everything should work out of the box now. Alternatively, if you have modified the template you’ll need to compare to the default template at wp-content/plugins/a-z-listing/templates/a-z-listing.php and merge your custom code into a copy of this file in your theme like you did with the old multi-column template.

    Plugin Author Dani Llewellyn

    (@diddledani)

    I mistyped, and you copied verbatim.

    Try replacing has_thumbnail with has_post_thumbnail to get past that specific undefined function error.

    Plugin Author Dani Llewellyn

    (@diddledani)

    I’m working on a 2.1.0 version which will add two new filters for overriding the index letters and titles of items. Rather than trying to memorise or copy my implementation of the heavily nested array structure, you will be able to instead hook the filters a_z_listing_pre_index_item_title and a_z_listing_item_index_letter.

    Their implementation will be as follows:

    add_filter( 'a_z_listing_pre_index_item_title', 'my_override_titles', 10, 3 );
    function my_override_titles( $title, $item, $type ) {
        // $title is the title of the item as used for the index
        // set $title to your preferred format. This will then be indexed by the
        // default extraction - i.e. the first letter of the new title will be
        // the index letter used for this item
    
        // delete Mr and Mrs from the start of titles (presume they're names):
        $title = preg_replace( '^((Mr)|(Mrs))\s+', '', $title );
    
        return $title;
    }
    
    add_filter( 'a_z_listing_item_index_letter', 'my_override_index_letter', 10, 3 );
    function my_override_index_letter( $letters, $item, $type ) {
        // $letters is an array of letters to use for the item in the index
        // any item can be indexed under any number of letters
    
        if ( 15 === $item->ID ) {
            // let's index this item under P and Z.
            $letters = array( 'P', 'Z' );
        }
    
        return $letters;
    }
    Plugin Author Dani Llewellyn

    (@diddledani)

    That’s a curious discovery, @tjebe, thanks for sharing. The format of the $this->current_item['item'] value changed in 2.0.0 but I have just realised that if a site has hooked the a_z_listing_item_indices filter then they might be returning the old style where item was a WP_Post or WP_Term object.

    If you have such a hook implemented then you can immediately fix it by changing your filter function to something like:

    add_filter( 'a_z_listing_item_indices', 10, 3 ); // the last number is different!
    function my_item_indices_hook( $indices, $item, $type ) {
        $indices = array(); // this empties the default index
        if ( 'terms' === $type ) {
            $title     = $item->name;
            $item_id   = $item->term_id;
            $permalink = get_term_link( $item );
        } else {
            $title     = get_the_title( $item );
            $item_id   = $item->ID;
            $permalink = get_the_permalink( $item );
        }
    
        // replace the next line with your logic to determine the index letter
        $index = mb_substr( $title, 0, 1, 'UTF-8' );
    
        $indices[ $index ][] = array(
            'title' => $title,
            'item'  => ( 'terms' === $type ) ? "term:{$item_id}" : "post:{$item_id}",
            'link'  => $permalink,
        );
    
        return $indices;
    }

    I will also roll a new release to fix the situation where a site has customised the index returning a WP_Post object in the old style.

    Plugin Author Dani Llewellyn

    (@diddledani)

    I’ve just seen it, thank you very much 🙂

Viewing 15 replies - 541 through 555 (of 927 total)