WordPress.org

Ready to get started?Download WordPress

Forums

Search results page does not show clickable title (7 posts)

  1. Nivo
    Member
    Posted 7 months ago #

    Hi,

    When a do a search on my site, the search result page only shows the non-clickable content of each page of my site. There are no page title. nothing is clickable.

    By the way, my site contains pages only, there's no post in case this is important.

    Any idea?

  2. shandiz
    Member
    Posted 7 months ago #

    hi

    edit your searchform.php file in theme editor

    http://codex.wordpress.org/Function_Reference/get_search_form

  3. Nivo
    Member
    Posted 7 months ago #

    Can I ask you what need to be modified in searchform.php?

    This is the only code there is:

    <form class="art-search" method="get" name="searchform" action="<?php bloginfo('url'); ?>/">
    
    	<input name="s" type="text" value="<?php echo esc_attr(get_search_query()); ?>" />
    
    	<input class="art-search-button" type="submit" value="<?php echo __('Search', THEME_NS); ?>" />
    
    </form>

    Thanks for your time!

  4. shandiz
    Member
    Posted 7 months ago #

    ok , that is true.
    if you don`t have search.php or searchpage.php , in page.php post titles should be link to the posts or "read more" link to posts.

  5. Nivo
    Member
    Posted 7 months ago #

    This is what I have in search.php

    <?php
    
    /**
    
     *
    
     * search.php
    
     *
    
     * The search results template. Used when a search is performed.
    
     *
    
     */
    
    get_header();
    
    ?>
    
    			<?php get_sidebar('top'); ?>
    
    			<?php
    
    			if (have_posts()) {
    
    				theme_post_wrapper(
    
    						array('content' => '<h4 class="box-title">' . sprintf(__('Search Results for: %s', THEME_NS), '<span class="search-query-string">' . get_search_query() . '</span>') . '</h4>'
    
    						)
    
    				);
    
    				/* Display navigation to next/previous pages when applicable */
    
    				if (theme_get_option('theme_top_posts_navigation')) {
    
    					theme_page_navigation();
    
    				}
    
    				/* Start the Loop */
    
    				while (have_posts()) {
    
    					the_post();
    
    					get_template_part('content', 'search');
    
    				}
    
    				/* Display navigation to next/previous pages when applicable */
    
    				if (theme_get_option('theme_bottom_posts_navigation')) {
    
    					theme_page_navigation();
    
    				}
    
    			} else {
    
    				theme_404_content(
    
    						array(
    
    							'error_title' => __('Nothing Found', THEME_NS),
    
    							'error_message' => __('Sorry, but nothing matched your search criteria. Please try again with some different keywords.', THEME_NS)
    
    						)
    
    				);
    
    			}
    
    			?>
    
    			<?php get_sidebar('bottom'); ?>
    
    <?php get_footer(); ?>

    I'm not a coder, but I can usally modify the code by myself, but this time I really dont know what to do.

    I dont want to be a pain but if you shandiz, or someone else, could give me a hint on what to do, that would be much appreciated.

  6. shandiz
    Member
    Posted 7 months ago #

    If the theme is not custom, you should first create a Child Theme, otherwise any changes made to original theme files will be overwritten once the theme updates.

    i think you should replace this line : (create backup before any change)
    get_template_part('content', 'search');

    with this :
    get_template_part('content', get_post_format());

  7. Nivo
    Member
    Posted 7 months ago #

    didn't work shandiz.

    Thanks anyway.

Reply

You must log in to post.

About this Topic

Tags

No tags yet.