Forum Replies Created

Viewing 15 replies - 136 through 150 (of 927 total)
  • Plugin Author Dani Llewellyn

    (@diddledani)

    Hi, @rayshman ,

    Sorry I didn’t get to you before you found a fix yourself. I’m glad you found the right code to get it working – I would have advised a similar (probably identical) solution, so you’ve done well 🙂

    Plugin Author Dani Llewellyn

    (@diddledani)

    This should show the product tags:

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

    (@diddledani)

    @garyupham I think I made a mistake in my above code. The line:

    $a_z_query->get_the_item_object( 'I understand the issues!' );
    

    Needs to be directly after BOTH of these TWO lines (not the ONE I wrote originally):

    while ( $a_z_query->have_items() ) :
    	$a_z_query->the_item();
    

    Without the $a_z_query->the_item(); the “loop” isn’t forwarded onto the correct item so you’re always “one item behind”.

    Plugin Author Dani Llewellyn

    (@diddledani)

    Hi,

    Yes the short-code will display all tags by default. I’m not sure whether WordPress provides the facility to filter tags in the way you want, so I’ll need to have a think about how to do it entirely within the plugin. (The plugin reuses the inbuilt WordPress functionality as much as possible.)

    Unfortunately that means it’s not possible right now, but I’ll see if I can get it working.

    Plugin Author Dani Llewellyn

    (@diddledani)

    Hi,

    I don’t understand what you mean by “tags of a particular category only”. Categories and Tags are separate things that are unrelated, unless you have a plugin that is somehow linking them.

    Plugin Author Dani Llewellyn

    (@diddledani)

    As it shows correctly when you are logged-in you need to find out what is different between the logged-in and logged-out page content to narrow down why it’s failing.

    Try disabling all other plugins temporarily and switch to a default twenty-something theme. This will help us to identify if another plugin or your theme is conflicting.

    Plugin Author Dani Llewellyn

    (@diddledani)

    Hi,

    To display the tags you want a short-code similar to:

    [a-z-listing display="terms" taxonomy="post_tag"]
    
    Forum: Plugins
    In reply to: [A-Z Listing] Style Issue
    Plugin Author Dani Llewellyn

    (@diddledani)

    Hi,

    I’m unsure what you mean by “there being no space left between the lines of the separate listings/rows”. Could you expand a bit more to help me understand your issue better?

    Plugin Author Dani Llewellyn

    (@diddledani)

    You are using autoptimize to bundle your stylesheets and javascript. Try clearing the cache that it generates.

    Plugin Author Dani Llewellyn

    (@diddledani)

    Hi,

    Does the listing work with WP_DEBUG turned off, or are you using WP_DEBUG to determine why the plugin isn’t working? The nature of the plugin is that it needs to load all the posts into memory to generate the listing. Unfortunately that means it needs a lot of memory on larger listings. I’m trying to design a better method of loading that reduces the memory load while still being backwards-compatible.

    Plugin Author Dani Llewellyn

    (@diddledani)

    Hi,

    You may create a template specific to your taxonomy (in this example category) by naming it a-z-listing-category.php. This allows you to separate the code for the taxonomy vs the posts listing.

    Plugin Author Dani Llewellyn

    (@diddledani)

    Hi,

    Apologies for the delay in replying. Are you asking about a function to use in a template that will do the same as the short-code? If so, then yes, you can do this easily with:

    <?php do_shortcode( '[a-z-listing]' ); ?>
    

    You will want to add the complete short-code that you’d use on a post content inside the quotes. This is how the widget does it, which you can see on line 434 of wp-content/plugins/a-z-listing/widgets/class-a-z-listing-widget.php.

    The problem with this approach is the plugin cannot detect that the short-code is being used and so will not apply the default styling. You can fix that deficiency by adding the following to your theme’s functions.php file:

    <?php
    add_action( 'init', 'a_z_listing_force_enable_styles' );
    Plugin Author Dani Llewellyn

    (@diddledani)

    Hi,

    At the moment the best way to achieve this is to copy the template from the plugin at wp-content/plugins/a-z-listing/templates/a-z-listing.php into your theme or child theme at wp-content/themes/<your-theme>/a-z-listing.php and customise line 57 to output the correct link instead of $a_z_query->the_permalink().

    I’m unsure the exact PHP you need to add, however.

    Plugin Author Dani Llewellyn

    (@diddledani)

    Oops, the leading . shouldn’t be there:

    div.letter-section > ul.az-columns {
        margin: initial;
    }
    div.letter-section > ul.az-columns > li {
        display: initial;
        list-style: initial;
        padding: initial;
    }
    Plugin Author Dani Llewellyn

    (@diddledani)

    You will need to customise the template that drives the output of the list to the page. To do this, copy the file from wp-content/plugins/a-z-listing/templates/a-z-listing.php into your theme (i.e. to the folder wp-content/themes/your-theme-name – it needs to be in the theme’s top-most folder, not a subfolder).

    Once you have the template in your theme, you need to edit it to change the title output line. On line 53 is the following:

    while ( $a_z_query->have_items() ) :
    

    On a new line directly after that line you want to add:

    $a_z_query->get_the_item_object( 'I understand the issues!' );
    

    Note the text “I understand the issues!”: this must read exactly as is to indicate to the plugin that you accept that your listing may be slower or run out of memory and break due to using the get_the_item_object function. This is because it will load the whole post from your database for every post in your listing, which is not done by default because of the speed and memory overhead in doing that.

    Once you’ve called get_the_item_object() you can then use the Advanced Custom Fields functions, which I believe for this case you want get_field or get_the_field or similar (I don’t know much about ACF so can’t advise on the correct function). You’ll want to add a print/echo of the custom field’s value on line 59 either inside the <a> tags to make it part of the post’s link or after </a> to make it unlinked text.

    • This reply was modified 5 years, 6 months ago by Dani Llewellyn. Reason: Fix broken code formatting block
Viewing 15 replies - 136 through 150 (of 927 total)