WordPress.org

Ready to get started?Download WordPress

Forums

WP-PageNavi Breaks Validation (9 posts)

  1. djquinn
    Member
    Posted 6 years ago #

    - Sorry it garbled the code:

    I've noticed that WP-PageNavi breaks validation if WordPress is set to a xhtml strict doctype - the ampersand in &paged (in all links that WP-PageNavi generates) needs to be generated as &paged to pass validation.

    To fix this issue, enclose calls to "get_pagenum_link" in the wp-pagenavi.php file of the plugin with htmlspecialchars().

    For example:

    echo '<a href="'.get_pagenum_link($i).'" title="'.$page_text.'" class="page-link">'.$page_text.'</a>';

    becomes

    echo '<a href="'.htmlspecialchars(get_pagenum_link($i)).'" title="'.$page_text.'" class="page-link">'.$page_text.'</a>';
  2. Lester Chan
    Member
    Posted 6 years ago #

    Thanks, I will fix that

  3. djquinn
    Member
    Posted 6 years ago #

    you still rock

  4. Lester Chan
    Member
    Posted 6 years ago #

    Thanks for the compliments =D

    The SVN has been updated =D I used clean_url() instead, it is a function in WP =D

  5. n2wq
    Member
    Posted 5 years ago #

    Validation is still broken. See http://validator.w3.org/check?uri=http%3A%2F%2Fwww.yourliferegained.com%2F&charset=(detect+automatically)&doctype=Inline&ss=1&outline=1&group=0&No200=1&verbose=1&accept=text%2Fhtml%2Capplication%2Fxhtml%2Bxml%2Capplication%2Fxml%3Bq%3D0.9%2C*%2F*%3Bq%3D0.8&accept-language=en-us%2Cen%3Bq%3D0.5&accept-charset=ISO-8859-1%2Cutf-8%3Bq%3D0.7%2C*%3Bq%3D0.7&user-agent=W3C_Validator%2F1.591

    My index.php is as follows:

    <?php get_header(); ?>

    <div id="content">

    <div id="contentleft">

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    <h1>" rel="bookmark"><?php the_title(); ?></h1>

    <div class="date">
    <?php the_time('F j, Y'); ?> by <?php the_author_posts_link(); ?> · <?php comments_popup_link('Leave a Comment', '1 Comment', '% Comments'); ?>
    Filed under: <?php the_category(', ') ?> <?php edit_post_link('(Edit)', '', ''); ?>
    <?php if(function_exists('the_ratings')) { the_ratings(); } ?>
    </div>
    <?php the_excerpt(__('Read more'));?><div style="clear:both;"></div>

    <div class="postmeta">
    <p>Keywords: <?php the_tags('') ?> </p>
    <?php if( function_exists('ADDTOANY_SHARE_SAVE_BUTTON') ) { ADDTOANY_SHARE_SAVE_BUTTON(); } ?>
    </div>

    <?php endwhile; else: ?>

    <p><?php _e('Sorry, no posts matched your criteria.'); ?></p><?php endif; ?>

    <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?>

    </div>

    <?php include(TEMPLATEPATH."/r_sidebar.php");?>

    </div>

    <!-- The main column ends -->

    <?php get_footer(); ?>

  6. Lester Chan
    Member
    Posted 5 years ago #

    WP-PageNavi BY DEFAULT does not break validation. It has been fixed.

    Example: http://lesterchan.net/wordpress/

  7. n2wq
    Member
    Posted 5 years ago #

    First and foremost, thank you very much for investing your time and efforts into developing the supporting the plugin.

    I am not sure if this helps, but removing the plugin, without doing anything else, fixes validation. Also, http://validator.w3.org/check?uri=http%3A%2F%2Flesterchan.net%2Fwordpress%2F&charset=(detect+automatically)&doctype=Inline&group=0 shows that the example site is not valid either. I am not a programmer and don't have a perspective either way; just wanted to share my experience.

  8. Lester Chan
    Member
    Posted 5 years ago #

    You may want to try http://lesterchan.net/ also, I think that should be validated without problems.

    If you notice the error, it has nothing to do with WP-PageNavi but bad html in some of my posts and I have fixed that and now it should validate just fine.

    If you are not a programmer, than you will have difficulty making it to be validated as often you need to know where to put the plugin codes and viewing the code that the plugin generated.

    For my case, everything is based on the default theme and it might defers from theme to theme

  9. n2wq
    Member
    Posted 5 years ago #

    I fixed validation on the front page http://www.yourliferegained.com but now have to figure out why the category, tag, and archive pages are failing. It turned out that </br> does not have an opening tag so in places where I was doing
    </br> the validation was failing when pagenavi enabled.

Topic Closed

This topic has been closed to new replies.

About this Topic