Support » Themes and Templates » Code Question

  • isay81


    I want to add this plug in to my new site. In the following directions it tells me to drop this line of code into the header template, but it doesn’t say where. The Theme I am using is Twenty Ten and the site is
    This is the plug in:dynamic-headers/custom-header.php

    Option 1 (Recommended): Simply drop the this line of code into your theme file that controls your header (usually header.php)

    Note: The location to add this code can vary widely from theme to theme and depending on your theme’s css settings you may have to use Option 2 and modify the CSS of your theme **BACKUP ANY THEME FILES BEFORE MODIFYING**

    <?php if(function_exists(‘show_media_header’)){ show_media_header(); } ?>

    This will automatically determine what type of media you are using and generate the appropriate code to insert it. No other coding is required on your part.

    Option 2: You can use this line of code to simply get the URL of the media for a particular post or page. This will allow you to do some more advanced things and embed the media yourself if you know what you are doing.

    <?php if(function_exists(‘dh_get_page_image_url’)){ $dynamic_header_url = dh_get_page_image_url(); } ?>

    You can then use the variable $dynamic_header_url however you see fit. It will contain the full path to your media file for that particular page/post, including any default media that should be shown.
    It is advised that most users simply use Option 1 if at all possible, as it is significantly more simple.
    Note: This function can return NULL or the string ‘None’ if there are no headers for the current page.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Code Question’ is closed to new replies.