Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter greenodragon

    (@greenodragon)

    It keeps list all of the pages in the database at the bottom of the list.

    Can anyone help me?

    https://toptvshows.inclinationstudio.com/theshows/

    Thread Starter greenodragon

    (@greenodragon)

    Sorry about the first one:

    <?php
    	  if(is_page('764') OR is_page('765') OR is_page('766') OR is_page('3')) {
    	  // string of all the numbers and letters
    	  if(is_page('764') OR is_page('3')) {
    	  	$letterLinks 	= "0123456789ABCDEFGHI";
    	  }
    	  if(is_page('765')) {
    	  	$letterLinks = "JKLMNOPQR";
    	  }
    	  if(is_page('766')) {
    	  	$letterLinks = "STUVWXYZ";
    	  }
    	  // make an anchor to return to the top of the page
    	  echo "<a name = 'top'></a>";
    	  // loop through each letter/number
    	  for ($x = 0; $x < 37; $x++) {
    	  $letter	= "{$letterLinks[$x]}";
    	  $querystr = "
    		SELECT wposts. *
    		FROM wp_posts wposts
    		WHERE wposts.post_title LIKE '$letter%'
    		AND wposts.post_parent = '9'
    		AND wposts.post_status = 'publish'
    		AND wposts.post_type = 'page'
    		ORDER BY wposts.post_title ASC
    	  ";
    	  //echo "$querystr";
    	  $pageposts = $wpdb->get_results($querystr, OBJECT);
    	  ?>
    	  <?php if ($pageposts): ?>
              <h2 class="list title-list-header"><?php echo "{$letterLinks[$x]}"; ?></h2>
            <ul class="list title-list">
          <?php foreach ($pageposts as $post): ?>
          <?php setup_postdata($post); ?>
              <li><a href="#?id=22"><?php the_title(); ?><span>Jerry Goldsmith</span></a></li>
    	 <?php endforeach; ?>
    	 <?php else : ?>
    
         <?php endif; ?>
            </ul>
          <?php
    	  } // end for
    	  }
    	  ?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘get_results’ is closed to new replies.