search result page

March 2014 WordPress Theme
GK User
Thu Aug 06, 2015 2:41 am
I want to customize the search result page,
order positioning of image, title, text, number of characters.
Which file do I have to customize?
User avatar
Junior Boarder

GK User
Thu Aug 06, 2015 8:37 am
Hello,

Please check News2/search.php file. This file loads content-archive.php (used for tags,category,search etc.) file with article layout, so you have to create another file i.e. content-search.php and modify the layout.
User avatar
Moderator

GK User
Fri Aug 07, 2015 3:24 pm
Thanks.

I could not change number of characters in <section class="summary"> of search result page.

I changed this code on line 36 in content-archive.php
Code: Select all
<?php the_excerpt(); ?>

to this code (I use japanese)
Code: Select all
<?php echo mb_substr(get_the_excerpt(), 0, 150); ?>


Could you give any advices what can I do with this?
User avatar
Junior Boarder

GK User
Sun Aug 09, 2015 7:52 pm
Could you send me a private message with your website backend and FTP access? Then I'll be able to check the issue.
User avatar
Moderator

GK User
Tue Aug 11, 2015 4:31 pm
Thanks.
I emailed you.
User avatar
Junior Boarder

GK User
Sat Aug 15, 2015 1:30 am
Did you check my site?
I've been waiting for your comment.
Could you please give me a comment?
User avatar
Junior Boarder

GK User
Mon Aug 17, 2015 7:32 am
Hi,

Yes, I've answered you via PM.

"Do you have any cache plugin activated? Because even if i remove the "summary" section - it's still visible on your search resulsts page: ...

BTW I've added your modification into my News2 theme installation and it works properly."
User avatar
Moderator

GK User
Tue Aug 18, 2015 10:39 am
Do you have any cache plugin activated? Because even if i remove the "summary" section - it's still visible on your search resulsts page: ...


Now if you do that, it'll disappear on search results page.

It seems to be limited to 16 characters in this theme.
User avatar
Junior Boarder

GK User
Tue Aug 18, 2015 11:33 am
The code responsible for the excerpt length is placed in News2/gavern/filters.php file: (by default is set to 55)
Code: Select all
// Change Excerpt length
function gavern_excerpt_length( $length ) {
   global $gk_tpl;
    return get_option($gk_tpl->name . '_excerpt_len', 55);
}

add_filter( 'excerpt_length', 'gavern_excerpt_length', 999 );

and it's connected with News2 template options.
User avatar
Moderator

GK User
Sat Aug 22, 2015 4:13 am
Thank you.
When I deleted that code, the number of words changed.

By the way, I wanna know how to customize layout of search results page of this theme too.
Now it has 2 columns, I wanna change it to 1 column.
Do you have any good solutions in regards to that?
Thanks. :)
User avatar
Junior Boarder

GK User
Mon Aug 24, 2015 9:32 am
Hi,

Please go to News -> Template Options -> Features tab and change "Columns for other archive views" option to "1 column"
User avatar
Moderator

GK User
Mon Aug 24, 2015 6:07 pm
Thanks. :)

How can I change display order of the following code?
<figure class="featured-image">
<header>
<section class="summary">
User avatar
Junior Boarder

GK User
Tue Aug 25, 2015 7:53 am
Hi,

Please check content-archive.php file
the figure is generated by this line:
Code: Select all
<?php get_template_part( 'layouts/content.post.featured' ); ?>


the header is next and then the summary, you can move these parts, but please move them (i.e. the summary) with required "if" conditions.
User avatar
Moderator


cron