• Hey Everyone,

    So when I search something in the site I am building it finds pages no problem, but it isn’t suggesting any posts. For example I can see a post that has the word “research” in it. If I search that word, it says “no posts found”. I have tried plugins, disabling plugins, changing themes, and still nothing. I have also checked the posts themselves and made sure that they were set to public. I am thinking I have something in the settings somewhere. Can anyone assist?

    Thanks in advance!

Viewing 11 replies - 1 through 11 (of 11 total)
  • add this code in search.php

    $post_type = get_query_var( 'post_type' );
    
    if ( 'download' == $post_type )
    	locate_template( array( 'archive-download.php' ), true );
    else
    	locate_template( array( 'index.php' ), true );
    Thread Starter JprozS

    (@jprozs)

    Is there a specific place to put it? I put it at the very end and still no results.

    can you past the code that is already in search.php so i could see & tell you about require changes ?

    Thread Starter JprozS

    (@jprozs)

    well I am not sure search.php is it because I have tried multiple themes (all which have their own search.php) and the problem persists no matter what

    $post_type = get_query_var( 'post_type' );
    
    if ( 'download' == $post_type )
    	locate_template( array( 'archive-download.php' ), true );
    else
    	locate_template( array( 'index.php' ), true );

    you need to replace archive-download.php with you archive-download.php whatever the page name is…

    i need to see your theme search.php code so that i could assist you better

    Thread Starter JprozS

    (@jprozs)

    sure thing..

    (code originally sent and now removed)

    Try this plugin let me know if problem persists

    https://wordpress.org/plugins/search-everything/

    Thread Starter JprozS

    (@jprozs)

    Nope that doesn’t work. Even when I run the test. This is why I think something is up in the WP settings somewhere.

    try this plugin https://wordpress.org/plugins/wp-extended-search/

    Thread Starter JprozS

    (@jprozs)

    I tried that and it did not work either.

    I DID in fact find the solution though. What happened was someone copied and pasted the posts from WORD. Although it looked good, in plain text, many words had dashes in them so “research” actually in plain text looked like “re-search” which is why search couldn’t find it. Once I converted it back to plain text it worked like a charm.

    FYI I already told people not to copy and paste from Word but I guess they didn’t listen.

    Thank you so much for your assistance!

    You are welcome!

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘Search only finding pages and not posts’ is closed to new replies.