• Resolved uwiuw

    (@uwiuw)


    i like previous_posts_link / next_posts_link cause as far as i know it can be used outside the loop. So, it’s ideal for blog navigation.

    but i have problem on how to make it more accesible according to w3c standar. As you know both of this function only accept 2 parameter.

    the reference here next_posts_link and previous_posts_link

    Can any body help me how to change output of both function. so i can put custom title and rel microformat

Viewing 5 replies - 1 through 5 (of 5 total)
  • Adding a title attribute to the post navigation links would not increase their accessibility. In fact, it could even decrease it by adding unwanted ‘noise’. The default configuration of JAWS is non-verbose – which means that it deliberately ignores the title attribute. Experienced users who have custom configurations also often set their AT to ignore ‘title’ because it’s so often abused for “SEO purposes”. So adding ‘title’ would be of no use and would not enhance accessibility.

    I’m also struggling to understand how adding rel microformat would be of any help.

    Thread Starter uwiuw

    (@uwiuw)

    Probably your’re right. i really new to w3c web standar and i know that one of SEO stuff is stuffing a link with title. But honestly, SEO is not my main concern. i just want to control my blog theme better.

    But after hearing your point of view about noise, i think you’re also right. Eventhough this is the first time i heard it. Maybe you can accept my apology cause of my lack of experience. (and my english 😀 )

    About rel microformat. yes, i wanto to give more information such as rel=”tag” if the navigation is in a tag archieve.

    No apology needed. It’s nice to hear that someone is making web accessibility a priority instead of just focusing on the visuals.

    That’s an interesting point about adding the rel attribute to the post navigation links but the only way I can see of adding this to the tags themselves is to build new template functions for modified previous_posts_link and next_posts_link within functions.php and then call the bespoke versions if they exist – otherwise use the default tags.

    Or persuade a friendly plugin developer to have a go at building something that would do the same job. I’m afraid mine is a bit busy right now.

    The one thing I’m not sure about is if/how current assistive technology would access the rel attribute. That attribute has been so under-used that, like longdesc, it may not even be supported by a lot of the software out there.

    For what it’s worth, the previous_posts_link and next_posts_link tags appear to use get_next_posts_page_link and get_next_posts_link which are defined inwp-includes/link-template.php.

    There is an easy way to do it. I’ve found out after quite a few hours of frustration … couldn’t believe that wordpress wouln’t be able to do it … but the documentation in this regard is really really really bad … anyways what you need is to add a filter:

    in your functions.php add this code

    add_filter('next_posts_link_attributes', 'get_next_posts_link_attributes');
    add_filter('previous_posts_link_attributes', 'get_previous_posts_link_attributes');
    
    if (!function_exists('get_next_posts_link_attributes')){
    	function get_next_posts_link_attributes($attr){
    		$attr = 'rel="myrel" title="mytitle"';
    		return $attr;
    	}
    }
    if (!function_exists('get_previous_posts_link_attributes')){
    	function get_previous_posts_link_attributes($attr){
    		$attr = 'rel="myrel" title="mytitle"';
    		return $attr;
    	}
    }
    Thread Starter uwiuw

    (@uwiuw)

    yes @scibuff, your’re right some wp in codex has lack of documentation. Sometimes i got confuse there ahahahaha. Btw, many thanks for your replay.

    for both of you, i gave my highest gratitude. Thank you very much. i’m really appreciated it. now i will flag this problem as resolved. hopefuly any newbie of web standard will appreciated it too 😀

    esmi & scibuff : from bandung with love, i hope both of you has great morning hahahahah xoxo

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘need previous_posts_link / next_posts_link has title and rel’ is closed to new replies.