Forum Replies Created

Viewing 15 replies - 271 through 285 (of 927 total)
  • Plugin Author Dani Llewellyn

    (@diddledani)

    Hi,

    To filter the list to a products in a specific category, you can use:

    [a-z-listing display="posts" post-type="product" taxonomy="product_cat" terms="cat-slug"]
    

    You can find the appropriate slug to use in place of cat-slug by navigating to /wp-admin/edit-tags.php?taxonomy=product_cat&post_type=product. You should see the slug for each category on the fourth column of the list of categories.

    Plugin Author Dani Llewellyn

    (@diddledani)

    Hi,

    This is unexpected behaviour. Without seeing your site I can’t determine what might be happening. However, you can hide any part of the listing by either customising the template or using CSS with a display: none rule.

    To customise the template you should copy the file from wp-content/plugins/a-z-listing/templates/a-z-listing.php into your theme alongside the theme’s style.css file. Once it is in your theme at the correct location the file will override the default listing template from the plugin.

    Plugin Author Dani Llewellyn

    (@diddledani)

    Hi,

    To limit to a specific category (a term in the “categories” taxonomy) you can use a shortcode similar to:

    [a-z-listing display="posts" post-type="post" taxonomy="category" terms="term-slug"]
    

    To find the term-slug for your term/category navigate to wp-admin -> posts -> Categories and then find the column labelled Slug (it’s slug in the English locale – if you are using a different language you might have a translated label. It is likely to be the third column in the list of terms/categories.) Once you’ve found the slug for your term copy and paste it into the shortcode above.

    Plugin Author Dani Llewellyn

    (@diddledani)

    Hi,

    If you know the logic you want to define when there is a “new” entry you can add it into the template. Copy the file from wp-content/plugins/a-z-listing/templates/a-z-listing.php into your theme alongside the theme’s style.css. You can customise the inner-most loop between line 53 and 61.

    I don’t know the exact PHP you will need for your scenario so I don’t feel confident giving any more advice than the above.

    Plugin Author Dani Llewellyn

    (@diddledani)

    Hi,

    To omit the brackets when there are no parents, you can store the parents list or immediate parent in a variable and then test whether that variable has any content:

    For the full list of parents:

    <a href="<?php $a_z_query->the_permalink(); ?>">
    	<?php $a_z_query->the_title(); ?>
    </a>
    <?php
    $parents_list = get_term_parents_list( $a_z_query->get_the_item_id(), 'category', array( 'separator' => ', ' ) );
    if ( ! empty( $parents_list ) ) :
    	echo '(' . $parents_list . ')';
    endif;
    ?>

    For the immediate parent only:

    <a href="<?php $a_z_query->the_permalink(); ?>">
    	<?php $a_z_query->the_title(); ?>
    </a>
    <?php
    $all_parents = get_ancestors( $a_z_query->get_the_item_id(), 'category', 'taxonomy' );
    $immediate_parent = array_shift( $all_parents );
    if ( $immediate_parent ) :
    	$immediate_parent_term = get_term( $immediate_parent, 'category' );
    	echo '(' . $immediate_parent_term->name . ')';
    endif;
    ?>
    Plugin Author Dani Llewellyn

    (@diddledani)

    You can customise the listing by copying the file from wp-content/plugins/a-z-listing/templates/a-z-listing.php into your theme’s top-level folder alongside style.css. You can then edit to suit your requirements. For this example you can try changing lines 57 to 59. Currently thes lines read as below:

    <a href="<?php $a_z_query->the_permalink(); ?>">
    	<?php $a_z_query->the_title(); ?>
    </a>

    You can include the parent terms with get_term_parents_list():

    <a href="<?php $a_z_query->the_permalink(); ?>">
    	<?php $a_z_query->the_title(); ?>
    </a>
    (<?php echo get_term_parents_list( $a_z_query->get_the_item_id(), 'category', array( 'separator' => ', ' ) ); ?>)

    This will add the list of parent-terms as a comma-separated list of their names inside parentheses after the title of the current term. You might not want all the parents, so you could try to use get_ancestors() directly to pull only the immediate parent:

    <a href="<?php $a_z_query->the_permalink(); ?>">
    	<?php $a_z_query->the_title(); ?>
    </a>
    (<?php
    $all_parents = get_ancestors( $a_z_query->get_the_item_id(), 'category', 'taxonomy' );
    $immediate_parent = array_shift( $all_parents );
    $immediate_parent_term = get_term( $immediate_parent, 'category' );
    echo $immediate_parent_term->name;
    ?>)
    • This reply was modified 6 years, 4 months ago by Dani Llewellyn. Reason: add missing example code
    Plugin Author Dani Llewellyn

    (@diddledani)

    It’s not possible, currently, because I simply didn’t think about using the slug in that way :-). Sorry I can’t help you right now, but I will add this idea to my list of things to add in the next version once I’ve figured out performance issues.

    Plugin Author Dani Llewellyn

    (@diddledani)

    You could try replacing substr() with mb_substr(), which requires that your PHP installation has the multibyte string (mbstring) extension enabled. You did indicate that it is enabled, but I just wanted to double check that..

    Plugin Author Dani Llewellyn

    (@diddledani)

    Hi,

    You appear to have some custom code for your non-dev site, because the plugin doesn’t do single letter pages out of the box. There is a “tabbed” display that loads all the posts into the page and then switches between each letter using javascript. This can be enabled with a line of code in your theme’s functions.php file, but your non-dev site isn’t doing this.

    To replicate what your non-dev site is doing, you’ll need to find out what customisations were applied and copy those to your dev site.

    Plugin Author Dani Llewellyn

    (@diddledani)

    Both of those variants look like they should work. Is it possible that the added letters with diacritics are a different unicode code-point to the first letter of your pages? To be sure you could try copying the first letter of an affected page’s title from the edit-page screen and then paste that into the alphabet. If that still fails, I’m unsure what the problem is…

    Plugin Author Dani Llewellyn

    (@diddledani)

    Hi,

    Please copy and paste the exact shortcode from your site. Make sure when you paste the shortcode into the reply box that you use the editor’s “code” feature to correctly mark your input as code. This will ensure that the editor does not mangle the characters you input, such as changing " to , which it has done in your original post.

    Plugin Author Dani Llewellyn

    (@diddledani)

    Hi,

    Are you sure your taxonomy has the slug of tags? The default WordPress-provided tags taxonomy has a slug of post_tag.

    Plugin Author Dani Llewellyn

    (@diddledani)

    Hi,

    To display thirstylink posts that are categorised with the term clothing in the taxonomy thirstylink-category you would want the following shortcode:

    [a-z-listing display="posts" post-type="thirstylink" taxonomy="thirstylink-category" terms="clothing"]
    
    Plugin Author Dani Llewellyn

    (@diddledani)

    Hi,

    You cannot order by slug with this plugin out of the box.

    However, I have a paid product called “Proper Nouns Extension” which handles most western names. I think that should achieve what you desire.

    If you want to code support for yourself, then you will want to investigate the filter hook provided by the plugin called a_z_listing_item_index_letter.

    Plugin Author Dani Llewellyn

    (@diddledani)

    Hi,

    You can display the terms from a taxonomy who are each subordinates of a specified term with the following:

    [a-z-listing display="terms" taxonomy="category" parent-term="category-to-show-children-of" get-all-children="yes"]
    

    You can set get-all-children to no if your categories are directly children of the parent term. With it set to yes then the listing will also include grand-children and their children ad infinitum.

Viewing 15 replies - 271 through 285 (of 927 total)