Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Theme Options Page #31

Closed
lgabeskiria opened this issue Oct 14, 2014 · 18 comments
Closed

Theme Options Page #31

lgabeskiria opened this issue Oct 14, 2014 · 18 comments

Comments

@lgabeskiria
Copy link

Hi,

Is there any way to move Theme Options submenu to top level menu?

@sergiubagrin
Copy link
Contributor

Hi @levan1993, Yes. I will add a complete reply in next 10 hours. Thank you.

@lgabeskiria
Copy link
Author

Thank you for help.

@sergiubagrin
Copy link
Contributor

@levan1993 - thank you too!

@lgabeskiria
Copy link
Author

One more question... Is there any way to change width of an option?

@ghost
Copy link

ghost commented Oct 14, 2014

@levan1993 Is there any way to change width of an option?

The width comes from this css, you can't modify it because it's in the framework, but you can overwrite it.

Enqueue a style from your theme in the static.php file

if (is_admin()) {
    wp_enqueue_style(
        'custom-admin-style',
        get_template_directory_uri() . '/css/custom-admin-style.css',
        array(),
        fw()->theme->manifest->get_version()
    );
}

with the following contents

.fw-backend-option-design-default > .fw-backend-option-input.width-type-fixed > .fw-inner,
.fw-backend-option-design-taxonomy > td > .fw-backend-option-input.width-type-fixed > .fw-inner,
.fw-backend-option-fixed-width {
    width: ...px;
}

@lgabeskiria
Copy link
Author

Thank you.

@lgabeskiria
Copy link
Author

Would be great if you add width option... For example if width key exists in array params, than apply it, else use default.

@ghost
Copy link

ghost commented Oct 14, 2014

@levan1993 Why you want to change the option width?

@lgabeskiria
Copy link
Author

sometime I need to change option width, in case of wp-editor or other inputs. I can manually change the width in framework backend it's about 5 lines of code, but it will be overriden after update.so it's not a solution for me.

@ghost
Copy link

ghost commented Oct 14, 2014

We tried to make all options have the same width to look nice and clean. I don't think we will add a width parameter for options.

I don't see this solution so complicated. In that css file you can add styles for concrete options by using their id, for e.g.

#fw-backend-option-fw-option-demo_wp_editor > .fw-backend-option-input > .fw-inner {
    width: ...px;
}

@lgabeskiria
Copy link
Author

Thank's, I will consider this solution. What about theme options page?

@ghost
Copy link

ghost commented Oct 14, 2014

You can find a parent element on the page that has unique id or class and use it to detect what page you are currently on.


For e.g. to apply styles only on the theme options page

#fw_form_fw_settings .my-class { ... }

or

body.appearance_page_fw-settings .my-class { ... }

To apply styles on some post type pages (add new, edit)

body.post-type-post .my-class { ... }

@lgabeskiria
Copy link
Author

You didn't understand me. I mean Theme Settings Page that is submenu of Appearence menu. I want to set it as menu page, but I saw that you register it as submenu in backend.php . is there any solution to register it as menu page?

@ghost
Copy link

ghost commented Oct 14, 2014

Ops, sorry. I thought you continue the css question.

We will come back later with a response.

@lgabeskiria
Copy link
Author

Ok. Thank's

@ghost
Copy link

ghost commented Oct 14, 2014

Is there any way to move Theme Options submenu to top level menu?

At the moment it's not possible. We will add that feature in the next release.

@ghost
Copy link

ghost commented Oct 16, 2014

We added the possibility to move the settings page menu in the 1.4.0 release.

You can use this action like that:

// file: framework-customizations/theme/hooks.php

if (!function_exists('_action_theme_custom_framework_settings_menu')):
        function _action_theme_custom_framework_settings_menu($data) {
                add_menu_page(
                        __( 'Unyson', 'fw' ),
                        __( 'Unyson', 'fw' ),
                        $data['capability'],
                        $data['slug'],
                        $data['content_callback']
                );
        }
endif;
add_action('fw_backend_add_custom_settings_menu', '_action_theme_custom_framework_settings_menu');

@lgabeskiria
Copy link
Author

Thank you.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants