WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to use it as a background image but this is killing me because:


would print

<a href="#">http://url/of/the/header</a>

How can I just retrieve the value? So I can print it just like I need it?

share|improve this question
show_media_header is not a core function. The function seems to be associated with this plugin that hasn't been updated in over 2 years. Is that what you are using? – s_ha_dum May 9 '13 at 13:50
up vote 1 down vote accepted

Try this Dynamic Header plugin function:


instead of this one:


It is defined as

function get_media_header_url() {
    global $post;
    $post_id = $post->ID;
    //Declare the wpdb var and table name and run the query to see if there is a media object associated with this post
    global $wpdb;
    $table_name = $wpdb->prefix . "custom_headers";
    $check_q = $wpdb->get_row("SELECT * FROM $table_name WHERE post_id='$post_id' AND header_type='media' LIMIT 1");

    //This large chunk of code determines what page we are on and whether to load a fixed or random header.
        if($check_q->url == 'Default' || $check_q->url == '') {
            $initial_file_value = get_option('dhnd_default');
        } else {
            $initial_file_value = $check_q->url;
    } else {
        $initial_file_value = get_option('dhnd_homepage');

    $load_this_media = process_media_header($initial_file_value);

    return $load_this_media;

I found it in the plugin source code, provided by @s_ha_dum:


It has also the functions dh_get_page_image_url() and dh_get_page_link_url().

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.