Title: andre77's Replies | WordPress.org

---

# andre77

  [  ](https://wordpress.org/support/users/andre77/)

 *   [Profile](https://wordpress.org/support/users/andre77/)
 *   [Topics Started](https://wordpress.org/support/users/andre77/topics/)
 *   [Replies Created](https://wordpress.org/support/users/andre77/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/andre77/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/andre77/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/andre77/engagements/)
 *   [Favorites](https://wordpress.org/support/users/andre77/favorites/)

 Search replies:

## Forum Replies Created

Viewing 15 replies - 1 through 15 (of 24 total)

1 [2](https://wordpress.org/support/users/andre77/replies/page/2/?output_format=md)
[→](https://wordpress.org/support/users/andre77/replies/page/2/?output_format=md)

 *   Forum: [Alpha/Beta/RC](https://wordpress.org/support/forum/alphabeta/)
    In 
   reply to: [How will migration to 3.3 effect permalink structure?](https://wordpress.org/support/topic/how-will-migration-to-33-effect-permalink-structure/)
 *  Thread Starter [andre77](https://wordpress.org/support/users/andre77/)
 * (@andre77)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/how-will-migration-to-33-effect-permalink-structure/#post-2400259)
 * Thanks for you reply! I’ll just have to wait and see then. Hope you are right,-)
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [w3 Total Cache is still present after uninstall!](https://wordpress.org/support/topic/w3-total-cache-is-still-present-after-uninstall/)
 *  Thread Starter [andre77](https://wordpress.org/support/users/andre77/)
 * (@andre77)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/w3-total-cache-is-still-present-after-uninstall/#post-2177016)
 * Hi tgeorge!
 * You were right. There was still a lot of Total Cache code in the .htaccess. I
   don’t see any mentioning of Total cache anymore when using Firebug – so I guess
   this did the trick.
 * Thanks for the help!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Relevanssi - A Better Search] How to separate page and post search results?](https://wordpress.org/support/topic/how-to-separate-page-and-post-search-results/)
 *  Thread Starter [andre77](https://wordpress.org/support/users/andre77/)
 * (@andre77)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/how-to-separate-page-and-post-search-results/#post-2121441)
 * Thanks for your help msaari! We got it to work now 🙂
 * Here is the code we used, if someone else is looking for the same thing:
 * Put these modification in the “loop.php”-file:
 * Before the loop starts:
 * `$previous_post_type = 'page'; //Sets the parameter for the first post that will
   turn up in the search result`
 * You also would put in a header before the loop starts that says something like:
 * `
    <h3>Search results for pages</h3>
 * If you are using the default WordPress theme “twentyten”, find the line where
   it says “/* How to display all other posts. */. and modify the code as below:
 * `
    ... <?php else : ?> <?php if ( $previous_post_type == 'page' && $post->post_type
   == 'post') echo '<h3>Search results for blog posts</h3>'; ?> <div id="post-<?
   php the_ID(); ?>" <?php post_class(); ?> <h2 class="entry-title"> ...
 * The post type is then checked at the end of the loop, to see if it has changed
   from page to post. Put this code right before “endwhile”:
 * `
    <?php $previous_post_type = $post->post_type;?> <?php endwhile; // End the
   loop. Whew. ?>
 * And this code goes into functions.php:
 * `
    /* Relevansi hit filter - customization of search results: */ add_filter( '
   relevanssi_hits_filter', 'my_hits_filter' );
 * function my_hits_filter( $data )
    { $hits = $data[0]; $pages = array(); $posts
   = array(); foreach ( $hits as $key => $hit ) { if ( 'page' == $hit->post_type){
   $pages[] = $hit; } else if ('post' == $hit->post_type ) { $posts[] = $hit; } }
 *  $filtered_hits = array_merge($pages, $posts);
    $filtered_data = array( $filtered_hits,
   $data[1] ); return $filtered_data; }
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Relevanssi - A Better Search] How to separate page and post search results?](https://wordpress.org/support/topic/how-to-separate-page-and-post-search-results/)
 *  Thread Starter [andre77](https://wordpress.org/support/users/andre77/)
 * (@andre77)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/how-to-separate-page-and-post-search-results/#post-2121432)
 * Hey again msaari!
 * I recently got a hold of a php-programmer, so now I have reasonable hope that
   we will figure this thing out. But we still have some questions:
 * In what page would you use the ‘relevanssi_hits_filter? Would you use it in search.
   php? In the code you supplied there is an add_filter call and its belonging function,
   but where would you make the add_filter call?
 * How do I access the search results array? In search.php they are only displayed
   with:
    get_template_part( ‘loop’, ‘search’ );
 * Regards,
    André
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [How to display selected database content in different lists?](https://wordpress.org/support/topic/how-to-display-selected-database-content-in-different-lists/)
 *  Thread Starter [andre77](https://wordpress.org/support/users/andre77/)
 * (@andre77)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/how-to-display-selected-database-content-in-different-lists/#post-2146250)
 * Thanks for your reply! Indeed Pods CSM seems to provide everything I was hoping
   for ,-) It will take me a while to look into it, as it had so many possibilities!
 * Regards,
 * André
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [How can I make flash content to NOT reload on every page?](https://wordpress.org/support/topic/how-can-i-make-flash-content-to-not-reload-on-every-page/)
 *  Thread Starter [andre77](https://wordpress.org/support/users/andre77/)
 * (@andre77)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/how-can-i-make-flash-content-to-not-reload-on-every-page/#post-2141744)
 * Hi Peter!
 * I hand’t updated the forum webpage, so I didn’t realize that you had posted an
   answer. As you mention, I came to the same conclusion…
 * Yes, I would happy if I didn’t have to use the flash. But I am afraid, I am not
   in charge of the layout decision making…And flash is currently the only option
   I have found to accomplish what they want.
 * And as I also mentioned, I am not fond of having to use frames. So if there is
   someone out there, who has another suggestion – then by all means, share with
   me ,-)
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [How can I make flash content to NOT reload on every page?](https://wordpress.org/support/topic/how-can-i-make-flash-content-to-not-reload-on-every-page/)
 *  Thread Starter [andre77](https://wordpress.org/support/users/andre77/)
 * (@andre77)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/how-can-i-make-flash-content-to-not-reload-on-every-page/#post-2141743)
 * I tried out an “embedded” iframe solution, but realize now that it of course 
   doesnt solve the problem – as using wordpress/php means that every page gets 
   build/generated from scratch. I guess that leaves the option of setting up the
   site in an overall framework (using “frames”) – but that is not a good solution
   as I see it, because that would mean that the structure gets complex because 
   this menu is kind of in the middle of the page. That would mean that if I crate
   a frame (loading fram a separate webpage) for the flash menu, the other wordpress
   content gets divided by the frame in the middle.
 * Is there no way to tell the wordpress engine to NOT reload certain parts of a
   page…?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Relevanssi - A Better Search] How to separate page and post search results?](https://wordpress.org/support/topic/how-to-separate-page-and-post-search-results/)
 *  Thread Starter [andre77](https://wordpress.org/support/users/andre77/)
 * (@andre77)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/how-to-separate-page-and-post-search-results/#post-2121383)
 * Ok msaari!
 * But would that allow me to display headers prior to post-type. For example: “
   Search results for pages” and further down “Search results for blog posts”?
 * Is there someone else around here, that has done similar thing in their project,
   that can provide me some code?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Relevanssi - A Better Search] How to separate page and post search results?](https://wordpress.org/support/topic/how-to-separate-page-and-post-search-results/)
 *  Thread Starter [andre77](https://wordpress.org/support/users/andre77/)
 * (@andre77)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/how-to-separate-page-and-post-search-results/#post-2121272)
 * Hi msaari!
 * Thanks for your reply! I checked out the links you provided, and it really sounds
   like the answer I was hoping for! However I am still in the process of trying
   to get a grip of php, so I am bit lost when it comes to putting this solution
   into practice…
 * Could you give me an example code on how I would get the search result, to first
   display all hits for pages, and then for blog posts?
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [How to add parent page title in search result listing?](https://wordpress.org/support/topic/how-to-add-parent-page-title-in-search-result-listing/)
 *  Thread Starter [andre77](https://wordpress.org/support/users/andre77/)
 * (@andre77)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/how-to-add-parent-page-title-in-search-result-listing/#post-2121227)
 * Ooopss, Sorry! Disregard my latest post completely! I accidentally put it in 
   the wrong thread (belongs to another active question of mine here on the WordPress
   forum).
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [How to add parent page title in search result listing?](https://wordpress.org/support/topic/how-to-add-parent-page-title-in-search-result-listing/)
 *  Thread Starter [andre77](https://wordpress.org/support/users/andre77/)
 * (@andre77)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/how-to-add-parent-page-title-in-search-result-listing/#post-2121111)
 * Hmm, I noticed that Relevanssi is still working partially with the setup with
   two custom wp-loops. I just assumed that it wasn’t working as the search results
   is not highlighting any words any more. But I can see in admin-panel that user
   searches are still being logged.
 * Any idea how to get the highlighting working again?
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Error message= "Warning: in_array() expects parameter 2 to be array, null given"](https://wordpress.org/support/topic/error-message-warning-in_array-expects-parameter-2-to-be-array-null-given/)
 *  Thread Starter [andre77](https://wordpress.org/support/users/andre77/)
 * (@andre77)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/error-message-warning-in_array-expects-parameter-2-to-be-array-null-given/page/2/#post-2107870)
 * Hey David!
 * Sorry for the late reply, been away for some days. Using custom meta fields is
   an idea that I didnt think of. That could give the administrative users more 
   flexibility, but if such a high flexibility isn’t needed, then I guess it would
   also result in a slightly more administrative work – as every new sub page would
   need have to have a custom field assigned to it to display the appropriate sidebar.
 * But I guess the possibilities are quite many if you know all the ropes of WordPress/
   PHP.
 * But the initial question/problem has been solved – thanks to your good effort
   🙂
 * Kind regards,
 * André
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Error message= "Warning: in_array() expects parameter 2 to be array, null given"](https://wordpress.org/support/topic/error-message-warning-in_array-expects-parameter-2-to-be-array-null-given/)
 *  Thread Starter [andre77](https://wordpress.org/support/users/andre77/)
 * (@andre77)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/error-message-warning-in_array-expects-parameter-2-to-be-array-null-given/#post-2107830)
 * David : I read through your post again and I realize that I am not using the 
   code at all as you described it with:
 * Page 7 ancestors = 0 Will now not error or show headline
    Page 27 ancestors =
   array(25,11,7) Show headline = 25 in array Page 25 ancestors = array(11,7) Show
   headline = page id 25 Page 37 ancestors = array(24,17,7) Do not show headline
   = page id 25 not in array
 * But the last code I provided, works for displaying specific sidebars, for parent
   pages, and their ancestors (dont ask me how ,-)
 * But your example, would basically mean that every ancestors page ID would have
   to be hardcoded in the sidebar.php, which is not a good idea for practical reasons.
   The future administrators of this webpage need to be able to create new subpages
   in the admin panel, without having to make any change in the php-code.
 * So the code function, as I see it would have to be described as:
 * “if on this specific page > or any of its ancestor pages > then show this sidebar”
 * In that case, only the top level, parent pages, would have to have its ID in 
   the sidebar – and then the administrators can create as many ancestor pages as
   they want because the code would be applied to them as well.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Error message= "Warning: in_array() expects parameter 2 to be array, null given"](https://wordpress.org/support/topic/error-message-warning-in_array-expects-parameter-2-to-be-array-null-given/)
 *  Thread Starter [andre77](https://wordpress.org/support/users/andre77/)
 * (@andre77)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/error-message-warning-in_array-expects-parameter-2-to-be-array-null-given/#post-2107829)
 * Missed out, that a code cant be pasted right on. So hopefully the code get put
   in this time…
 * _[Code moderated as per the [Forum Rules](http://codex.wordpress.org/Forum_Welcome).
   Please use the [pastebin](http://wordpress.pastebin.com/)]_
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Error message= "Warning: in_array() expects parameter 2 to be array, null given"](https://wordpress.org/support/topic/error-message-warning-in_array-expects-parameter-2-to-be-array-null-given/)
 *  Thread Starter [andre77](https://wordpress.org/support/users/andre77/)
 * (@andre77)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/error-message-warning-in_array-expects-parameter-2-to-be-array-null-given/#post-2107818)
 * Thank you people, for your good explanations! I can’t say I understand all the
   details yet, but I am working on it ,-)
 * I was real happy to see that your code has eliminated the array error message!
   I can now load every page (almost), and their subpages – and the corresponding
   sidebar gets loaded as well. But for some reason, when it comes to the “blog”-
   page, the corresponding sidebar for that page ID doesnt load. Instead wordpress
   just loads the “else”-statement for the blog page. See bottom of code, the blog
   page has the ID 159, and is configured in the reading settings as the “posts 
   page”. If I instead configure the reading settings so that I no longer have page
   159 as the “posts page”, the code works – and the correct sidebar gets loaded.
   So the problem has obviously something to do with what WordPress puts into the
   concept of the “posts page”.
 * Any idea what to do?
 * _[Code moderated as per the [Forum Rules](http://codex.wordpress.org/Forum_Welcome).
   Please use the [pastebin](http://wordpress.pastebin.com/)]_

Viewing 15 replies - 1 through 15 (of 24 total)

1 [2](https://wordpress.org/support/users/andre77/replies/page/2/?output_format=md)
[→](https://wordpress.org/support/users/andre77/replies/page/2/?output_format=md)