How to load a post into an empty div tag anywhere across the pages?

You can solve this in different ways. One it’s to use simple querys with WP_Query and using the p parameter to retrive a particular post like it’s explained here. Something like this: $the_query = new WP_Query( ‘p=123′ ); while ( $the_query->have_posts() ) : $the_query->the_post(); the_content(); endwhile; Where 123 it’s the post id from where you … Read more

How can I make a post that belongs to a category or have specific tags, display different from the other single posts?

With CSS: If your theme uses post_class() on a containing element, you can target that element with the class .category-songs to control styling. With a template filter: add a filter to single_template and check the assigned categories for your songs category, and use the template songs-single.php if that category is found: function wpse_check_single_categories( $template=”” ){ … Read more

How can I find out what items a user has purchased? [closed]

Query the table wp_wpsc_purchase_logs, it contains all information about previous purchases. add this to your themes functions.php: /********************************************************* Get purchased articles by user_id or for the current user *********************************************************/ function haet_recently_bought_articles($user_id=0){ if($user_id==0) $user_id=get_current_user_id(); //only if there is an active user, otherwise we would get all purchased items from unregistered users if($user_id>0) { global $wpdb; $sql … Read more

post_content sanitization / transformation process

In reading through the function, I do not see anything that inherently transforms it. I’m relatively certain that there are no transforms (except maybe autop) until the display of the data. I would recommend trying one or two posts, making sure that it’s going to insert correctly, and then going all out. Also, depending on … Read more

Style Differently Edited Posts

This is very similar to @mrwweb’s answer, but a little bit more fleshed out. We’re also not going to overload taxonomies in order to get our post class, but do what you wanted initially: use a custom meta box. There is a built in template tag called post_class. Like almost every other function in WordPress … Read more

Update a users role based on number of posts published

current_user_can() checks for a capability, eg: edit_posts, not a role. The only capabilities subscribers have is read which only gives them access to the dashboard to change their profile (unless you added additional caps). They can’t even publish a post so you will have to start with contributors. $old_role = get_user_meta( $user_id, ‘wp_capabilities’ ); elseif … Read more