recent posts for different categories

If the blog / portfolio items are grouped into categories, you can do this at the top of your template file: <?php $portfolio_query = new WP_Query(‘posts_per_page=3&category_name=portfolio’); // note ‘portfolio’ is the category slug $blog_query = new WP_Query(‘posts_per_page=3&category_name=blog’); // note ‘blog’ is the category slug ?> Then in your markup: <?php if ($portfolio_query->have_posts()) : ?> <div … Read more

WordPress’ ALL post count info on its dashboard does not match phpMyAdmin’s ALL post count!

It all comes down to this. http://core.trac.wordpress.org/ticket/11889 Behind the scenes, WordPress does generate a place-holder post for your next one! And for that special post, it sets the post_status to a special one, ‘auto-draft’. Basically, the culprit is the post generated by WordPress without your knowledge. Once you know this fact, it is easy to … Read more

Display posts with tag that matches current post title

The query would look something like this: $title_tagged_posts_query = new WP_Query( array( ‘tag’ => strtolower( get_the_title() ) ) ); while ( $title_tagged_posts_query->have_posts() ) : $title_tagged_posts_query->the_post(); //Output whatever you want here. endwhile; This assumes that the tag slug for “Hippo” is “hippo”, which should normally be the case.

submit posts by unregistered users in wordpress

UPDATE – i made a simple plugin for this that adds the functionality: A widget that you can put in your sidebar that enables post to bee saved as pendling A widget that displays the three last submitted and confirmed posts. The plugin have som simple css classes without any styling. Here is the download … Read more

Distinguish between publish and update? [duplicate]

<?php add_action( ‘save_post’, ‘your_action’ ); function your_action( $post_id ) { if ( !wp_is_post_revision( $post_id ) ) { // Do this only if not a revision } } ?> Use the if condition to check if post is not revision.

How to get rid of shortcodes in post content once and for all

Please backup your database before trying In your current theme, open the functions.php file and add the code below. In theshortcodeyouhate inform the shortcode you want to get rid of, note that even extended types works nicely! Once you added this code, hit F5 and you are done. add_action (‘init’,’remove_shortcode_from_db’); //you can choose any other … Read more

How to create large page

Considering that the WP schema allows for ~4GB of post content, I’d say the trouble is something else: Got any plugins running? Disable them all & try again. Made any changes to core files? Restore to a default install. What kind of content are you pasting in?

Duplicate posts and change category

There’s plugin to do that – Duplicate Post While viewing a post as a logged in user, you can click on Copy to a new draft as a dropdown link under Edit Post in the admin bar. This will lead you to edit post page, change whatever you want and save. It’ll save it as … Read more