How to change the post form from plugin?

If you want to change/add something to post form, you have to deal with meta boxes. I would recommend you to read through these articles: Reusable Custom Meta Boxes Part 1: Intro and Basic Fields Reusable Custom Meta Boxes Part 2: Advanced Fields Reusable Custom Meta Boxes Part 3: Extra Fields Reusable Custom Meta Boxes … Read more

How to only publish posts with image in it

I found and modified a chunk of code found here: http://www.wprecipes.com/wordpress-tip-detect-if-a-post-has-at-least-one-image. <?php while ( have_posts() ) : the_post(); $content = $post->post_content; $searchimages=”~<img [^>]* />~”; preg_match_all( $searchimages, $content, $pics ); $iNumberOfPics = count($pics[0]); if ( $iNumberOfPics > 0 ) { //your loop content goes here } endwhile; ?> I think this just looks for images entered … Read more

WP text styles not coming through to actual post

Most likely, your theme uses some form of CSS reset. Your markup (“b”, “i”, etc) is probably being saved and rendered correctly, but the CSS reset overrides all of the styles that the browser would normally apply. Try viewing the source of your page, and see if the markup (“b” tags, “i” tags, etc) actually … Read more

Is codex right on deleting post?

The relationship between the term and the post is deleted, not the term itself. On front-end the query for a term with no associated posts will result in a 404 tough. But if you go to the term list in back-end you still can see term with a post count of 0. Always keep in … Read more

Making my plugin create a page?

You can use wp_insert_post to insert a physical page, though I would suggest creating one page for the plugin and then using a rewrite rule to give all of your items a URL with that single page as the base. EDIT quick rewrite example with added query var: function wpa55546_rewrites(){ $page_slug = ‘your-page’; // urls … Read more

retrieve the oldest post id

I do not see any problem in your query (except some poor query writing styles). You did not explain ‘does not work’. what you get in return? do you get any errors? Probably you do not have any published job_listing! However, here is how you can improve your given code: $oldest_post_id = $wpdb->get_row(“SELECT `id` FROM … Read more