Ver Mensaje Individual
  #5 (permalink)  
Antiguo 16/03/2010, 05:58
codig0
 
Fecha de Ingreso: septiembre-2008
Ubicación: Lanzarote, Canarias
Mensajes: 486
Antigüedad: 15 años, 8 meses
Puntos: 41
Respuesta: Crear nuevo post en WordPress manualmente en PHP

es muy fácil, wordpress ya tiene una función para insertar post.

http://codex.wordpress.org/Function_...wp_insert_post

Código:
<?php
require('../wp-load.php');

// Create post object
  $my_post = array();
  $my_post['post_title'] = 'My post';
  $my_post['post_content'] = 'This is my post.';
  $my_post['post_status'] = 'publish';
  $my_post['post_author'] = 1;
  $my_post['post_category'] = array(8,39);

// Insert the post into the database
  wp_insert_post( $my_post );

?>
si te da problemas al enviar tíldes, utiliza utf8_encode a la hora de insertar el título y la descripción... y problema resuelto.