Tagged: x
-
AuthorPosts
-
March 1, 2017 at 10:57 am #1390561
childrenscancerParticipantHi,
I’ve been working on our new site and would like to customize the search results page. There are two things I’m hoping you might be able to help me with…
1. How do I get page results to show up like post results? Right now, the page results just include the title of the page. Post results however have the first few lines of the post and a link to read more.
2. My second question is how do I make the title of each search result a link to the article? Right now the only way you can get to the result is by clicking “read more”. I’d like them to be able to click on the title as well.
Thank you!
March 1, 2017 at 11:31 am #1390629
RahulModeratorHey There,
Thanks for writing in!
To assist you with this issue, we’ll first need you to provide us with your URL. This is to ensure that we can provide you with a tailored answer to your situation. Once you have provided us with your URL, we will be happy to assist you with everything.
March 1, 2017 at 12:59 pm #1390756
childrenscancerParticipantThis reply has been marked as private.March 1, 2017 at 1:12 pm #1390763
childrenscancerParticipantHere’s an example of a search results page:
http://dev.childrenscancer.org/?s=leukemia
As you’ll see a few of the results only have a title – those are pages. Posts are displaying a title, meta, description, and read more.
March 1, 2017 at 8:56 pm #1391322
Rue NelModeratorHello There,
Thanks for updating in! This happens because normal pages doesn’t have an excerpt by default. To be able to have an excerpts for pages, please follow this link: http://www.wpbeginner.com/plugins/add-excerpts-to-your-pages-in-wordpress/
Hope this helps.
March 2, 2017 at 9:32 am #1391973
childrenscancerParticipantThat helps part of the problem – thank you. The other part is that the titles don’t link to the articles. How do I make sure all search results have titles that link to that page?
Thanks!
March 2, 2017 at 11:22 am #1392108
childrenscancerParticipantHi, I read the link you posted and added that bit of code to the functions.php file on my child theme, but it didn’t seem to add an excerpt to the search results. Any other ideas?
March 2, 2017 at 6:56 pm #1392718
RadModeratorHi there,
You need to manually add excerpt to those pages. It only add excerpt for page type since it’s originally doesn’t have the excerpt, page is different from post. Edit those page and find Screen Option on top of the page, then make sure Excerpt is toggled on, then scroll down and find Excerpt section and manually add your text excerpt.
About the title with no links, it’s because of your custom content.php. Please change it to this
<?php // ============================================================================= // VIEWS/INTEGRITY/CONTENT.PHP // ----------------------------------------------------------------------------- // Standard post output for Integrity. // ============================================================================= ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <?php if( is_singular() ) : ?> <h1 class="blog-title"><?php the_title(); ?></h1> <?php else : ?> <a href="<?php the_permalink(); ?>"><h2 class="blog-title"><?php the_title(); ?></h2></a> <?php endif; ?> <div class="entry-featured"> <?php x_featured_image(); ?> </div> <?php x_integrity_entry_meta(); ?> <div class="entry-wrap"> <?php x_get_view( 'global', '_content' ); ?> </div> <?php x_get_view( 'integrity', '_content', 'post-footer' ); ?> </article>Hope this helps.
March 3, 2017 at 8:20 am #1393277
childrenscancerParticipantThat was really helpful. Everything is working well now. Thank you!
March 3, 2017 at 9:09 am #1393357
RahulModeratorGlad to hear it!
Feel free to ask us again if you have any further queries regarding the X-theme.
Thanks.
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1390561 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
