Title: macelfresh's Replies | WordPress.org

---

# macelfresh

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

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

 Search replies:

## Forum Replies Created

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

 *   Forum: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
   
   In reply to: [Exclude from search, the text containd in a specific div ?](https://wordpress.org/support/topic/exclude-from-search-the-text-containd-in-a-specific-div/)
 *  [macelfresh](https://wordpress.org/support/users/macelfresh/)
 * (@macelfresh)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/exclude-from-search-the-text-containd-in-a-specific-div/#post-2515739)
 * Sorry I’ve never used it.
    What I’d do, which is a pain in the ass – I’m aware
   of that – is to make my own search function and SQL query, at least I’d get what
   I want as the output.
 *   Forum: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
   
   In reply to: [Exclude from search, the text containd in a specific div ?](https://wordpress.org/support/topic/exclude-from-search-the-text-containd-in-a-specific-div/)
 *  [macelfresh](https://wordpress.org/support/users/macelfresh/)
 * (@macelfresh)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/exclude-from-search-the-text-containd-in-a-specific-div/#post-2515733)
 * do you have an example somewhere?
 *   Forum: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
   
   In reply to: [Find this query](https://wordpress.org/support/topic/find-this-query/)
 *  [macelfresh](https://wordpress.org/support/users/macelfresh/)
 * (@macelfresh)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/find-this-query/#post-2512091)
 * notepad++?
 *   Forum: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
   
   In reply to: [Two Sites. Same Database. Similar Tables. C'est Posible'?](https://wordpress.org/support/topic/two-sites-same-database-similar-tables-cest-posible/)
 *  [macelfresh](https://wordpress.org/support/users/macelfresh/)
 * (@macelfresh)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/two-sites-same-database-similar-tables-cest-posible/#post-2515178)
 * you can select your database in wordpress, but more easily I think wordpress 
   3 now handles multisite install, a bit like drupal does : one install, a front
   personnalisation of the sub domain.
 * [http://codex.wordpress.org/Create_A_Network](http://codex.wordpress.org/Create_A_Network)
 * sinon c’est possible en français : [http://blog.lahaut.info/2010/06/installation-de-wordpress-en-multi-domaines/](http://blog.lahaut.info/2010/06/installation-de-wordpress-en-multi-domaines/)
 * cheers
 *   Forum: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
   
   In reply to: [Exclude from search, the text containd in a specific div ?](https://wordpress.org/support/topic/exclude-from-search-the-text-containd-in-a-specific-div/)
 *  [macelfresh](https://wordpress.org/support/users/macelfresh/)
 * (@macelfresh)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/exclude-from-search-the-text-containd-in-a-specific-div/#post-2515716)
 * You could trim the result or if you do a print_r of your variable (use
    < pre
   > markup) maybe you can retrieve the “raw” info of what your looking for. I do
   that with Drupal.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [save_post how to find post_id?](https://wordpress.org/support/topic/save_post-how-to-find-post_id/)
 *  Thread Starter [macelfresh](https://wordpress.org/support/users/macelfresh/)
 * (@macelfresh)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/save_post-how-to-find-post_id/#post-1350168)
 * Hi,
 * sorry I didn’t reply before, I didn’t have time to work on that again.
 * Thanks for the answer, it now works !
 * Tout de bon
 * Mac
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [Dynamic Pagination using $count](https://wordpress.org/support/topic/dynamic-pagination-using-count/)
 *  [macelfresh](https://wordpress.org/support/users/macelfresh/)
 * (@macelfresh)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/dynamic-pagination-using-count/#post-1349440)
 * Hi,
 * I used something like this, to display hashes
 *     ```
       <?php
                       //will hold hashes of posts, by index in their cat
                       $hash = Array();
       		$args=array(
       				'orderby' => 'count'
       		);
                       $i = 0;
                       //will hold cat ID and count of posts in it
       		$nb_prj_cat = Array();
                       //find all categories
       		foreach((get_categories($args)) as $category) {
       			//desired cat
       			if(($category->cat_ID == 5) || ($category->cat_ID == 6)){
       //count posts in cat
       				$nb_post = $category->category_count;
       				//how many projects in cat
                                       $nb_prj_cat[$i] = array($category->cat_ID , $nb_post);
                                       //initiate hash
       				$hash[$i] = 0;
       				$i++;
       				//echo $nb_post;
       				//echo $category->cat_ID;
       			}
       		}
       ```
   
 *     ```
       <?php if (have_posts()) :  while (have_posts()) : the_post(); ?>
   
       			<?php
       //we read it for each post
       //retrieve categories of post
       			$cat = wp_get_post_categories($post->ID, $args);
                             //read category considering its amount of posts
                              for($i = 0; $i < count($nb_prj_cat[$i]); $i++){
       							//if cat of the post == one of the categories above
                                      if ($cat[0] == $nb_prj_cat[$i][0]){
       					$hash[$i]++;
                                               display html...
       ```
   
 * I guess this works for a little amount of categories, and a bit abstract because
   of the 3 arrays, but maybe you can inspire from it somehow

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