• JamiesWright

    (@jamieswright)


    Hi,
    I’m writing a plugin and one part of the plugin is to get the header file to add a code depending on the theme. Right now, I’m able to get the theme’s name using $theme_name = get_current_theme();
    What the plugin will do is it will check the plugin name to match it. For example,

    if $theme_name == 'Twenty Eleven'
    //Get Header File
    //Find Node. For Example, </hgroup>
    //Echo <?php my_function(); ?> after </hgroup>

    This will be in the JQuery script file, and the codes are examples to show what I would like to achieve.
    Is there a WordPress function to get the theme’s header file from the PHP file? And after editing the file, what’s the best way to place the header file back?

    This might not be relevant to the forum, but it’ll be great if someone could show me how to find the node using jQuery as well. Thanks.

The topic ‘WordPress get header file and add function’ is closed to new replies.