superuntitled
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Counting the number of images in a postTry 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
In reply to: Media gallery empty after updateNothing 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
In reply to: 3.0.2 Upgrade Problems in Admin (Posts, Add New)You could try to repair you wp_posts table. This seems to have worked for some folks.
Forum: Fixing WordPress
In reply to: 3.0.2 Upgrade Problems in Admin (Posts, Add New)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
In reply to: In wordPress comment loop: link to author template pageI figured it out.
<?php $aid = $comment->user_id; $urlHome =get_bloginfo('template_directory'); if($aid != '0'){ echo "<a href='https://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
In reply to: Function like 'is_child_of_category'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'); }
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 );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.