windhamdavid 2 years ago
parent
commit
37449a531b
3 changed files with 346 additions and 0 deletions
  1. 84 0
      404.php
  2. 228 0
      search.php
  3. 34 0
      style.css

+ 84 - 0
404.php

@@ -0,0 +1,84 @@
+<?php
+	if ( !defined('ABSPATH') ){ die(); }
+	
+	global $avia_config;
+
+	/*
+	 * get_header is a basic wordpress function, used to retrieve the header.php file in your theme directory.
+	 */
+	 get_header();
+
+
+	 echo avia_title(array('title' => __('Error 404 - page not found', 'avia_framework')));
+	 
+	 do_action( 'ava_after_main_title' );
+	?>
+
+
+		<div class='container_wrap container_wrap_first main_color <?php avia_layout_class( 'main' ); ?>'>
+			
+			<?php 
+				do_action('avia_404_extra'); // allows user to hook into 404 page fr extra functionallity. eg: send mail that page is missing, output additional information
+			?>
+			
+			<div class='container'>
+
+				<main class='template-page content <?php avia_layout_class( 'content' ); ?> units' <?php avia_markup_helper(array('context' => 'content'));?>>
+
+
+                    <div class="entry entry-content-wrapper clearfix" id='search-fail'>
+
+							<p class='entry-content'><strong><?php _e('Nothing Found', 'avia_framework'); ?></strong><br/>
+
+							<?php _e('Sorry, what you are looking for is not available. Maybe you want to perform a search?', 'avia_framework'); ?>
+							</p>
+							<?php
+
+									if(isset($_GET['post_type']) && $_GET['post_type'] == 'product' && function_exists('get_product_search_form'))
+									{
+										get_product_search_form();
+									}
+									else
+									{
+										get_search_form();
+									}
+
+							?>
+
+
+
+							<div class='hr_invisible'></div>
+
+							<section class="404_recommendation">
+							    <p><?php _e('For best search results, mind the following suggestions:', 'avia_framework'); ?></p>
+							    <ul class='borderlist-not'>
+							        <li><?php _e('Always double check your spelling.', 'avia_framework'); ?></li>
+							        <li><?php _e('Try similar keywords, for example: tablet instead of laptop.', 'avia_framework'); ?></li>
+							        <li><?php _e('Try using more than one keyword.', 'avia_framework'); ?></li>
+							    </ul>
+
+							    <div class='hr_invisible'></div>
+
+
+							</section>
+                    </div>
+
+				<!--end content-->
+				</main>
+
+				<?php
+
+				//get the sidebar
+				$avia_config['currently_viewing'] = 'page';
+				get_sidebar();
+
+				?>
+
+			</div><!--end container-->
+
+		</div><!-- close default .container_wrap element -->
+
+
+
+
+<?php get_footer(); ?>

+ 228 - 0
search.php

