0

I am working on editing the header.php file and I am a bit confused.

I am editing the header.php file and I see a call in it to wp_head();

I know that it calls a "callback function" with something like this:

add_action('wp_head' , 'callback_function');

But I am not sure how to find that. Where should I look for it? Basically I need to edit how the tag is configured there.

EDIT:

This is the full header:

<?php
/**
 * Core header file, invoked by the get_header() function
 *
 * @package Suffusion
 * @subpackage Templates
 */

global $suffusion_unified_options, $suffusion_interactive_text_fields, $suffusion_translatable_fields, $suffusion_skin_dependence, $suf_color_scheme;
if (function_exists('icl_t')) {
    foreach ($suffusion_unified_options as $id => $value) {
        /**
         * Some strings are set interactively in the admin screens of Suffusion. If you have WPML installed, then there may be translations of such strings.
         * This code ensures that such translations are picked up, then the unified options array is rewritten so that subsequent calls can pick it up.
         */
        if (function_exists('icl_t') && in_array($id, $suffusion_translatable_fields) && isset($suffusion_interactive_text_fields[$id])) {
            $value = wpml_t('suffusion-interactive', $suffusion_interactive_text_fields[$id]."|".$id, $value);
        }
        global $$id;
        $$id = $value;
        $suffusion_unified_options[$id] = $value;
    }
}

$queried_id = get_queried_object_id();
$hidden_elements = array();
if ($queried_id != 0) {
    $hide_top_navigation = suffusion_get_post_meta($queried_id, 'suf_hide_top_navigation', true);
    if ($hide_top_navigation) {
        add_filter('suffusion_can_display_top_navigation', 'suffusion_disable_component_for_view');
        $hidden_elements[] = 'no-top-nav';
    }
    $hide_main_navigation = suffusion_get_post_meta($queried_id, 'suf_hide_main_navigation', true);
    if ($hide_main_navigation) {
        add_filter('suffusion_can_display_main_navigation', 'suffusion_disable_component_for_view');
        $hidden_elements[] = 'no-main-nav';
    }
    $hide_header = suffusion_get_post_meta($queried_id, 'suf_hide_header', true);
    if ($hide_header) {
        add_filter('suffusion_can_display_header', 'suffusion_disable_component_for_view');
        $hidden_elements[] = 'no-header';
    }
    $hide_footer = suffusion_get_post_meta($queried_id, 'suf_hide_footer', true);
    if ($hide_footer) {
        add_filter('suffusion_can_display_site_footer', 'suffusion_disable_component_for_view');
        $hidden_elements[] = 'no-site-footer';
    }
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>

<head profile="http://gmpg.org/xfn/11">
    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
    <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />

<?php
    suffusion_document_header();
    $suffusion_pseudo_template = suffusion_get_pseudo_template_class();
    if (is_singular()) {
        wp_enqueue_script('comment-reply');
    }
    $skin = isset($suf_color_scheme) ? $suf_color_scheme : 'light-theme-gray-1';
    $extra_classes = $suffusion_pseudo_template;
    if (isset($suffusion_skin_dependence[$skin])) {
        $extra_classes = array_merge($extra_classes, $suffusion_skin_dependence[$skin]);
    }
    $extra_classes[] = $skin;
    $extra_classes = array_merge($extra_classes, $hidden_elements);
    wp_head();  
?>
</head>

<body <?php body_class($extra_classes); ?>>
    <?php suffusion_before_page(); ?>
        <?php
            suffusion_before_begin_wrapper();
        ?>
        <div id="wrapper" class="fix">
        <?php
            suffusion_after_begin_wrapper();
        ?>
            <div id="container" class="fix">
                <?php
                    suffusion_after_begin_container();
                ?>

Thank you!

  • What tag do you want to modify? What are you looking for? wp_head() function should be called in header.php file just before closing </header> tag (if it's not there, you should add it). – Krzysiek Dróżdż Jul 11 '13 at 20:26
  • @KrzysiekDróżdż thanks! I do have the wp_head() called right before the </header>. I am trying to edit the content of the <title> tag. But I am not sure where that should be edited. – Genadinik Jul 11 '13 at 20:27
  • But <title> tag has nothing to do with wp_head() function... There should be <title>....</title> in header.php file. You should change the content of this tag (to something like wp_title(), I guess...) – Krzysiek Dróżdż Jul 11 '13 at 20:30
  • Post your full header.php please – s_ha_dum Jul 11 '13 at 20:30
  • @s_ha_dum just added the full header.php :) – Genadinik Jul 11 '13 at 20:31
1

since you want to edit title attribute.

  • goto functions.php and search wp_title, on line 277 you find add_filter('wp_title', 'suffusion_modify_title', 10, 3);
  • search for callback fx suffusion_modify_title in /suffusion/functions/filters.php, on line 664 you find suffusion_modify_title fx which i think handle titles.
  • thanks, but my filter.php file doesn't have line 664 :) It only has 485 lines, and when I search for suffusion_modify_title it isn't found there. – Genadinik Jul 12 '13 at 15:17
  • what is version of your theme ? – Ravinder Kumar Jul 12 '13 at 17:05
  • sorry, I am a newbie with Wordpress. How do I check the version? :) – Genadinik Jul 12 '13 at 17:56
  • open theme's style.css .and search for version – Ravinder Kumar Jul 12 '13 at 18:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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