371 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

1511 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
+2 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');
1511 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
+2 more
OriginalEXE says

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

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

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by