• Haidar Rahman

    (@haidar-rahman)


    Hi webmasters!, I’m trying to remove the line that I have highlighted below. I know is not recommended for me to remove it straight from the parent theme. So I made a child theme, and I was wondering whether anyone could help to disable this particular line through my child theme by adding some codes you know.
    Thanks.
    Your fellow amateur user… :S

    —————————————————————————-

    [ Moderator note: code fixed. Please wrap code in the backtick character or use the code button. ]

    function iexcel_wp_title( $title, $sep ) {
    	global $paged, $page;
    
    	if ( is_feed() )
    		return $title;
    
    	// Add the site name.
    	$title .= get_bloginfo( 'name' );
    
    	// Add the site description for the home/front page.
    	$site_description = get_bloginfo( 'description', 'display' );
    	if ( $site_description && ( is_home() || is_front_page() ) )
    		$title = "$title $sep $site_description";
    
    	// Add a page number if necessary.
    	if ( $paged >= 2 || $page >= 2 )
    		$title = "$title $sep " . sprintf( __( 'Page %s', 'i-excel' ), max( $paged, $page ) );
    
    	return $title;
    }
Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    Where in the parent theme is that function iexcel_wp_title( $title, $sep ) being called? Also which theme is that from?

    Thread Starter Haidar Rahman

    (@haidar-rahman)

    Thanks for the quick reply @jan Dembowski,
    It is from i-excel Theme > functions.php

    Thread Starter Haidar Rahman

    (@haidar-rahman)

    My apologies, I just wanted to remove this line:

    // Add the site name.
    $title .= get_bloginfo( 'name' );

    in the code above.

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    No no, I mean how is that function called? If it is in an add_action() or add_filter() then it may be an easy thing to remove.

    Do you mean this theme?

    https://wordpress.org/themes/i-excel/

    Thread Starter Haidar Rahman

    (@haidar-rahman)

    I’ve just checked it is add_filter()

    Yes, that’s the theme I’m using.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Removing scripts from parent functions.php’ is closed to new replies.