Welcome! To use this support forum, please Login or Join Today!

   

Remove horizontal offset option in theme options panel

{name}
Rank

Total Posts: 30

Joined 2012-03-03

PM

 

Hi Casey,

The Mobius theme options panel gives us the ability to declare menu alignment, horizontal offset, vertical offset and menu item padding. When customizing a right-aligned menu in style(x).css, ?get_styles=css automatically declares a value for “left”. Is it possible to remove horizontal offset, vertical offset and menu item padding, but keep the menu alignment option?

I understand that simply leaving the theme options fields blank will void this by spitting out an empty value, but I’m curious to know if there’s a way to remove it altogether via a function or other means.

Any feedback is greatly appreciated!

{name}
RankRankRankRank

Total Posts: 3667

Joined 2011-04-27

PM

 

Sure, just add this to your child theme’s functions.php:

function theme_css() {
 $css = get_query_var('get_styles');
 if ($css == 'css') {
    include_once (STYLESHEETPATH . '/style.php');
    exit;
 }
}
add_action('template_redirect', 'theme_css');

(basically we just changed TEMPLATEPATH to STYLESHEETPATH here)

Now, copy style.php and themestyles.php from your parent theme to your child theme.

In style.php just do the same. Changed TEMPLATEPATH to STYLESHEETPATH.

Now, you can edit the last two lines of themestyles.php to remove any of the styles you don’t want applied from theme options.

Furthermore, if you want to remove these options from the theme control panel, just copy options.php to your child theme directory and remove them from the array.

Hope this helps.