• Hi,

    I’m using the code below to display a list of pages in two column, with specific meta key.
    Works fine but when I repeat the code to display second set of pages with different meta key (custom field) it includes pages from first loop as well.
    I need to run several sets of page lists with different meta keys.
    How can I fix this?

    Thanks.

    Here is the code:

    <?php
    $page_s = explode("</li>",wp_list_pages('title_li=&meta_key=series&meta_value=three&echo=0&depth=1&style=none'));
    $page_n = count($page_s) - 1;
    $page_col = round($page_n / 2);
    for ($i=0;$i<$page_n;$i++){
     if ($i<$page_col){
      $page_left = $page_left.''.$page_s[$i]."</li>";
     }
     elseif ($i>=$page_col){
      $page_right = $page_right.''.$page_s[$i]."</li>";
     }
    }
    ?>
    <center>
    <h3>3 Series</h3>
    <ul id="twocol_list_left">
    <?php echo $page_left; ?>
    </ul>
    <ul id="twocol_list_right">
    <?php echo $page_right; ?>
    </ul>
    
    </center>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘List pages in two columns’ is closed to new replies.