Ben Dunkle
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Thumbnails wont enlargeJavascript error: document.body is null.
There might be a problem with your jquery file.
Try taking out line 19. Replace it with a link to google’s jquery library, or put it in your theme folder and link to it there. HTHForum: Fixing WordPress
In reply to: setting a class on ul and li tags.yourClass li ul li { / *insert rules here */ }
You should be able to target nested li’s as far in as you need to with this method.
Forum: Fixing WordPress
In reply to: How do I know which is my default page to put on Google Analytics?Put your google analytics in your footer.php file, right before the </body> tag
Forum: Fixing WordPress
In reply to: setting a class on ul and li tagshtml/php:
<ul class="yourClass"> <?php wp_list_pages('title_li='); ?> </ul>
CSS:
.yourClass li { /* insert rules here */ }
Forum: Plugins
In reply to: Sorting authors by last nameCan you get authors by wp_category and sort by last_name?
Like:
SELECT user_id FROM $wpdb->usermeta WHERE meta_key = 'wp_capabilities' AND meta_value RLIKE $this_role) ORDER BY last_name ASC
which doesn’t work, and neither does
SELECT user_id FROM $wpdb->usermeta WHERE meta_key = 'wp_capabilities' AND meta_value RLIKE $this_role) ORDER BY $wpdb.usermeta.last_name ASC
Forum: Fixing WordPress
In reply to: List users by last name, limit to a specific role, include avatarOK, I’m almost there. I have
$roles = array('artist', 'featured_artist'); /* Loop through users to search for the admin and editor users. */ foreach( $roles as $role ){ // all users with admin or editor role if($role == 'artist' || $role == 'featured_artist') { $this_role = "'[[:<:]]".$role."[[:>:]]'"; $query = "SELECT * FROM $wpdb->users WHERE ID = ANY (SELECT user_id FROM $wpdb->usermeta WHERE meta_key = 'wp_capabilities' AND meta_value RLIKE $this_role) ORDER BY user_nicename ASC LIMIT 10000"; $users_of_this_role = $wpdb->get_results($query); if ($users_of_this_role){ foreach($users_of_this_role as $user){ $curuser = get_userdata($user->ID); $avatar = get_avatar($user); $author_post_url=get_author_posts_url($curuser->ID, $curuser->nicename); echo '<ul class="author">'; echo $avatar.'<li><a href="' . $author_post_url . '" title="' .$curuser->display_name.'">' . $curuser->display_name . '</a></li>' . "\n"; echo '</ul>'; } } } }
and I need to sort that by author lastname.
OK, so the plugin is showing the username I guess? I was able to get it to show First/Last name by changing what is says under “Display name publicly as” to the first/last name as hammer suggested-(thanks, now I get what you mean!). That works, but unfortunately it doesn’t display in alphabetical order by last name. Is there a way to configure this plugin to show the first/last name of the user, instead of the display name, and sort by last name?
Forum: Fixing WordPress
In reply to: Get a user’s role by user IDThanks greenshady, this code is very handy.
Also, if you don’t want to hard-code the user’s id, you can use this:$curauth = $wp_query->get_queried_object(); $user_id = $curauth->ID; $user = new WP_User( $user_id ); if ( !empty( $user->roles ) && is_array( $user->roles ) ) { foreach ( $user->roles as $role ) echo $role; }
Forum: Fixing WordPress
In reply to: Get role and/or capabilities of authorThanks SS-I’ve looked over the codexes and lots of threads, but I’m still having trouble. I basically need something like,
is_author_category …
I’ve tried this:
global $current_user;
$current_user = wp_get_current_user();
$var = the_author_meta(‘user_level’,$current_user);but that always shows 10, even if I’m logged out and no matter what capabilities are assigned to the author.
Hammer, I don’t see that as an option. Here’s what I get when I edit the widget:
https://imgur.com/n35Ej.jpgWhat am I doing wrong?
Thanks jhover, but I’m trying to do this using the author avatar plugin. It only works as a widget, and you have to select options after you drag it into a sidebar.
Forum: Fixing WordPress
In reply to: Developing multi user site. Should I wait for wp3?Thanks for the info, I’ll play with the multisite stuff in my alpha install to see what I need.
Forum: Plugins
In reply to: [Plugin: Events Calendar] Do not update! 12-12-09Vangrog-it’s at https://www.myrohto.com/news_beta.php
Thanks for looking into it.Forum: Plugins
In reply to: [Plugin: Events Calendar] Do not update! 12-12-09Hi guys I tried updating the plugin with the patched files but I can’t get the tooltips to work or even the events to show up. Firfox’s error console just says “Error:ecd is not defined”. I deactivated the plugin, deleted the entire events-calendar folder from the plugins dir, downloaded the patch from the 4shared link, unzipped it, moved all the files from the FIXED.ec-beta6.6-patched into the parent events-calendar folder, uploaded it to my plugins dir, reavtivated the plugin, made sure
“jQuery Extrem Protection (checked = yes) (Check if you don’t see the Tooltips)” was checked in the options screen, and I still get the error. SidebarEventsCalendar(); displays a blank calendar and SidebarEventsList(); lists the events, so something is working.Forum: Plugins
In reply to: Shadowbox not working in themeI’m having the same problem. It works in default and classic, just not in my custom theme. The header.php files in my custom and in the classic/default theme have the same code, and I can’t imagine what else I could change to make it work.