Add in the section thru action hooks?

  • 007me

    #8195

    Hi,

    Is there a way to add <style> to the <head> part of the header.php using action hooks?

    Or do I need to manually edit the file?

    Thanks,

    Udi

    Mod

    Kenneth John Odle

    #39462

    The easiest way is to just use Graphene’s built-in Custom CSS feature.

    007me

    #39463

    Kenneth,

    I tried that but from some reason it’s not enforcing itself on the theme.

    I tried using webfonts and it didn’t work.

    So I would like to try to put it in the <head> and see if it will work.

    007me

    #39464

    Also, tried adding the webfonts in the header.php didn’t work.

    This works fine on a test blog I’m having but not on my production site.

    I’ve disabled all plugins on the production one but it didn’t help.

    Any way to investigate it?

    Mod

    Kenneth John Odle

    #39465

    Are you using Google webfonts, and are you entering the font specifications correctly?

    There is a feature in Graphene to add code directly to the <head> section.

    Graphene Options >> Advanced Options >> Custom <head> Tags

    007me

    #39466

    It’s not Google webfonts as they don’t have any Hebrew fonts.

    It’s Hebrew webfonts called “Alef”.

    http://alef.hagilda.com/

    I will try the Custom <head> tags as well.

    This is the code I would like to add, is it Ok?

    <style type="text/css">

    @font-face {
    font-family: 'Alef' !important;;
    src: url('http://www.udiburg.com//blog3/wp-includes/fonts/Alef-Bold.eot');
    src: url('http://www.udiburg.com//blog3/wp-includes/fonts/Alef-Bold.eot?#iefix') format('embedded-opentype'),
    url('http://www.udiburg.com//blog3/wp-includes/fonts/Alef-Bold.woff') format('woff'),
    url('http://www.udiburg.com//blog3/wp-includes/fonts/Alef-Bold.ttf') format('truetype'),
    url('http://www.udiburg.com//blog3/wp-includes/fonts/Alef-Bold.svg#alefbold') format('svg');
    font-weight: bold;
    font-style: normal;

    }

    @font-face {
    font-family: 'Alef' !important;;
    src: url('http://www.udiburg.com//blog3/wp-includes/fonts/Alef-Regular.eot');
    src: url('http://www.udiburg.com//blog3/wp-includes/fonts/Alef-Regular.eot?#iefix') format('embedded-opentype'),
    url('http://www.udiburg.com//blog3/wp-includes/fonts/Alef-Regular.woff') format('woff'),
    url('http://www.udiburg.com//blog3/wp-includes/fonts/Alef-Regular.ttf') format('truetype'),
    url('http://www.udiburg.com//blog3/wp-includes/fonts/Alef-Regular.svg#alefregular') format('svg');
    font-weight: normal;
    font-style: normal;

    }

    body {
    font:16px/1.1 "Alef", arial, sans-serif;
    }

    html,h1,h2,h3,h4,h5,h6,b,strong,p,body,a,all {
    font-family:"Alef", arial, sans-serif;
    font-weight:normal;
    font-size:16px;
    }

    .sidebar h3 {
    font-family:"Alef", arial, sans-serif;
    font-weight:bold;
    font-size:18px;
    }

    .post-title, .post-title a {
    font-family:"Alef", arial, sans-serif;
    font-weight:bold;
    font-size:24px;
    }

    .commentform {
    font-family:"Alef", arial, sans-serif;
    font-weight:normal;
    font-size:12px;
    }

    .single .author_h4 {
    font-family:"Alef", arial, sans-serif;
    font-weight:bold;
    font-size:16px;
    color:#2E2E2E;
    }

    .bgimage-excerpt .slider_post h2 a {
    font-family:"Alef", arial, sans-serif;
    font-weight:bold;
    font-size:18px;
    }

    </style>

    From some reason I can see it working in Chrome but not in IE or FF, while the test blog shows correctly on all.

    Mod

    Kenneth John Odle

    #39467

    I don’t know if it makes a difference, but try changing

    font-family: 'Alef' !important;;

    to

    font-family: 'Alef' !important;

    You have an extra semi-colon in there.

    007me

    #39468

    Wow, didn’t notice, will check that 🙂

    007me

    #39469

    No, it didn’t work as well, it’s like something is blocking it from being applied.

    Admin

    Syahir Hakim

    #39470

    This is usually caused by wrong syntax earlier on in the CSS codes. It takes only one wrong syntax to cause the rest of CSS codes to be ignored. Check your CSS codes thoroughly to ensure there is no such syntax mistakes.

Viewing 10 posts - 1 through 10 (of 11 total)

You must be logged in to reply to this topic.