Forum Replies Created

Viewing 1 replies (of 1 total)
  • Forum: Hacks
    In reply to: Theme Check problem
    NewWpPlugins

    (@newwpplugins)

    Hi,

    If you are using a theme based on “underscores” theme, when you trying to check your theme using “Theme-Check” plugin you will see this message:

    The <title> tags can only contain a call to wp_title(). Use the wp_title filter to modify the output

    To fix this problem go to inc/extras.php file and find this:

    if ( ! function_exists( '_wp_render_title_tag' ) ) :
    	/**
    	 * Title shim for sites older than WordPress 4.1.
    	 *
    	 * @link https://make.www.ads-software.com/core/2014/10/29/title-tags-in-4-1/
    	 * @todo Remove this function when WordPress 4.3 is released.
    	 */
    	function themeslug_render_title() {
    		echo '<title>' . wp_title( '|', false, 'right' ) . "</title>\n";
    	}
    	add_action( 'wp_head', 'themeslug_render_title' );
    endif;

    Replace it with:

    if ( ! function_exists( '_wp_render_title_tag' ) ) :
        function themeslug_render_title() {
    ?>
    <title><?php wp_title( '|', true, 'right' ); ?></title>
    <?php
        }
        add_action( 'wp_head', 'themeslug_render_title' );
    endif;
Viewing 1 replies (of 1 total)