• Resolved theresident

    (@theresident)


    Hi,

    I’m trying to get my font family to be font-family:’Courier New’,’Courier’,monospace;. The theme I’m using (super-minimal Barthelme 4.6.1) has a theme option where you can select the font you want using radio buttons. I’ve selected “courier” there, however the site is only reflecting what my browser default font is set to, not “courier.”

    I have my firefox browser default font set to Verdana, and that’s all I see in the site. Is there any fix to this?

    The site is at: https://www.fightthefools.com

    Thanks for any help. ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • If you view source of your site, you’ll see that the theme is inserting a style tag and the end of the head. This is the suspect line:

    body{font-family:'courier new',courier,monospace;font-size:75%;}

    It needs to read:

    body{font-family:"courier new",courier,monospace;font-size:75%;}

    It appears WP or your theme is also using the HTML entity for the quote. That’s causing a CSS error making the font-family bug out thus be ignored.

    This is happening in the themes functions.php file.

    line: 664:

    if ( get_option('barthelme_basefontfamily') == "" ) {
    		$basefontfamily = 'arial,helvtica,sans-serif';
    	} else {
    		$basefontfamily = wp_specialchars( stripslashes( get_option('barthelme_basefontfamily') ) );
    	};

    the wp_specialchars is what is converting the character. It appears your server has ENT_QUOTES turned on.

    try changing that line to read:

    if ( get_option('barthelme_basefontfamily') == "" ) {
    		$basefontfamily = 'arial,helvtica,sans-serif';
    	} else {
    		$basefontfamily = stripslashes( get_option('barthelme_basefontfamily') );
    	};

    thus removing the wp_specialchars.

    hopefully that should fix things.

    Thread Starter theresident

    (@theresident)

    This is the css btw. Any ideas would be great.

    [Code moderated] Please use a pastebin for posting large portions of code.

    Thread Starter theresident

    (@theresident)

    Hey! thanks for the input! Unfortunately it seems to have broken it, haha.

    I removed the special characters lines you suggested and instantly got this error message: Parse error: syntax error, unexpected ‘)’ in /homepages/24/d281236462/htdocs/www.fightthefools.com/wp-content/themes/barthelme/functions.php on line 667

    So I copied and pasted the original functions.php back, and I’m still getting that message now.

    I just use text edit (on a mac) to edit my HTML, so I can’t count down 667 lines to see where the issue is – any ideas? Yikes! Site is officially gone now and I’d hate to have to redo all the other customization I did so far…

    Thread Starter theresident

    (@theresident)

    Wait! Scratch that last post. ??

    I downloaded an html editor (about time, I know) – and was able to correct it by ftping to the problem.

    AND YOUR SOLUTION WORKED! Thanks soooo much. I would have never ever thought of special characters. Yay! I really appreciate the help!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘browser font overriding theme font’ is closed to new replies.