Skip to content

Commit

Permalink
improvements
Browse files Browse the repository at this point in the history
fixed #9
  • Loading branch information
themefuse committed Jul 23, 2015
1 parent 5c4717e commit 5819925
Show file tree
Hide file tree
Showing 4 changed files with 252 additions and 111 deletions.
54 changes: 49 additions & 5 deletions convention/directory-structure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,58 @@ Let's take a closer look at each directory and file, and understand how it works

* ``framework-customizations/theme/config.php`` - Theme configuration array, accessible through ``fw()->theme->get_config('key');``. `Here <https://github.com/ThemeFuse/Unyson/blob/3b79926d5e09f7c9b2697444ffa8d4c9a39b7f5b/framework/core/components/theme.php#L156-L159>`__ are the default values.

* ``framework-customizations/theme/options/`` - A directory containing option files: post types, taxonomies and theme settings page options.
.. code-block:: php
$cfg = array(
// Theme Settings form ajax submit
'settings_form_ajax_submit' => true,
// Theme Settings side tabs
'settings_form_side_tabs' => true,
);
* ``framework-customizations/theme/options/`` - A directory containing option files: post types, taxonomies, customizer and theme settings page options.
The framework will automatically pick them, display in admin pages and save the values in the database.
Also you can add custom options files in it, for e.g. ``framework-customizations/theme/options/my-options.php`` and access them through ``fw()->theme->get_options('my-options')``.
Use the ``fw_get_db_..._option()`` functions to get the settings, posts and taxonomies options values from the database.
Use the ``fw_get_db_..._option()`` :doc:`functions </helpers/php>` to get the settings, customizer, posts and taxonomies options values from the database.

For e.g. you can add options in Customizer in two steps:

1. Create ``{theme}/framework-customizations/theme/options/customizer.php``

.. code-block:: php
$options = array(
'section_1' => array(
'title' => __('Unyson Section', 'fw'),
'options' => array(
'option_1' => array(
'type' => 'text',
'value' => 'Default Value',
'label' => __('Unyson Option', 'fw'),
'desc' => __('Option Description', 'fw'),
),
),
),
);
2. Use option value in template

.. code-block:: php
$value = fw_get_db_customizer_option('option_1');
* ``framework-customizations/extensions/`` - Contains customizations for the framework extensions.
You can overwrite options, views and configuration files of the extensions located in the framework or :doc:`custom locations </extensions/introduction>` like other plugins.
You can also store there theme extensions and create sub-extensions for extensions located in the framework or custom locations.
Extension is identified by its relative path, for e.g. an extension can be located in:

* Framework ``wp-content/plugins/unyson/framework/extensions/{extension-name}``
* Plugin ``wp-content/plugins/whaterever-plugin/custom-dir/extensions/{extension-name}``

* ``framework-customizations/extension/`` - Contains customizations for the framework extensions.
You can overwrite options, views and configuration files of the extensions located in the framework.
You can also store there theme extensions and create sub-extensions for extensions located in the framework.
that extension can be customized in ``{theme}/framework-customizations/extensions/{extension-name}``.
Also you can :doc:`create a sub-extension </extensions/create-extension>` in ``{theme}/framework-customizations/extensions/{extension-name}/extensions/{sub-extension-name}``.

You can also create a ``framework-customizations/`` directory in the child theme.
There you can do the same things as in parent theme, and also you can overwrite some files from the parent theme, like options and configuration files.
Expand Down
50 changes: 34 additions & 16 deletions manifest/theme.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,32 @@ It supports the following parameters:
$manifest = array();
$manifest['id'] = 'theme-id';
$manifest['name'] = __('Theme Title', 'fw');
$manifest['uri'] = 'http://themefuse.com/wp-themes-shop/theme-name';
$manifest['description'] = __('Another awesome wordpress theme', 'fw');
$manifest['version'] = '1.0';
$manifest['author'] = 'ThemeFuse';
$manifest['author_uri'] = 'http://themefuse.com/';
/**
* An unique id to identify your theme
* For e.g. this is used to store Theme Settings in wp_option 'fw_theme_settings_options:{theme_id}'
*/
$manifest['id'] = get_option( 'stylesheet' );
/**
* Specify extensions that you customized, that will look good and work well with your theme.
* After plugin activation, the user will be redirected to a page to install these extensions.
*/
$manifest['supported_extensions'] = array(
// 'extension_name' => array(),
'page-builder' => array(),
'breadcrumbs' => array(),
'slider' => array(),
// ...
/**
* These extensions are visible on Unyson Extensions page only if are specified here.
* Because they has no sense to be available for a theme that is not configured to support them.
*/
'styling' => array(),
'megamenu' => array(),
);
$manifest['requirements'] = array(
'wordpress' => array(
'min_version' => '4.0',
Expand All @@ -39,12 +58,11 @@ It supports the following parameters:
),*/
)
);
/**
* Extensions compatible with the theme
* After plugin activation, the user will be redirected to a page to install these extensions
*/
$manifest['supported_extensions'] = array(
/*
'extension_name' => array(),
*/
);
// These keys are automatically fetched from theme styles.css
//$manifest['name'] = __('Theme Title', 'fw');
//$manifest['description'] = __('Another awesome wordpress theme', 'fw');
//$manifest['uri'] = 'http://themefuse.com/wp-themes-shop/theme-name';
//$manifest['version'] = '1.0';
//$manifest['author'] = 'ThemeFuse';
//$manifest['author_uri'] = 'http://themefuse.com/';
58 changes: 29 additions & 29 deletions options/built-in-option-types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -875,40 +875,40 @@ Choose font family, size, style and color.
)
Typography V2
----------
Typography v2
-------------

Choose font family, style, weight, size, line-height, letter-spacing and color.

.. code-block:: php
array(
'type' => 'typography-v2',
'value' => array(
'family' => 'Amarante',
//For standard fonts, instead of subset and variation you should set 'style' and 'weight'.
//'style' => 'italic',
//'weight' => 700,
'subset' => 'latin-ext',
'variation' => 'regular',
'size' => 14,
'line-height' => 13,
'letter-spacing' => -2,
'color' => '#0000ff'
),
'components' => array(
'family' => true,
//'style', 'weight', 'subset', 'variation' will appear and disappear along with 'family'
'size' => true,
'line-height' => true,
'letter-spacing' => true,
'color' => true
),
'attr' => array( 'class' => 'custom-class', 'data-foo' => 'bar' ),
'label' => __('Label', 'fw'),
'desc' => __('Description', 'fw'),
'help' => __('Help tip', 'fw'),
)
array(
'type' => 'typography-v2',
'value' => array(
'family' => 'Amarante',
// For standard fonts, instead of subset and variation you should set 'style' and 'weight'.
// 'style' => 'italic',
// 'weight' => 700,
'subset' => 'latin-ext',
'variation' => 'regular',
'size' => 14,
'line-height' => 13,
'letter-spacing' => -2,
'color' => '#0000ff'
),
'components' => array(
'family' => true,
// 'style', 'weight', 'subset', 'variation' will appear and disappear along with 'family'
'size' => true,
'line-height' => true,
'letter-spacing' => true,
'color' => true
),
'attr' => array( 'class' => 'custom-class', 'data-foo' => 'bar' ),
'label' => __('Label', 'fw'),
'desc' => __('Description', 'fw'),
'help' => __('Help tip', 'fw'),
)
WP Editor
Expand Down

0 comments on commit 5819925

Please sign in to comment.