• I’m helping my wife get her blog up and running.

    We recently switched themes from DynamicColor to TwentyTen. I copied and pasted the code which shows the child pages from the old template and everything seems to be working well, but I seem to have a formatting problem.

    Refer to the page: http://joyfullydivine.com/products-and-services/mind-tools/ for example

    There are 4 child pages and depending on the browser there is a “.” (dot) that appears on or above the bullet points of the subpages. With IE8 the dot is outside the bullets, with Chrome it’s part of the first bullet and with Firefox it’s also part of the first bullet but in reverse to Chrome.

    I believe the code in question from page.php is as follows:
    <div class=”entry-content”>
    <?php the_content(); ?>
    <?php wp_link_pages( array( ‘before’ => ‘<div class=”page-link”>’ . __( ‘Pages:’, ‘twentyten’ ), ‘after’ => ‘</div>’ ) ); ?>
    <div class=”postmetadata”>
    <?php $args = array(‘child_of’ => get_the_ID(),’title_li’ => __(‘ ‘)); ?>
    <?php wp_list_pages($args);?>
    <?php wp_link_pages(array(‘before’ => ‘<p>Pages: ‘, ‘after’ => ‘ ‘, ‘next_or_number’ => ‘number’)); ?>
    </div>
    <?php edit_post_link( __( ‘Edit’, ‘twentyten’ ), ‘<span class=”edit-link”>’, ‘</span>’ ); ?>
    </div><!– .entry-content –>

    This has got me puzzled and I have no idea where to look next. Any pointers would be helpful.

    Kind regards,
    Balraj Dhaliwal
    Melbourne, Australia

Viewing 4 replies - 1 through 4 (of 4 total)
  • nothing to do with ‘wp_link_pages()’

    <?php $args = array('child_of' => get_the_ID(),'title_li' => __(' ')); ?>
    <?php wp_list_pages($args);?>

    this code outputs html li tags; the wrapping element, either ul or ol is missing:

    http://codex.wordpress.org/Function_Reference/wp_list_pages

    try:

    <?php $args = array('child_of' => get_the_ID(),'title_li' => ''); ?>
    <ul><?php wp_list_pages($args);?></ul>

    Moderator keesiemeijer

    (@keesiemeijer)

    maybe this will help, wp_list_pages needs to be wrapped in a list like this:

    <ul>
    <?php wp_list_pages($args); ?>
    </ul>
    Thread Starter balraj

    (@balraj)

    Thanks, there is some improvement using the <ul> and </ul> tags. However, I now believe that this shows that there is a first level bullet which is blank and that is the actual top level page itself i.e. the current level page.

    I don’t know enough about PHP and WordPress code to be able to fix it. If anyone can suggest a way to remove the current level page from the bulleted list it would be helpful.

    Moderator keesiemeijer

    (@keesiemeijer)

    in your theme’s stylesheet style.css look for this:

    ul {
    	list-style: square;
    	margin: 0 0 18px 1.5em;
    }

    and put this underneath it:

    div.postmetadata ul li.pagenav {
    	list-style: none;
    }

    so you have this:

    ul {
    	list-style: square;
    	margin: 0 0 18px 1.5em;
    }
    
    div.postmetadata ul li.pagenav {
    	list-style: none;
    }

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Formatting issue with wp_link_pages’ is closed to new replies.