Title: superuntitled's Replies | WordPress.org

---

# superuntitled

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

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

 Search replies:

## Forum Replies Created

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

 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Counting the number of images in a post](https://wordpress.org/support/topic/counting-the-number-of-images-in-a-post/)
 *  [superuntitled](https://wordpress.org/support/users/superuntitled/)
 * (@superuntitled)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/counting-the-number-of-images-in-a-post/#post-2450730)
 * Try this:
 *     ```
       $pid=get_the_ID();
       $images =& get_children( "post_type=attachment&post_mime_type=image&post_parent=$pid" );
       $count = count($images);
       ```
   
 * I think the code you were using is querying an old version of the wp database.
   Also, when using $wpdb->get_var, you need to declare `global $wpdb`
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Media gallery empty after update](https://wordpress.org/support/topic/media-gallery-empty-after-update/)
 *  Thread Starter [superuntitled](https://wordpress.org/support/users/superuntitled/)
 * (@superuntitled)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/media-gallery-empty-after-update/#post-2218841)
 * Nothing is being listed in the Media Library at all. However, when I uploaded
   images today, the images did populate the Media Library and the [gallery] displayed
   the new images just fine.
 * So, it is only an issue with images that were uploaded previously (sometime last
   year).
 * Thanks for your assistance.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [3.0.2 Upgrade Problems in Admin (Posts, Add New)](https://wordpress.org/support/topic/302-upgrade-problems-in-admin-posts-add-new/)
 *  [superuntitled](https://wordpress.org/support/users/superuntitled/)
 * (@superuntitled)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/302-upgrade-problems-in-admin-posts-add-new/#post-1804128)
 * You could try to repair you wp_posts table. This seems to have worked for some
   folks.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [3.0.2 Upgrade Problems in Admin (Posts, Add New)](https://wordpress.org/support/topic/302-upgrade-problems-in-admin-posts-add-new/)
 *  [superuntitled](https://wordpress.org/support/users/superuntitled/)
 * (@superuntitled)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/302-upgrade-problems-in-admin-posts-add-new/#post-1804122)
 * Yes, this just happened to me as well, on all of the wordpress installs on my
   Media Temple server.
 * I had to delete code in the .htaccess file and delete several files that started
   with PE*
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [In wordPress comment loop: link to author template page](https://wordpress.org/support/topic/in-wordpress-comment-loop-link-to-author-template-page/)
 *  Thread Starter [superuntitled](https://wordpress.org/support/users/superuntitled/)
 * (@superuntitled)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/in-wordpress-comment-loop-link-to-author-template-page/#post-1773230)
 * I figured it out.
 *     ```
       <?php
       $aid = $comment->user_id;
       $urlHome =get_bloginfo('template_directory');
       	if($aid !=  '0'){
       	echo "<a href='http://yworlds.com/portal/?author=$aid'>";
       	echo get_avatar( $aid, 70,  $default = $urlHome . '/images/navitar.jpg' );
       	echo "</a>";
       	}
       	else echo get_avatar( $aid, 70,  $default = $urlHome . '/images/navitar.jpg' );
       ?>
       ```
   
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [Function like 'is_child_of_category'](https://wordpress.org/support/topic/function-like-is_child_of_category/)
 *  Thread Starter [superuntitled](https://wordpress.org/support/users/superuntitled/)
 * (@superuntitled)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/function-like-is_child_of_category/#post-1716244)
 * thanks, a combination of both i think:
 * first a function to get the category id:
 *     ```
       function getCurrentCatID(){
       global $wp_query;
       if(is_category() || is_single()){
       $cat_ID = get_query_var('cat');
       }
       return $cat_ID;
       }
       ```
   
 * Next use `cat_is_ancestor_of`
 *     ```
       $post = $wp_query->post;
       $id = getCurrentCatID();
   
       if ( cat_is_ancestor_of(3, $id) { include(TEMPLATEPATH . '/unique.php'); }
       ```
   
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [[Plugin: Add Local Avatar] Avatar upload and Customize Your Community plugin](https://wordpress.org/support/topic/plugin-add-local-avatar-avatar-upload-and-customize-your-community-plugin/)
 *  [superuntitled](https://wordpress.org/support/users/superuntitled/)
 * (@superuntitled)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/plugin-add-local-avatar-avatar-upload-and-customize-your-community-plugin/#post-1182114)
 * The above solution is wrong. It causes other troubles. I think this is correct.
   Around line 630…
 *  // Display the profile’s avatar.
    if ( !$user_id ) { $current_user = wp_get_current_user();
   $user_id = $current_user->ID; } echo get_avatar( $user_id, 30 );
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [[Plugin: Add Local Avatar] Avatar upload and Customize Your Community plugin](https://wordpress.org/support/topic/plugin-add-local-avatar-avatar-upload-and-customize-your-community-plugin/)
 *  [superuntitled](https://wordpress.org/support/users/superuntitled/)
 * (@superuntitled)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/plugin-add-local-avatar-avatar-upload-and-customize-your-community-plugin/#post-1182113)
 * I have added the code
 *     ```
       if ( IS_PROFILE_PAGE ) {
       		$current_user = wp_get_current_user();
       		$uid = $current_user->ID;
       	}
       ```
   
 * somewhere near the top of the page, and around line 177 I changed the code to
 *     ```
       // Try to use local avatar.
       	if($uid) {
       		$local = get_usermeta($uid, 'avatar');
       		if(!empty($local)) $src = $local;
       	}
       ```
   
 * and now everything is fine. For some reason the code for the current user_id 
   was not working right.

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