Support » Plugin: List category posts » Remove title attribute from links

  • Hello,

    I’m writing to ask if it would be possible to provide a new shortcode option to exclude the title attribute of the post links (for accessibility purposes).

    In other words, I’d like the list items to be:
    <li><a href="...">Title of post</a></li>
    instead of:
    <li><a href="Title of post">Title of post</a></li>

    I can do this myself by changing the associated code in lcp-catlistdisplayer.php but that will break every time there is an update.

    The reason I’m asking for this is that the title attribute takes the value of the post title, leading to multiple “redundant title text” warnings when running the plugin output in a web accessibility evaluation tool (WebAIM in this case). As far as I understand this, there is no need for a title attribute in the above case.

    Thanks in advance if you consider this!

    • This topic was modified 1 year, 1 month ago by  dcclxi.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Use a no_post_title like this:
    [catlist id=34 no_post_titles=yes]



    Ups, sorry, I just realised something went wrong with my initial post.

    What I’d like to do is to remove the title="..." from the <a> link, i.e. have this:
    <li><a href="...">Title of post</a></li>
    instead of this:
    <li><a href="..." title="Title of post">Title of post</a></li>

    Instead of doing any functions.php work you can simply add something like this to your template.

    <ul class=”nav”>
    <?php wp_list_categories( array(
    ‘orderby’ => ‘name’,
    ‘taxonomy’ => ‘product_cat’,
    ‘depth’ => 1,
    ‘title_li’ => ”,
    ‘hide_title_if_empty’ => true,
    ‘use_desc_for_title’ => 0,
    ‘include’ => array( 28, 27, 8, 29, 43, 31 )
    ) ); ?>

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Remove title attribute from links’ is closed to new replies.