Title: slee's Replies | WordPress.org

---

# slee

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

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

 Search replies:

## Forum Replies Created

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

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

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Per Page Sidebars] [Plugin: Per Page Sidebars] Custom post type – page side bars](https://wordpress.org/support/topic/plugin-per-page-sidebars-custom-post-type-page-side-bars/)
 *  [slee](https://wordpress.org/support/users/slee/)
 * (@slee)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/plugin-per-page-sidebars-custom-post-type-page-side-bars/#post-1939320)
 * +1 for this for me as well
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [using meta_query to query a custom field using OR](https://wordpress.org/support/topic/using-meta_query-to-query-a-custom-field-using-or/)
 *  Thread Starter [slee](https://wordpress.org/support/users/slee/)
 * (@slee)
 * [15 years ago](https://wordpress.org/support/topic/using-meta_query-to-query-a-custom-field-using-or/#post-2208463)
 * |It seems it is because I am using the ‘s’ to search as well tat it stops the
   custom field search. if i remove the ‘s’ => $kewords from the $args then it works
   but then obviously doesnt search the titels or content.
 * How can I have both together?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [list custom post type by taxonomy](https://wordpress.org/support/topic/list-custom-post-type-by-taxonomy/)
 *  Thread Starter [slee](https://wordpress.org/support/users/slee/)
 * (@slee)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/list-custom-post-type-by-taxonomy/#post-1962937)
 * Hi osby here is the code I used:
 *     ```
       $post_type = 'post_type_name';
       $tax = 'taxonomy_name';
       $tax_terms = get_terms($tax);
       if ($tax_terms) {
         foreach ($tax_terms  as $tax_term) {
           $args=array(
             'post_type' => $post_type,
             "$tax" => $tax_term->slug,
             'post_status' => 'publish',
             'posts_per_page' => -1,
             'caller_get_posts'=> 1
           );
   
           $my_query = null;
           $my_query = new WP_Query($args);
           if( $my_query->have_posts() ) {
             echo '<h3 class="divisions">'. $tax_term->name . '</h3>';
       	  echo '<ul class="team-members">';
             while ($my_query->have_posts()) : $my_query->the_post(); ?>
                <li>
                <h4 class="team-member"><?php the_title(); ?></h4>
                <?php if(has_post_thumbnail()) { ?>
               <span class="alignleft"><?php the_post_thumbnail(); ?></span>
               <?php } the_content(); ?>
               </li>
               <?php
             endwhile;
       	  echo '</ul>';
           }
           wp_reset_query();
         }
       }
       ```
   
 * I hope this helps 🙂
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [Show specific Custom Post Type Excerpt on single.php](https://wordpress.org/support/topic/show-specific-custom-post-type-excerpt-on-singlephp/)
 *  Thread Starter [slee](https://wordpress.org/support/users/slee/)
 * (@slee)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/show-specific-custom-post-type-excerpt-on-singlephp/#post-1778953)
 * I managed to do it using wp_query
 *   Forum: [Alpha/Beta/RC](https://wordpress.org/support/forum/alphabeta/)
    In 
   reply to: [Beta tester plug-in downgraded my version?](https://wordpress.org/support/topic/beta-tester-plug-in-downgraded-my-version/)
 *  [slee](https://wordpress.org/support/users/slee/)
 * (@slee)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/beta-tester-plug-in-downgraded-my-version/#post-1485602)
 * I had the same thing as lupinehorror. As i have it running on latest site i just
   did the upgrade and it did upgrade me so there seems to be an error with the 
   alert
 *   Forum: [Requests and Feedback](https://wordpress.org/support/forum/requests-and-feedback/)
   
   In reply to: [Relative URL for local images request](https://wordpress.org/support/topic/relative-url-for-local-images-request/)
 *  [slee](https://wordpress.org/support/users/slee/)
 * (@slee)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/relative-url-for-local-images-request/#post-1179402)
 * any news on this? i would really like this as well
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [drop down with only years with posts](https://wordpress.org/support/topic/drop-down-with-only-years-with-posts/)
 *  Thread Starter [slee](https://wordpress.org/support/users/slee/)
 * (@slee)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/drop-down-with-only-years-with-posts/#post-1262196)
 * thanks for the link but unfortunately it is not quite what i was after.
    i want
   to have a drop down of only years so 2006, 2008, 2009 etc for those years that
   have posts.
 * i may also want to have a drop down of months for that year as well that have
   posts.
 *   Forum: [Everything else WordPress](https://wordpress.org/support/forum/miscellaneous/)
   
   In reply to: [Permalink and paging](https://wordpress.org/support/topic/permalink-and-paging/)
 *  [slee](https://wordpress.org/support/users/slee/)
 * (@slee)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/permalink-and-paging/#post-1256020)
 * just wanted to say thanks as i was having the same problem but could not find
   the answer then i stumbled on this page. worked perfectly!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [get_pages in functions.php problem](https://wordpress.org/support/topic/get_pages-in-functionsphp-problem/)
 *  Thread Starter [slee](https://wordpress.org/support/users/slee/)
 * (@slee)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/get_pages-in-functionsphp-problem/#post-1251900)
 * thanks so much for your help i got it work 🙂
    using this:
 *     ```
       $triplistarray = array();
       $tripparent = 2;
       $args=array(
         'child_of' => $tripparent,
       );
       $gettrips = get_pages($args);
       if (@count($gettrips)) {
         foreach($gettrips as $trip) {
       	if ($trip->post_parent != $tripparent ) {
       		 array_push($triplistarray,$trip->ID);
       	}
         } // foreach($pages
       } // if ($pages
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [get_pages in functions.php problem](https://wordpress.org/support/topic/get_pages-in-functionsphp-problem/)
 *  Thread Starter [slee](https://wordpress.org/support/users/slee/)
 * (@slee)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/get_pages-in-functionsphp-problem/#post-1251889)
 * the only problem i am having is getting the data from the post in this:
 *     ```
       $triplistarray = array();
       $tripparent = 2;
       $args=array(
         'child_of' => $tripparent,
       );
       $gettrips = get_pages($args);
       if (@count($gettrips)) {
         foreach($gettrips as $post) {
       	$parentid=$trip->post_parent;
       	if ($trip->ID !== $parentid ) {
       		 array_push($triplistarray,$post->ID);
       	}
         } // foreach($pages
       } // if ($pages
       ```
   
 * i need to get the parent id as it goes through the loop and also the title to
   be used in the dropdown
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [get_pages in functions.php problem](https://wordpress.org/support/topic/get_pages-in-functionsphp-problem/)
 *  Thread Starter [slee](https://wordpress.org/support/users/slee/)
 * (@slee)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/get_pages-in-functionsphp-problem/#post-1251881)
 * essentially i am creating a custom write panel that has a dropdown in it with
   a list of the grandchildren pages that you helped me with before. the idea is
   that someone can submit a post in the report category and can then assign the
   report to a trip using the id into a custom field. the above code is being used
   to get the list of grandchildren from the top parent (the grandparent). however
   since this is now in the function file and inside a function it isn’t getting
   the post data such as the parent id and title.
 * here is all the code:
 *     ```
       $new_meta_boxes =
       array(
       "triplist" => array(
       "type" => "select",
       "std" => "",
       "name" => "asigntrip",
       "title" => "Assign Trip",
       "description" => "")
       ); 
   
       function new_meta_boxes() {
       	global $post, $new_meta_boxes;
   
       $triplistarray = array();
       $tripparent = 2;
       $args=array(
         'child_of' => $tripparent,
       );
       $gettrips = get_pages($args);
       if (@count($gettrips)) {
         foreach($gettrips as $post) {
       	$parentid=$trip->post_parent;
       	if ($trip->ID !== $parentid ) {
       		 array_push($triplistarray,$post->ID);
       	}
         } // foreach($pages
       } // if ($pages
   
       	foreach($new_meta_boxes as $meta_box) {
   
       		echo'<input type="hidden" name="'.$meta_box['name'].'_noncename" id="'.$meta_box['name'].'_noncename" value="'.wp_create_nonce( plugin_basename(__FILE__) ).'" />';
   
       		echo'<h2>'.$meta_box['title'].'</h2>';
   
       		if( $meta_box['type'] == "text" ) { 
   
       			$meta_box_value = get_post_meta($post->ID, $meta_box['name'].'_value', true);
   
       			if($meta_box_value == "")
       				$meta_box_value = $meta_box['std'];
   
       			echo'<input type="text" name="'.$meta_box['name'].'_value" value="'.$meta_box_value.'" size="55" />';
   
       		} elseif ( $meta_box['type'] == "select" ) {
   
       			echo'<select name="'.$meta_box['name'].'_value">';
       			echo'<option value="">select trip</option>';
       			foreach ($triplistarray as $option) {
   
       				if ( get_post_meta($post->ID, $meta_box['name'].'_value', true) == $option ) {
       					$sel =  ' selected="selected"';
       				} elseif ( $option == $meta_box['std'] ) {
       					$sel = ' selected="selected"';
       				}
       				echo'<option value="'.$option.'"'. $sel .'>'. $post->post_title .'</option>';
   
       			}
   
       			echo'</select>';
   
       		}
   
       		echo'<p><label for="'.$meta_box['name'].'_value">'.$meta_box['description'].'</label></p>';
       	}
       }
   
       function create_meta_box() {
       global $theme_name;
       if (function_exists('add_meta_box') ) {
       add_meta_box( 'new-meta-
       boxes', 'More Info', 'new_meta_boxes', 'post', 'normal', 'high' );
       }
       }
   
       function save_postdata( $post_id ) {
       global $post, $new_meta_boxes;
       foreach($new_meta_boxes as $meta_box) {  
   
       // Verify
       if ( !wp_verify_nonce( $_POST[$meta_box['name'].'_noncename'], plugin_basename(__FILE__) )) {
       return $post_id;
       }  
   
       if ( 'page' == $_POST['post_type'] ) {
       if ( !current_user_can( 'edit_page', $post_id ))
       return $post_id;
       } else {
       if ( !current_user_can( 'edit_post', $post_id ))
       return $post_id;
       }  
   
       $data = $_POST[$meta_box['name'].'_value'];  
   
       if(get_post_meta($post_id, $meta_box['name'].'_value') == "")
       add_post_meta($post_id, $meta_box['name'].'_value', $data, true);
       elseif($data != get_post_meta($post_id, $meta_box['name'].'_value', true))
       update_post_meta($post_id, $meta_box['name'].'_value', $data);
       elseif($data == "")
       delete_post_meta($post_id, $meta_box['name'].'_value', get_post_meta($post_id, $meta_box['name'].'_value', true));
       }
       }
   
       add_action('admin_menu', 'create_meta_box');
       add_action('save_post', 'save_postdata');
       ```
   
 * i really appreciate your help
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [get_pages in functions.php problem](https://wordpress.org/support/topic/get_pages-in-functionsphp-problem/)
 *  Thread Starter [slee](https://wordpress.org/support/users/slee/)
 * (@slee)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/get_pages-in-functionsphp-problem/#post-1251851)
 * thanks for that you were right i managed to figure it out before you posted it.
 * ive got another problem though i tried using your code but it didnt fix it.
    
   basically i cant get the data from the post so i cant get the parentid for example.
   here is my code:
 *     ```
       $triplistarray = array();
       $tripparent = 2;
       $args=array(
         'child_of' => $tripparent,
       );
       $gettrips = get_pages($args);
       if (@count($gettrips)) {
         foreach($gettrips as $post) {
       	$parentid=$trip->post_parent;
       	if ($post->post_parent !== $parentid ) {
       		 array_push($triplistarray,$post->ID);
       	}
         } // foreach($pages
       } // if ($pages
       ```
   
 * so at the moment the `if ($post->post_parent !== $parentid ) {` doesnt work
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [show only grand children](https://wordpress.org/support/topic/show-only-grand-children/)
 *  Thread Starter [slee](https://wordpress.org/support/users/slee/)
 * (@slee)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/show-only-grand-children/#post-1242827)
 * i tried your code replacing he cf1 with location and greece for the value but
   nothing was outputted. when you tested it did you try it with the grandchildren?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [show only grand children](https://wordpress.org/support/topic/show-only-grand-children/)
 *  Thread Starter [slee](https://wordpress.org/support/users/slee/)
 * (@slee)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/show-only-grand-children/#post-1242718)
 * i have hit a problem with this, i want to be able to filter the results by using
   meta_key and meta_value but when i use the meta_value it does not work.
 * i have simply got `’meta_key’ => $key,
    ‘meta_value’ => $mvalue,`
 * which then using get capture the value but even if i hardcode them they don’t
   work.
    i have a custom field called location and i have 1 page with the value
   Greece but if i use meta_value greece with meta_key location nothing is outputted
   am i doing something wrong?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [show only grand children](https://wordpress.org/support/topic/show-only-grand-children/)
 *  Thread Starter [slee](https://wordpress.org/support/users/slee/)
 * (@slee)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/show-only-grand-children/#post-1242706)
 * ah it was because i still had:
 * ‘post_type’ => ‘page’,
 * which obviously isnt needed any more
 * thanks for the help 🙂

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

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