Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter jbbala85

    (@jbbala85)

    hi,

    i am getting the same issue when i try to integrate the same into the live site.

    Live Site: https://www.peterboroughpublichealth.ca/?s=pets

    what i did:

    1. installed and activated the “Relevanssi – A Better Search” plugin
    2. replaced the search template with new template file that you given

    It shows the same error that the test website showed, now the test site seems to be working fine.. (https://pph.addrenhost4.com/?s=pets)

    Thread Starter jbbala85

    (@jbbala85)

    ok thanks a lot and i will let you know how its working..

    regards,
    jay

    Thread Starter jbbala85

    (@jbbala85)

    hi,

    thanks a lot for your reply..

    i have replaced the search template with the new version file that you given but still not working..

    have a look at this link: https://pph.addrenhost4.com/search-results/?s=pets

    please help me on this whats going wrong?

    regards,
    Jay

    Thread Starter jbbala85

    (@jbbala85)

    hi,

    Thanks a lot for your reply, i have changed the search term parameter to s (https://pph.addrenhost4.com/search-results/?s=pets)

    here i have attaching my search template – download this zip file and see (https://pph.addrenhost4.com/search.zip) or full code below

    
    <?php
    /* Template Name: Search Results */
    ?>
    <?php get_header(); ?>
    
        <main>
    
        <!-- secondary navigation-->
        <div class="horizontal-bar secondary-navigation">
    
            <div class="container">
                <nav class="navbar navbar-default bannerBttmCustomNav" role="navigation">
                    <!-- Brand and toggle get grouped for better mobile display -->
                    <div class="navbar-header">
                        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex2-collapse">
                            <span class="sr-only">Toggle navigation</span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                        </button>
                    </div>
    
                    <!-- Collect the nav links, forms, and other content for toggling -->
                    <div class="collapse navbar-collapse navbar-ex2-collapse" id="bannerBttm">
                        <ul id="bannerBttmNav">
    
                            <?php
                            wp_nav_menu( array(
                                    'menu'              => 'subnav',
                                    'theme_location'    => 'subnav',
                                    'depth'             => 3,
                                    'menu_class'        => 'nav navbar-nav bannerBttmNavigation',
                                    'fallback_cb'       => 'wp_bootstrap_navwalker::fallback',
                                    'container'         => false,
                                    'walker'            => new WP_Bootstrap_Navwalker()
                                )
                            );
                            ?>	
    
                        </ul>
                    </div><!-- /.navbar-collapse -->
                </nav>
            </div>
    
        </div>
        <!-- ./ secondary navigation-->
    
            <!--Main layout-->
            <div class="container" style="padding:40px; line-height:30px;">
    
            
    
                <!--page contents-->
    
                <div class="row">
                    <!--Main column-->
                    <div class="col-sm-12 col-md-12 col-lg-12" style="font-size:16px">
                    <?php
    					if (function_exists('zeno_font_resizer_place')) {
    						zeno_font_resizer_place();
    					}
    				?>				
                        	<div class="entry-content-page">
                                <!--<h3>Search Results</h3>-->
                                	
                                    
    							<?php
                                wp_reset_query();
                                $s=get_search_query();
                                $args = array(
                                                's' =>$s
                                            );
                                    // The Query
                                $the_query = new WP_Query( $args );
                                if ( $the_query->have_posts() ) {
                                        _e("<h3>Search Results for: ".get_query_var('s')."</h3>");
                                        while ( $the_query->have_posts() ) {
                                           $the_query->the_post();
                                                 ?>
                                                     <h4><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4>
                               						 <p><?php $content = get_the_content(); $content = strip_tags($content); echo mb_strimwidth($content, 0, 100, '... '); ?></p>
                                                 <?php
                                        }
                                    }else{
                                ?>
                                        <h2 style='font-weight:bold;color:#000'>Nothing Found</h2>
                                        <div class="alert alert-info">
                                          <p>Sorry, but nothing matched your search criteria. Please try again with some different keywords.</p>
                                        </div>
                                <?php } ?>                                
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                            </div>               
    
                    
                    		<hr/>
                            
                            
    
                            
                            
    					<?php
                        // TO SHOW THE PAGE CONTENTS
                           foreach(getPostsData($_GET['q']) as $post){
    					?>	   
                                <h4>
                                	<a href="/<?php echo get_page_uri($post->ID) ?>">
                                    	<?php echo $post->post_title ?>
                                    </a>
                                </h4>
                                <p>
                                	<?php echo truncateMe($post->post_excerpt,200) ?>
                                </p>
                                <hr />
                                 
    
                            <?php
    					   }//resetting the page loop
                        wp_reset_query(); //resetting the page query
                        ?>
                        
                        
                    </div>
                    <!--Main column-->
                    
    <?php /*?>                
                    <!-- right sidebar-->
                    <div class="col-sm-12 col-md-12 col-lg-4" style="font-size:16px">
                        <div id="sidebar">
    		                <?php if ( is_active_sidebar( 'page-side-bar' ) ) : ?>
    			                <?php dynamic_sidebar( 'page-side-bar' ); ?>
                            <?php else: ?>
                                <h5>No Widget Add On Page Sidebar</h5>
    		                <?php endif; ?>
                        </div>
                    </div>
                     <!-- ./right sidebar-->
    
    <?php */?>
                </div>
            </div>
            <!--/.Main layout-->
        </main>
    
        <div class="footer-section">
            <div class="footer subFooterMenu">
                <div class="container">
                    <div class="col-xs-12 col-sm-12 col-md-12 col-lg-3 footer-one">
                        <h5>Health Topics</h5>
                        <ul>
    						<?php
    						wp_nav_menu( array(
    							'menu'              => 'footermenu1',
    							'theme_location'    => 'footermenu1',
    							'depth'             => 1
    						));
    						?>
                        </ul>
                    </div>
                    <div class="col-xs-12 col-sm-12 col-md-12 col-lg-3 footer-two">
                        <h5>For Professionals</h5>
                        <ul>
    						<?php
    						wp_nav_menu( array(
    							'menu'              => 'footermenu2',
    							'theme_location'    => 'footermenu2',
    							'depth'             => 1
    						));
    						?>
                        </ul>
                    </div>
                    <div class="col-xs-12 col-sm-12 col-md-12 col-lg-3 footer-three">
                        <h5>Clinics</h5>
                        <ul>
    						<?php
    						wp_nav_menu( array(
    							'menu'              => 'footermenu3',
    							'theme_location'    => 'footermenu3',
    							'depth'             => 1
    						));
    						?>
                        </ul>
                    </div>
                    <div class="col-xs-12 col-sm-12 col-md-12 col-lg-3 footer-four">
                        <h5>Classes</h5>
                        <ul>
    						<?php
    						wp_nav_menu( array(
    							'menu'              => 'footermenu4',
    							'theme_location'    => 'footermenu4',
    							'depth'             => 1
    						));
    						?>
                        </ul>
                    </div>
    
                    <div class="clearfix"></div>
                </div>
            </div>
    
        </div>
    
    <?php get_footer(); ?>
    
    Thread Starter jbbala85

    (@jbbala85)

    ok, thanks a lot.. it was what i need… one more thing.. how to place a read more text linked to the event?

    Thread Starter jbbala85

    (@jbbala85)

    – They are smaller than 20 characters
    – Don’t contain weird characters
    – Are not one of the reserved words

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