0

I am having a search results issue. When searching on the page it only displays 20 out of 400 professionals. It is a wordpress site, and the php queries are below.

$subpagecontent = array();
if (isset($_GET['token'])) {// doctors search result 
    classes
    $subpagecontent['first'] = 'subpage-content-left';
    $subpagecontent['second'] = 'subpage-content-right';
} else {
    //doctors serach form classes
    $subpagecontent['first'] = 'subpage-content-top';
    $subpagecontent['second'] = 'subpage-content-bottom';
}
;// if the token is present the search is on
?>
<div id="subpage-content">

    <div class="content-wrapper">
        <div id="<?php echo $subpagecontent['first']  ;?>">
            <h1 id="subpage-title"><?php echo 
   get_post_meta($post->ID, 'Heading', true); ?><span id="fad- 
   subtitle"><?php echo get_post_meta($post->ID, 'Subheading', 
   true); ?></span></h1>
            <div class="subpage-text">
            <?php

            if(isset($_GET['action']) && 
    !empty($_GET['action'])) {
                echo get_post_meta($post->ID, 
    'search_results_copy', true);
            } else {
                if (have_posts()) : while (have_posts()) : 
     the_post();
                    the_content();
                endwhile; endif;
            }

             ?>
            </div>
            <?php
                if(!isset($_GET['token'])){
                    ?>
                    <div class="quick-link-anchor-top">
                        <a href="#quicklinks"><span 
       class="sidebar-title">QUICK LINKS</span></a>
                        <div class="dotted-wrapper">
                            <img src="<?php 
       bloginfo('template_directory'); ?>/img/quick-links- 
       dots.png" class="quick-links-dots" />
                        </div>
                    </div><?php
                }
mickmackusa
  • 43,625
  • 12
  • 83
  • 136
87543r53w
  • 1
  • 1
  • Protip: Instead of putting `` everywhere you can use `= expr ?>` instead (note that the `=` syntax [is _not_ a "short tag"](https://stackoverflow.com/a/24837835/159145), which is an obsolete PHP feature). Also you _really_ should be HTML-encoding your output with `htmlentities()`/`htmlspecialchars()` as-appropriate. – Dai Oct 29 '22 at 13:08
  • Thank you, appreciate it. Any comment on the issue? – 87543r53w Oct 29 '22 at 13:24
  • Please post the definition of `have_posts()`, `get_post_meta(...)`, and `the_post()`. – Dai Oct 29 '22 at 13:34
  • Thank you, replaced, appreciate the help – 87543r53w Oct 29 '22 at 14:09
  • Advisement: [Why check both isset() and !empty()](https://stackoverflow.com/a/4559976/2943403) Topical: [set post per page using get_post_meta](https://stackoverflow.com/q/52602397/2943403) – mickmackusa Oct 29 '22 at 14:20
  • Seems topical: [CMB2 Filelist type paginate results (uses get_post_meta)](https://stackoverflow.com/q/35454938/2943403) – mickmackusa Oct 29 '22 at 14:28
  • Would you advise a bit more please? Thank you again – 87543r53w Oct 29 '22 at 14:30
  • I have tried to set post per page, it is not helping, still only pulling in the first 30 or so records from the database – 87543r53w Oct 29 '22 at 16:00

0 Answers0