Single post as homepage?

Not sure if it is the most elegant way but the easiest is probably to create a shortcode that displays a single page, and then set that page to display as the front page. e.g. http://wordpress.org/extend/plugins/post-content-shortcodes/

WordPress list posts from sub categories

I’ve found this piece of code and it works: <?php get_header(); ?> <div id=”job-listings”> <?php $category = get_the_category(); $theName = $category[0]->name; $theChild = $category[0]->cat_ID; $subcats = get_categories(‘child_of=” . $theChild); foreach($subcats as $subcat) { echo “<h3>’ . $subcat->cat_name . ‘</h3>’; echo ‘<ul>’; $subcat_posts = get_posts(‘cat=” . $subcat->cat_ID); foreach($subcat_posts as $subcat_post) { $postID = $subcat_post->ID; echo “<li>’; … Read more

Different style for most recent article

check the built in counter $wp_query->current_post within the loop: <?php while( have_posts() ) : the_post(); if( 0 == $wp_query->current_post ): // this is the first post in the loop, output larger size, full content, etc. else: // output regular size, the_excerpt, etc. endif; endwhile; ?>

How can I write comments/hidden text in a post?

Yes, using WordPress shortcodes you can create a quick annotation shortcode. add_shortcode( ‘annotation’, ‘wpse47489_private_annotation’ ); function wpse47489_private_annotation( $args, $content=”” ) { if ( !current_user_can( ‘administrator’ ) ) return ”; return “<div class=”hidden-annotation”>$content</div>”; } This will return an empty string for anyone but administrators. You can always return an empty string ” though, these annotations will … Read more

Remove the Edit button in posts for permalinks on certain user roles? WP 3.3

You could do something like (in your functions.php file); if(current_user_can(‘member’)){ add_filter(‘get_sample_permalink_html’, ‘perm’, ”,4); function perm($return, $id, $new_title, $new_slug){ $post = get_post( $id ); if( ! $post || ( $post->post_type !== ‘testimonials’ ) ) { return $return; } return preg_replace( ‘/<span id=”edit-slug-buttons”>.*<\/span>|<span id=\’view-post-btn\’>.*<\/span>/i’, ”, $return ); } To give credit where credit is due, everything between … Read more

When I re-save a post with [code] sections, the entities are double-escaped (> becomes > etc)

I face this issue quite often on my own site where I publish code tutorials. Unfortunately, there isn’t a good solution. Instead, I recommend this workflow: Use the WYSIWYG editor to build your article content leaving placeholders for your code snippets. Switch to the HTML editor to add your code snippets The visual editor (TinyMCE) … Read more