Views 3 : Set header/footer/empty text for view via views_embed_view
First up, don't use views_embed_view(). It is a very simple function that doesn't allow for customisation.

Do something like this:



// Load the view.
$view = views_get_view('VIEW_NAME');
// Set the options for the header text.
// To get an idea of what options are available, set up a view with header text
// and then use the devel module to print out the view definition.
// For example, add a header text area field and print it with
// dpm($view-&gt;header['area']); after you have loaded it with views_get_view().
$header_options = array(
  'label' =&gt; t('Header text'), // Administrative label. Not really needed here.
  'content' =&gt; 'This is the header text content.', // Content of header text.
  'format' =&gt; 'filtered_html', // Format of header text.
  'empty' =&gt; 1, // Show even when there are no results. Set to zero otherwise.
);
// This adds a header handler for a text area. The table is views because it is not
// a database field. The field is area because it is a text area.
// The header_options are the settings.
$view-&gt;add_item('DISPLAY_NAME', 'header', 'views', 'area', $header_options);
// This is the preferred way to get the rendered view.
$output = $view-&gt;preview('DISPLAY_NAME');
// If you want you can check for results with this.
if (!empty($view-&gt;result)) {
  // Do something if there are rows.
}


You can do the same for footer handlers:

$view-&gt;add_item('DISPLAY_NAME', 'footer', 'views', 'area', $footer_options);


and empty text:

$view-&gt;add_item('DISPLAY_NAME', 'empty', 'views', 'area', $empty_options);


You can also change the field type if you don't want to use Global: Text area.

For more information see $view->add_item()