@@ -0,0 +1,228 @@
+<?php
+	if ( !defined('ABSPATH') ){ die(); }
+	
+	global $avia_config;
+
+
+	/*
+	 * get_header is a basic wordpress function, used to retrieve the header.php file in your theme directory.
+	 */
+	 get_header();
+	 
+	 //	allows to customize the layout
+	 do_action( 'ava_search_after_get_header' );
+
+
+	 $results = avia_which_archive();
+	 echo avia_title(array('title' => $results ));
+	 
+	 do_action( 'ava_after_main_title' );
+	 ?>
+
+		<div class='container_wrap container_wrap_first main_color <?php avia_layout_class( 'main' ); ?>'>
+
+			<div class='container'>
+
+				<main class='content template-search <?php avia_layout_class( 'content' ); ?> units' <?php avia_markup_helper(array('context' => 'content'));?>>
+
+                    <div class='page-heading-container clearfix'>
+                        <section class="search_form_field">
+                            <?php
+                            echo "<h4>".__('New Search','avia_framework')."</h4>";
+                            echo "<p>".__('If you are not happy with the results below please do another search','avia_framework')."</p>";
+
+                            get_search_form();
+                            echo "<span class='author-extra-border'></span>";
+                            ?>
+                        </section>
+                    </div>
+
+
+                    <?php
+                    if(!empty($_GET['s']) || have_posts())
+                    {
+                        echo "<h4 class='extra-mini-title widgettitle'>{$results}</h4>";
+
+                        /* Run the loop to output the posts.
+                        * If you want to overload this in a child theme then include a file
+                        * called loop-search.php and that will be used instead.
+                        */
+                        $more = 0;
+                        //get_template_part( 'includes/loop', 'search' );
+
+                    }
+
+                    ?>
+					
+					<?php
+
+
+					// check if we got posts to display:
+					if (have_posts()) :
+						$first = true;
+
+						$counterclass = "";
+						$post_loop_count = 1;
+						$page = (get_query_var('paged')) ? get_query_var('paged') : 1;
+						if($page > 1) $post_loop_count = ((int) ($page - 1) * (int) get_query_var('posts_per_page')) +1;
+						$blog_style = avia_get_option('blog_style','multi-big');
+
+						while ( have_posts() ) : the_post();
+
+
+						$the_id 		= get_the_ID();
+						$parity			= $post_loop_count % 2 ? 'odd' : 'even';
+						$last           = count($wp_query->posts) == $post_loop_count ? " post-entry-last " : "";
+						$post_class 	= "post-entry-".$the_id." post-loop-".$post_loop_count." post-parity-".$parity.$last." ".$blog_style;
+						$post_format 	= get_post_format() ? get_post_format() : 'standard';
+
+						?>
+
+						<article <?php post_class('post-entry post-entry-type-'.$post_format . " " . $post_class . " "); avia_markup_helper(array('context' => 'entry')); ?>>
+					        <div class="entry-content-wrapper clearfix <?php echo $post_format; ?>-content">
+
+					            <header class="entry-content-header">
+					                <?php
+					                echo "<span class='search-result-counter {$counterclass}'>{$post_loop_count}</span>";
+					                //echo the post title
+					                $markup = avia_markup_helper(array('context' => 'entry_title','echo'=>false));
+					                echo "<h2 class='post-title entry-title'><a title='".the_title_attribute('echo=0')."' href='".get_permalink()."' $markup>".get_the_title()."</a></h2>";
+
+					                ?>
+					                <span class='post-meta-infos'>
+					                    <time class='date-container minor-meta updated' <?php avia_markup_helper(array('context' => 'entry_time')); ?>>
+					                        <!--<?php the_time('d M Y'); ?>-->
+					                    </time>
+					                    <?php
+					                    if(get_post_type() !== "page")
+					                    {
+					                        if ( get_comments_number() != "0" || comments_open() )
+					                        {
+					                            echo "<span class='text-sep'>/</span>";
+					                            echo "<span class='comment-container minor-meta'>";
+					                            comments_popup_link(  "0 ".__('Comments','avia_framework'),
+					                                                  "1 ".__('Comment' ,'avia_framework'),
+					                                                  "% ".__('Comments','avia_framework'),'comments-link',
+					                                                  "".__('Comments Disabled','avia_framework'));
+					                            echo "</span>";
+					                        }
+					                    }
+
+
+					                    $taxonomies  = get_object_taxonomies(get_post_type($the_id));
+					                    $cats = '';
+										$excluded_taxonomies = array_merge( get_taxonomies( array( 'public' => false ) ), array('post_tag','post_format') );
+										$excluded_taxonomies = apply_filters('avf_exclude_taxonomies', $excluded_taxonomies, get_post_type($the_id), $the_id);
+					
+					                    if(!empty($taxonomies))
+					                    {
+					                        foreach($taxonomies as $taxonomy)
+					                        {
+					                            if(!in_array($taxonomy, $excluded_taxonomies))
+					                            {
+					                                $cats .= get_the_term_list($the_id, $taxonomy, '', ', ','').' ';
+					                            }
+					                        }
+					                    }
+
+					                    if(!empty($cats))
+					                    {
+					                        echo "<span class='text-sep'> </span>";
+					                        echo '<span class="blog-categories">'.__('','avia_framework')." ";
+					                        echo $cats;
+					                        echo '</span>';
+					                    }
+
+					                    ?>
+
+					                </span>
+					            </header>
+
+					            <?php
+					                echo '<div class="entry-content" '.avia_markup_helper(array('context' => 'entry_content','echo'=>false)).'>';
+					                $excerpt = trim(get_the_excerpt());
+					                if(!empty($excerpt))
+					                {
+					                    //the_excerpt();
+					                }
+					                else
+					                {
+					                    $excerpt = strip_shortcodes( get_the_content() );
+					                    $excerpt = apply_filters('the_excerpt', $excerpt);
+					                    $excerpt = str_replace(']]>', ']]&gt;', $excerpt);
+					                    echo $excerpt;
+					                }
+					                echo '</div>';
+					            ?>
+					        </div>
+
+					        <footer class="entry-footer"></footer>
+        
+					        <?php do_action('ava_after_content', $the_id, 'loop-search'); ?>
+						</article><!--end post-entry-->
+
+						<?php
+
+
+							$first = false;
+							$post_loop_count++;
+							if($post_loop_count >= 100) $counterclass = "nowidth";
+						endwhile;
+						else:
+
+
+					?>
+
+						<article class="entry entry-content-wrapper clearfix" id='search-fail'>
+					            <p class="entry-content" <?php avia_markup_helper(array('context' => 'entry_content')); ?>>
+					                <strong><?php _e('Nothing Found', 'avia_framework'); ?></strong><br/>
+					               <?php _e('Sorry, no posts matched your criteria. Please try another search', 'avia_framework'); ?>
+					            </p>
+
+					            <div class='hr_invisible'></div>
+
+					            <section class="search_not_found">
+					                <p><?php _e('You might want to consider some of our suggestions to get better results:', 'avia_framework'); ?></p>
+					                <ul>
+					                    <li><?php _e('Check your spelling.', 'avia_framework'); ?></li>
+					                    <li><?php _e('Try a similar keyword, for example: tablet instead of laptop.', 'avia_framework'); ?></li>
+					                    <li><?php _e('Try using more than one keyword.', 'avia_framework'); ?></li>
+					                </ul>
+
+					                <div class='hr_invisible'></div>
+					                <h3 class=''><?php _e('Feel like browsing some posts instead?', 'avia_framework'); ?></h3>
+
+					        <?php
+					        the_widget('avia_combo_widget', 'error404widget', array('widget_id'=>'arbitrary-instance-'.$id,
+					                'before_widget' => '<div class="widget avia_combo_widget">',
+					                'after_widget' => '</div>',
+					                'before_title' => '<h3 class="widgettitle">',
+					                'after_title' => '</h3>'
+					            ));
+					        echo '</section>';
+						echo "</article>";
+
+						endif;
+						echo avia_pagination('', 'nav');
+					?>
+
+				<!--end content-->
+				</main>
+
+				<?php
+
+				//get the sidebar
+				$avia_config['currently_viewing'] = 'page';
+
+				get_sidebar();
+
+				?>
+
+			</div><!--end container-->
+
+		</div><!-- close default .container_wrap element -->
+
+
+
+
+<?php get_footer(); ?>

+ 34 - 0
style.css

@@ -0,0 +1,34 @@
+/*
+Theme Name: SRH Child
+Description: A Child Theme for the Enfold Theme at SelfRegional.org
+Version: 1.0
+Author: windhamdavid
+Author URI: https://davidawindham.com
+Template: enfold
+*/
+
+.alternate_color, 
+.alternate_color, 
+#top .alternate_color.title_container .main-title,
+#top .alternate_color.title_container .main-title a {
+	font-size: 22px;
+	line-height: 2.0em;
+	font-weight: 700;
+	color: #0d77bd;
+}
+
+.blog-author{
+	display: none;
+}
+
+#top #s {
+	width:100%;position: 
+	relative;padding: 8px 47px 11px 5px;
+	z-index: 1;
+	margin:0;
+	box-shadow: none;
+}
+
+.phys-thumb {
+	max-width:175px;
+}