366 posts
  • Has referred 50+ members
  • Has sold $125,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+5 more
PixelStores says

I tried it and it works for me. Try var_dump on $topmargin, maybe that does not contain what you think it should.

hmm did the following,

$options = get_option('viroshop_theme_options');
$topmargin = $options['viro_top_margin'];
echo var_dump($topmargin); 

And the output was,

string(4) "55px"

So i take it the output is correct. Its very unusual why its not working everything seems to be in its place.

I even tried,

function my_styles_method() {
    wp_enqueue_script(
        'custom-style',
        get_template_directory_uri() . '/css/skin.css'
    );
        $custom_css =     "#header {
                            margin-top: '55px';
                           }";
        wp_add_inline_style('custom-style',$custom_css);
}
add_action('wp_enqueue_scripts', 'my_styles_method');

Yet still receive the token issues… :S

1477 posts
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Made it to the Authors' Hall of Fame
+3 more
OriginalEXE says

And with this code?

function my_styles_method() {
    wp_enqueue_script(
        'custom-style',
        get_template_directory_uri() . '/css/skin.css'
    );
        $custom_css =     "#header {
                            margin-top: 55px;
                           }";
        wp_add_inline_style('custom-style',$custom_css);
}
add_action('wp_enqueue_scripts', 'my_styles_method');
1477 posts
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Made it to the Authors' Hall of Fame
+3 more
OriginalEXE says

Oh, I was blind, BLIND!!! :P

You are using wp_enqueue_script while you should be using wp_enqueue_style :)

by
by
by
by
by
by