When I use rewind_post() it shows menu items in my loop

I found the problem, this function was causing the problem…. function include_custom_post_types( $query ) { $custom_post_type = get_query_var( ‘post_type’ ); if ( is_archive() ) { if ( empty( $custom_post_type ) ) $query->set( ‘post_type’ , get_post_types() ); } if ( is_search() ) { if ( empty( $custom_post_type ) ) { $query->set( ‘post_type’ , array( ‘post’, ‘page’, … Read more

Force string into signup form

Not sure where you are placing the code as you don’t say – but you will need to edit the WordPress signup code / file and add your random string code in there and then hide the input for the sub-domain or set it to disabled and set it’s value to the random string. You’ll … Read more

Determine if only one image attached to a post/page

That code should get the attachments as array which you should be able to use count() on to determine the total number of images. Example: if ( $attachments ) { if ( 1 == count( $attachments ) ) { // handle single image } else { // handle multiple images } }

Move wordpress sidebar on homepage up to new position

The best way is to move <div id=”side”> outside of <div id=”content”>, so that you can properly position it next to the slider (<div id=”lof-container”>). Alternatively, you could do it with #maincontent { overflow: visible; } #side { margin-top: -300px; } though this is pretty hackish.

how to set category name for a post

The post_category parameter has to be an array of IDs (int). http://codex.wordpress.org/Function_Reference/wp_insert_post#Parameters Try get_category_by_slug to get the ID, then use it. $category = get_category_by_slug( ‘your-category’ ); $new_post = array( … ‘post_category’ => array( $category->term_id ) ); Alternatively, look into wp_set_object_terms or wp_set_post_terms, using the $post_id of the post you’ve just created. If you need to … Read more