Categories Archives: Blogging Tips

Insert new post in to wordpress from php

This code snippet should let you add a new post to your wordpress database 2.5.1 require_once(‘wp-config.php’); // create post object class wm_mypost {     var $post_title;     var $post_content;     var $post_status;    /* publish, private */     var $post_author;    /* author user id (optional) */     var $post_name;      /* slug (optional) */     var $post_type;      /* ’page’ or ’post’ (optional, defaults to ’post’) */     var $comment_status; /* open or closed for commenting (optional) */     var $post_category ;  } // initialize post object $wm_mypost = new wm_mypost(); $wm_mypost->post_title    = "Title2 ". date( ’r' ); $wm_mypost->post_content  = "content3"; $wm_mypost->post_status   = ’publish’;  $wm_mypost->post_author   = 1; // Catagorys $post_category = split("," , "one"); foreach($post_category as $key=>$val) {     $post_category[$key] = get_cat_ID($val); } $wm_mypost->post_category =  $post_category ;  // Optional; uncomment as needed // $wm_mypost->post_type = ’page’; // $wm_mypost->comment_status = ’closed’; // feed object to wp_insert_post $post_ID = wp_insert_post($wm_mypost); echo date( ’r' ) . "\n"; echo "post_ID:". $post_ID . "\n"; 

How to block spam on a wordpress Blog

To help stop spam activate the Akismet plugin. Login to your wordpress blog On the right hand side there is a pugin button, click it Activate Akismet plugin (download here if its not all ready installed) Get a WordPress API key http://wordpress.com/api-keys/ (its free) Set the WordPress API key in the Akismet settings page. 99.98 [...]

Mistakes I have made

These are some of the mistakes I have made over the past few years with Blogging and web design. These mistakes have cost me hours of extra work and in some cases months headache’s. Hopefully you can learn from my mistakes and save yourself some time. Used a sub directory – When you browse to [...]

Where I went wrong

Today I read a post by Jane May at John chow dot com, The Secrets of Picking A Niche its a good read if you got 7 mins to spare. The article talks about how to pick the right Niche or subject for your blog or upcoming website. It got me thinking about my own [...]

Removing the Nofollow link

Back in the day, there was a major problem with people posting garbage comments on blogs or forms so they could get back links to there site. Every time they made a new post they would get anther back link and there ranking would rise. Then google and yahoo introduced the nofollow link parameter that [...]