I asked my question on stackoverflow but I did not get any answer, may be because it's the question related to Wordpress.So I am asking it here.
I am using wp_insert_post
function to insert my posts, but it is not working fine for me.
Here is my post_content
$content = '<div class="snippet">
<strong>Wordpress Tutorial - Jetpack Plugin installieren & konfigurieren</strong>
<br/>
<p>Wordpress Online Kurs unter http://wordpress-online-kurs.de Sie erhalten Tutorials zu den Wordpress Themen, wie Plugins, Theme, SEO ...<a href=https://www.google.com/url?rct=j&sa=t&url=http://www.youtube.com/watch%3Fv%3DzjMtxin-hRA&ct=ga&cd=CAIyGmExYThkZTljMmU3MDQyZGE6Y29tOmVuOlVT&usg=AFQjCNGFOBEtFiT4f7zq6xl-xTbsW9uIVg target="_blank"></a>
<br />
<a href=https://www.google.com/url?rct=j&sa=t&url=http://www.youtube.com/watch%3Fv%3DzjMtxin-hRA&ct=ga&cd=CAIyGmExYThkZTljMmU3MDQyZGE6Y29tOmVuOlVT&usg=AFQjCNGFOBEtFiT4f7zq6xl-xTbsW9uIVg rel="nofollow" target='_blank'>See Original Article </a>
</p>
</div>
<div class="snippet">
<strong>Preview Fargo - Responsive Creative WordPress Theme TFx</strong>
<br/>
<p>
Preview and Download : http://fxtheme.com/themes/fargo-responsive-creative-wordpress-theme-tfx FARGO is a beautifully designed and visually ...<a href=https://www.google.com/url?rct=j&sa=t&url=http://www.youtube.com/watch%3Fv%3DqjKCijxQR1M&ct=ga&cd=CAIyGmExYThkZTljMmU3MDQyZGE6Y29tOmVuOlVT&usg=AFQjCNGlUblc7rKI0OjRLqe1CChEfbpYmQ target="_blank"></a>
<br />
<a href=https://www.google.com/url?rct=j&sa=t&url=http://www.youtube.com/watch%3Fv%3DqjKCijxQR1M&ct=ga&cd=CAIyGmExYThkZTljMmU3MDQyZGE6Y29tOmVuOlVT&usg=AFQjCNGlUblc7rKI0OjRLqe1CChEfbpYmQ rel="nofollow" target='_blank'>See Original Article </a>
</p>
</div>';
When I am adding this as manually it is inserting while I am using cron to insert it just insert post up to "SEO"
Code is :
$my_post = array('post_title'=>'test post','post_content'=>$content);
Any suggestions to solve this?
$array
array. Going down this thought process it would need to be$array = array('$content');
as a quick troubleshoot. Can you post all the code please? EDIT I also see that yourhref
content is not in double quotes, I'm not sure if it would still work but according to my understanding it's best practice to do so.