WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Search Everything] Doesn't search my custom fields (22 posts)

  1. nr2012
    Member
    Posted 2 years ago #

    Although I've checked the option to search my meta-data the search still doesnt work on terms which are present in my custom fields.
    Does anybody know how I could achieve this?

    I am using the latest Plugin-Version and the latest WordPress and I'm working right now locally with MAMP on a Mac.

    I hope somebody can help me out here!

    Thanks already.

  2. nr2012
    Member
    Posted 2 years ago #

    I tried this again, but I could not get it to work.
    Nobody a clue?

  3. zhiwan
    Member
    Posted 2 years ago #

    I desperately want to know as well. This is the main reason I downloaded this. Are there any alternatives to this plugin that people recommend? Or a developer can at least enlighten us on this function? Thanks!

  4. sokratesagogo
    Member
    Posted 2 years ago #

    Just tried it and it works for me..

    By default, the "Search every custom field:" value on the "settings > search everything" page is not enabled. Forgive me for asking, but can you confirm that you have enabled this and saved the settings?

    If that still doesn't work, disable all other plugins and test again.

    Good luck, Sok

  5. nr2012
    Member
    Posted 2 years ago #

    yap, sure good u asking, could safe a lot of trouble. but I have it indeed enabled!
    I'll try the disabling of all plugins as soon as I can and get back here.
    thx

    ---
    I have only custom field templates and nextgen gallery activated
    nothing else.
    I haven't tried deactivating it, because I have to do that locally, but can anybody deny that these two plugins have a negative effect on the search everything plugin?

  6. sokratesagogo
    Member
    Posted 2 years ago #

    The custom fields template sounds like a suspect - what is the link to the plugin?

  7. nr2012
    Member
    Posted 2 years ago #

    well here it is:

    http://wordpress.org/extend/plugins/custom-field-template/

    but it just predefines some custom fields. The creation of custom fields is just normal (they also appear below each post, as they would without the plugin)...

  8. sokratesagogo
    Member
    Posted 2 years ago #

    Which version of the custom field template plugin are you using? I've just tried version 1.9.9 and it works with search everything

  9. nr2012
    Member
    Posted 2 years ago #

    ah I just see there was an update.
    I will load that and retry...

  10. sokratesagogo
    Member
    Posted 2 years ago #

    Fingers-crossed :) I've just tried NextGen gallery 1.92 and that isn't causing any problems either..

  11. nr2012
    Member
    Posted 2 years ago #

    Ohhh it seems to find something. But it doesnt get listed in my search results...
    I just says it found one. I have to check my code on the listing of the results...

    Do you by the way know what I have to look at to list all items?

  12. sokratesagogo
    Member
    Posted 2 years ago #

    Do you have a search.php in your theme?

  13. nr2012
    Member
    Posted 2 years ago #

    Yes I do.
    I made it by myself and I just checked the code:
    I have some specific code if the result is in a specific category (omitted below) but I mainly just say this:

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    	<div class="searchresult">
    
    		<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> 
    
    			<?php the_excerpt(); ?>
    
    	</div>
    
    <?php endwhile;
    wp_reset_query(); ?>

    Should this not be enough to list the results?

    I know there was something found because of this:

    <?php
    	if ($total_results == 1){
    		echo 'wurde 1 Suchresultat';
    	}else{
    		echo 'wurden ' . $total_results . ' Suchresultate ';
    	}?>
    	für <span>"<?php echo the_search_query(); ?>"</span> gefunden.</h1><br />

    Its German and it says just that either one search result was found or X results were found.

    If I search for some text just appearing in one custom field, I get the message that 1 result was found, but nothing is displayed below...

  14. nr2012
    Member
    Posted 2 years ago #

    well of course I have this in front:

    <?php
    	global $wp_query;
    	$total_results = $wp_query->found_posts;
    ?>
  15. sokratesagogo
    Member
    Posted 2 years ago #

    Backup your search.php and try the default code on this Codex page:

    http://codex.wordpress.org/Creating_a_Search_Page

  16. nr2012
    Member
    Posted 2 years ago #

    with the 'default code' you mean that little fragment here:

    <?php
    global $query_string;
    
    $query_args = explode("&", $query_string);
    $search_query = array();
    
    foreach($query_args as $key => $string) {
    	$query_split = explode("=", $string);
    	$search_query[$query_split[0]] = urldecode($query_split[1]);
    } // foreach
    
    $search = new WP_Query($search_query);
    ?>

    this won't show me anything in html right?
    where exactly are my results in?
    in the $search right?
    thats a new query then...

  17. nr2012
    Member
    Posted 2 years ago #

    Ok I added the code above to perform a new query.
    After that I think the
    codeline

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    and the following

    should actually list all the foudn things right?

    Therefore I just added the query-performing code above from the site you indicated right before this line. this would overwrite any query performed, right?

    But I still won't get anything listed there...

  18. nr2012
    Member
    Posted 2 years ago #

    [Code moderated as per the Forum Rules. Please use the pastebin]

    Here would be my full codefragment important to this issue here...

    +the whole thing between $cat and } else { can acutally be ignored. thats just some special thing to link authors to the authorpage to their div and not to the author-post itself...

  19. sokratesagogo
    Member
    Posted 2 years ago #

    Have you created a search-results page template as described on that codex page?

  20. nr2012
    Member
    Posted 2 years ago #

    Have you created a search-results page template as described on that codex page?

    Thats what 'search.php' is, right?

    Some include a search.php template file. This is not a Search Page, it is merely a template that displays the search results.

  21. sokratesagogo
    Member
    Posted 2 years ago #

    I'm sorry - getting my pants in a twist - you are right

  22. nr2012
    Member
    Posted 2 years ago #

    on that codex page there is also a lot about 'searchpage.php' which I dont have and dont need...
    Maybe thats a little confusing here.

    But anyway. with all the other searches it works.
    So I think my searchquery and everything is not wrong here.

    The following part with ..if have posts, while posts... babla
    should reveal all posts (and pages) of that query, right?

    In my example I have a page with several custom fields displayed:

    http://www.literaturundkunst.net/impressum/

    If I search for 'ZKBKCHZZ80A' which is some content of a custom field in this page (at the bottom of the page) I get this result;¨

    http://www.literaturundkunst.net/?s=ZKBKCHZZ80A

    Which says that 1 result was found but it would not get displayed...

    If I perform some other searches it works quite nicely..

Topic Closed

This topic has been closed to new replies.

About this Topic