Let visitors show/hide a type of content

JavaScript is your friend! More specifically jQuery is your friend. You can us wp enqueue script and do something like this: Add this to your themes functions.php <?php function my_scripts_method() { wp_enqueue_script(‘jquery’); } add_action(‘wp_enqueue_scripts’, ‘my_scripts_method’); // ?> Then either in your header or by writing a custom .js file then enquiring it use the following … Read more

Setting a post’s category

Try doing this: $insert_post = wp_insert_post(array( ‘post_author’=>1, ‘post_date’=>date(‘Y-m-d H:i:s’), ‘post_date_gmt’=>date(‘Y-m-d H:i:s’), ‘post_content’=>”, ‘post_title’=>”, ‘post_excerpt’=>”, ‘post_status’=>’publish’, ‘comment_status’=>’closed’, ‘post_name’=>”, ‘post_parent’=>0, ‘post_type’=>’portfolio’, // with ‘portfolio’ custom post type ‘post_category’=>array($id), )); if( $insert_post ) { wp_set_object_terms( $insert_post, intval( $id ), ‘galleries’); } Using wp_set_object_terms you can set the terms for the post in any taxonomy. The first argument is … Read more

content filter (add_filter) for category description?

Sure, hook it right onto category_description. Here’s an example: function category_desc_filter( $desc, $cat_id ) { $desc=”Description: ” . $desc; return $desc; } add_filter( ‘category_description’, ‘category_desc_filter’ ); Didn’t test it but based on the Codex it should work. See the Codex for more info: http://codex.wordpress.org/Plugin_API/Filter_Reference#Category_and_Term_Filters

Adding link post format to theme and permalink to rss feed

as a self-appointed thematic support guru, i can simplify your first filter: /** * Override the post title logic for post format ‘link’ */ function mikewillsthematic_thematic_postheader_posttitle($posttitle) { if (has_post_format(‘link’)) { $posttitle=”<h2 class=”entry-title”><a href=””; $posttitle .= get_post_meta( get_the_ID(), “post_format_data”, true); $posttitle .= ‘” title=”Direct link to article” rel=”bookmark”>’; $posttitle .= ‘&#8734; ‘; $posttitle .= get_the_title(); $posttitle … Read more