jaredstein
Forum Replies Created
-
Forum: Plugins
In reply to: Getting a WP user’s roleUsing WP_User class is easier. First, grab the user info:
$ID=”2″;
$user = new WP_User($ID);Now you can grab the wp_capabilities array and do what you want with it.
E.g. test for a role capability:
if ($user->wp_capabilities[‘administrator’]==1) {
}E.g. print a list of user’s roles as an array:
print_r(array_keys($user->wp_capabilities,”1″));
Details on WP_user:
https://core.trac.www.ads-software.com/browser/trunk/wp-includes/capabilities.phpForum: Themes and Templates
In reply to: Downloading themes to replace default blog pageI’m sure there are better tutorials than this, but:
1. Find a theme that you want, download, and unzip/upack it
2. Upload the unzipped theme folder to wp-content/themes on your WP server
3. In your WP admin GUI go to Design and select your uploaded themeForum: Fixing WordPress
In reply to: Inlined display of all pagesCould this be part of a custom theme? Have you tried switching themes?
Are you sure it’s showing private messages (that is, have you tested this when you are logged out)?
Forum: Fixing WordPress
In reply to: Sidebar drops with increased number of postsHow did you add the “read more” link? Did you modify the theme directly? If so, what file did you edit, and can you list the code here?
Forum: Themes and Templates
In reply to: Syntax for page_template using wp_insert_postTo add to that: I checked the db and found the entries in the wp_postmeta ending up as
_wp_page_template default
though this is updated properly if I change the template in the GUI. This makes me think that my wp_insert_post() isn’t sending the page_template value to the right place.
I’ll post this question on the hacks forum too.
Forum: Themes and Templates
In reply to: Syntax for page_template using wp_insert_postThanks for the reply, but that doesn’t seem to work for me. More specifics:
I’m using a custom theme page (page-proposal.php) in the theme directory properly named as “Page Proposal”. My custom form uses wp_insert_post as follows (in part):
$prop_page = array();
$prop_page[‘page_template’] = ‘page-proposal.php’;
wp_insert_post($prop_page);The new page goes to “default” when I submit it, but in the actual Page editor GUI I can select “Page Proposal” from the template drop-down.
Any other ideas would be welcome!