145 posts
  • Has been part of the Envato Community for over 2 years
  • Located in Austria
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
LovelessDesign says

Hello, I have a postcreate.php file that creates posts automatically. It is located in my theme folder and works.

But I want to use a function (asa_item) from a plugin which does work in files like single.php but not in my postcreate.php.

Hope you can help.

This is the postcreate.php:

<?php require('CENSORED...' . '/wp-load.php');

global $user_ID;
<strong>$abcd = asa_item('B005I4WBMI');</strong>

$new_post = array(
'post_title' => 'My New Post',
'post_content' => $abcd,
'post_status' => 'publish',
'post_date' => date('Y-m-d H:i:s'),
'post_author' => $user_ID,
'post_type' => 'post',
'post_category' => array(0)
);
$post_id = wp_insert_post($new_post); ?>
145 posts
  • Has been part of the Envato Community for over 2 years
  • Located in Austria
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
LovelessDesign says

Btw. Forget the STRONG-Tags in the code. I just wanted it to be strong for you.

by
by
by
by
by
by