• I noticed that the theme duplicates the title in the feed via this sample of code in gridz’s functions.php:

    /**
     * Filters Title for the Site
     */
    function gridz_filter_wp_title($title) {
        $site_name = get_bloginfo('name');
        if(trim($title) != '') {
    	$title = str_replace('?','',$title);
    	$filtered_title = $title.' | '.$site_name;
        } else
    	$filtered_title = $site_name;
        if (is_front_page()) {
            $site_description = get_bloginfo('description');
    	if(trim($site_description) != '')
    	    $filtered_title .= ' | '.$site_description;
        }
        return $filtered_title;
    }
    add_filter('wp_title', 'gridz_filter_wp_title');

    I solved it by commenting out add_filter:

    //add_filter('wp_title', 'gridz_filter_wp_title');

    What’s the purpose with this sample of code? How can it be optimized?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter alexz

    (@alexz)

    I think this sample of code has to replace the original code in the theme functions.php to solve the issue.

    /**
     * Filters Title for the Site
     */
    function gridz_filter_wp_title($title) {
        $site_name = get_bloginfo('name');
        if(trim($title) != '') {
    	$title = str_replace('?','',$title);
    	$filtered_title = $title.' | '.$site_name;
        } else
        if (is_front_page()) {
            $site_description = get_bloginfo('description');
    	if(trim($site_description) != '')
    	   $filtered_title = $site_name.' | '.$site_description;
        }
        return $filtered_title;
    }
    add_filter('wp_title', 'gridz_filter_wp_title');

    Let me know if the case is not so.

    I just tried your code. I hope it works. I was having the same problem… Thanks!!

    No it didn’t work for me ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Duplicating title on the feed?’ is closed to new replies.