Forum Replies Created

Viewing 15 replies - 331 through 345 (of 927 total)
  • Plugin Author Dani Llewellyn

    (@diddledani)

    @yasbenyas , try the following:

    [a-z-listing display="terms" taxonomy="pa_brand"]
    

    I am not 100% certain this is correct. To determine the taxonomy name you need to navigate, within the WordPress admin, to the “All product attributes” listing page and find your attribute in the list. The name for the taxonomy part of the shortcode is in the column labelled slug, which you need to prefix with pa_. To be certain of the taxonomy slug you can click the attribute name and then inspect your browser’s address bar. The address will have changed to something like https://example.com/wp-admin/edit-tags.php?taxonomy=pa_brand&post_type=product where the name for the shortcode is the text between taxonomy= and &post_type=product.

    • This reply was modified 6 years, 9 months ago by Dani Llewellyn. Reason: make url not a code block
    Plugin Author Dani Llewellyn

    (@diddledani)

    Hi,

    I suspect you have a large number of posts returned by your chosen shortcode, which is leading to PHP hitting the memory limit defined by your server. There’s no way to prevent hitting the memory limit other than reducing the scope of your listing to return fewer posts. I plan to improve this in a future version but it needs the whole plugin to be redesigned to implement it, so it will take some time.

    Plugin Author Dani Llewellyn

    (@diddledani)

    Hi, @teacdan,

    To show posts from the category whose slug is red-team you would want the following:

    [a-z-listing display="posts" post-type="post" taxonomy="category" terms="red-team"]
    

    As an aside, the WordPress.org forum guidelines prefer you to start a new thread rather than replying to somebody else’s.

    Plugin Author Dani Llewellyn

    (@diddledani)

    Yes, you can show all the tags with:

    [a-z-listing display="terms" taxonomy="post_tag"]
    
    Plugin Author Dani Llewellyn

    (@diddledani)

    I can’t see why your page is displaying like that. Please try the shortcode on a different page and also follow the standard troubleshooting procedure using the health-check plugin to disable other plugins and try using a default theme (twenty-something) so that we can eliminate as many variables as possible. If you can identify a specific plugin or your theme as conflicting then we can work from there. Alternatively if it’s still broken when only my plugin is active then we can try to find out what about my plugin is broken 🙂

    One thing that comes to mind is to check whether you have the PHP module called mbstring enabled in your installation. I’ve added a small test to the health-check feature of WordPress that you can find at admin -> tools -> site health. On that page will be, somewhere, a bit of text that tells you whether the A-Z Listing plugin is able to find mbstring or not. (It might be behind a click to reveal feature labelled “passed tests”.)

    Plugin Author Dani Llewellyn

    (@diddledani)

    This should be fixed as of 3.1.0.

    Plugin Author Dani Llewellyn

    (@diddledani)

    OK, I think I see what’s happening here. You have multiple different listings that are all using the same template. The solution is to rename your a-z-listing.php template in your theme, the one you want to use for your terms listing, to a-z-listing-product_tag.php.

    The available template names you can use are:

    • For display=terms:
    • a-z-listing-[taxonomy_name].php – multiple taxonomies will be separated by underscores and listed in the order specified in the shortcode, e.g.: a-z-listing-taxonomy1_taxonomy2.php
    • a-z-listing.php
    • For display=posts:
    • a-z-listing-[section].php where [section] is the top-most page in the hierarchy. This is only used when post-type=page.
    • a-z-listing-[slug].php where [slug] is the slug of the post containing the shortcode.
    • a-z-listing.php
    • This reply was modified 6 years, 9 months ago by Dani Llewellyn. Reason: fix lists nesting
    Plugin Author Dani Llewellyn

    (@diddledani)

    Yes, I think it does need to be the opposite-way in the shortcode, but I might be wrong as I am unable to read any right-to-left languages fluently enough to be able to make the correct choice. Try both to see which works best 🙂

    Plugin Author Dani Llewellyn

    (@diddledani)

    Oh, I’m really sorry I dropped the ball on this. I completely overlooked that you had replied.

    If you want a maximum of 2 columns, as an example, you can try overriding with the following: (enter the code into “custom CSS” box in your theme’s “customizer” area – navigate to wp-admin -> themes -> customize):

    .letter-section ul.columns {
        column-gap: 0.6em;
        column-width: calc(50% - 0.6em);
    }
    .letter-section ul.columns.max-0-columns,
    .letter-section ul.columns.max-1-columns {
          column-count: 1;
          max-width: 50%;
    }
    .letter-section ul.columns.max-2-columns {
          column-count: 2;
          max-width: 100%;
    }

    Likewise, for a maximum of three columns you could try:

    .letter-section ul.columns {
        column-gap: 0.6em;
        column-width: calc(33% - 0.6em);
    }
    .letter-section ul.columns.max-0-columns,
    .letter-section ul.columns.max-1-columns {
          column-count: 1;
          max-width: 33%;
    }
    .letter-section ul.columns.max-2-columns {
          column-count: 2;
          max-width: 66%;
    }
    .letter-section ul.columns.max-3-columns {
          column-count: 3;
          max-width: 100%;
    }
    • This reply was modified 6 years, 9 months ago by Dani Llewellyn. Reason: fix column-width in "3 columns" example
    • This reply was modified 6 years, 9 months ago by Dani Llewellyn. Reason: revert last change - I think it works correctly as-is
    Plugin Author Dani Llewellyn

    (@diddledani)

    Hi,

    I’m glad you managed to find the solution. Sorry I didn’t get here in time to help you directly.

    Plugin Author Dani Llewellyn

    (@diddledani)

    Hi,

    I’m glad you found the solution. Sorry I didn’t manage to help promptly :-).

    Plugin Author Dani Llewellyn

    (@diddledani)

    You might find that your category slug is slightly different than you have specified.

    Alternatively if you are expecting posts to be listed instead of page then you can add post-type="post" to your shortcode to switch the output from displaying the post type page. The plugin supports all post-types with this parameter, so if you are using a custom post type then you can also specify that here.

    A fully-fleshed-out shortcode with minimum areas for error is:

    [a-z-listing display="posts" post-type="post" taxonomy="category" terms="travel-insurance"]
    

    The default behaviour when you don’t override any parameters will be the equivalent of if you had specified:

    [a-z-listing display="posts" post-type="page"]
    
    Plugin Author Dani Llewellyn

    (@diddledani)

    Hi,

    There isn’t a direct ability to do this provided by the plugin. If I’m understanding correctly, you are showing posts in your list and want each post title to be coloured by the post’s associated terms.

    You could try adding a template into your childtheme called a-z-listing.php copied from wp-content/plugins/a-z-listing/templates/a-z-listing.php. Within this file you’ll want to try using get_the_item_object() to load the $post variable inside the while( $a_z_query->have_items() ) loop. Then you can use has_term() from WordPress core to match against your list for colouring:

    ...
    <?php
    while( $a_z_query->have_items() ) :
        $a_z_query->the_item();
        $post = $a_z_query->get_the_item_object();
        if ( has_term( 'red-term-slug', 'taxonomy-slug', $post ) {
            print '<li class="red">';
        } elseif ( has_term( 'green-term-slug', 'taxonomy-slug', $post ) ) {
            print '<li class="green">';
        } else {
            print '<li class="boring colourless">';
        }
        ?>
        <a href="<?php $a_z_query->the_permalink(); ?>">
            <?php $a_z_query->the_title(); ?>
        </a>
    </li>
        <?php endwhile; ?>
    ...
    • This reply was modified 6 years, 9 months ago by Dani Llewellyn. Reason: fix mistaken use of get_the_terms() - better to use has_term()
    Plugin Author Dani Llewellyn

    (@diddledani)

    It looks like I might have broken it in 3.0.0 🙂 I’ll try to get a fixed version out asap.

    Plugin Author Dani Llewellyn

    (@diddledani)

    Unfortunately pagination is not a feature this plugin provides currently.

    I don’t know how to provide such functionality in a useful way that is portable between sites. The plugin is architected in such a way that even with pagination it will likely not result in any performance improvements without a large redesign.

Viewing 15 replies - 331 through 345 (of 927 total)