Tagged: search results
Viewing 3 posts - 1 through 3 (of 3 total)
-
AuthorPosts
-
August 17, 2014 at 1:29 pm #305427
Hi there,
First of all, amazing theme with endless possibilities.
I’m working for a client who’s site i’m transforming to WP with Enfold as theme. The special thing is, it needs to be a 1:1 copy of the original site.
I’ve got it for 95%, only running in to 2 little problems.
1: Search result page need to be changed from a 1/1 layout to a 1/2 (empty) | 1/4 (results) | 1/2 (static image).
2: On the page with no results, i want to remove the line *searchresults for: searchterm*
Could you guys give me a hand.
Current code of Search.php
<?php global $avia_config; /* * get_header is a basic wordpress function, used to retrieve the header.php file in your theme directory. */ get_header(); $results = avia_which_archive(); echo avia_title(array('title' => $results )); ?> <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'));?>> <?php echo "<h2>".__('Zoekresultaten')."</h2>"; ?> <?php if(!empty($_GET['s']) || have_posts()) { /* 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' ); echo "<h4 class='extra-mini-title widgettitle'>{$results}</h4>"; } ?> <!--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(); ?>
Current code of loop-search.php
<?php global $avia_config; // 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 = apply_filters('avf_exclude_taxonomies', array('post_tag','post_format'), 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 minor-meta">'.__('in','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(']]>', ']]>', $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')); ?>> <?php _e('De zoekopdracht heeft geen resultaten opgeleverd.'); ?> </p> <?php echo "</article>"; endif; echo avia_pagination('', 'nav'); ?>
Kind regards,
MarcAugust 17, 2014 at 9:15 pm #305493Layout problem solved:
<?php global $avia_config; /* * get_header is a basic wordpress function, used to retrieve the header.php file in your theme directory. */ get_header(); $results = avia_which_archive(); echo avia_title(array('title' => $results )); ?> <div class='container_wrap container_wrap_first main_color <?php avia_layout_class( 'main' ); ?>'> <div class='container'> <div class="flex_column av_one_fourth first avia-builder-el-0 el_before_av_one_half avia-builder-el-first "> </div> <div class="flex_column av_one_half avia-builder-el-2 el_after_av_one_fourth el_before_av_one_fourth "> <main class='content template-search <?php avia_layout_class( 'content' ); ?> units' <?php avia_markup_helper(array('context' => 'content'));?>> <?php echo "<h2>".__('Zoekresultaten')."</h2>"; ?> <?php if(!empty($_GET['s']) || have_posts()) { /* 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' ); echo "<h4 class='extra-mini-title widgettitle'>{$results}</h4>"; } ?> <!--end content--> </main> </div> <div class="flex_column av_one_fourth avia-builder-el-4 el_after_av_one_half avia-builder-el-last "> <div class="avia-image-container av-styling- avia-builder-el-5 avia-builder-el-no-sibling avia-align-center " itemscope="itemscope" itemtype="https://schema.org/ImageObject"><div class="avia-image-container-inner"><img class="avia_image " src="http://yourwebsite/image.jpg" alt="" title="isbn-search" itemprop="contentURL"></div></div> </div> </div><!-- close default .container_wrap element --> </div><!--end container--> <?php get_footer(); ?>
- This reply was modified 10 years, 4 months ago by m00n.
August 18, 2014 at 10:59 am #305613 -
AuthorPosts
Viewing 3 posts - 1 through 3 (of 3 total)
- The topic ‘Changing layout Search Results’ is closed to new replies.